Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve output of "rules" command #392

Closed
nmccann opened this issue Jan 21, 2016 · 5 comments
Closed

Improve output of "rules" command #392

nmccann opened this issue Jan 21, 2016 · 5 comments
Labels
enhancement Ideas for improvements of existing features and rules.
Milestone

Comments

@nmccann
Copy link
Contributor

nmccann commented Jan 21, 2016

I'm wondering if there are currently any plans to improve the output of the swiftlint rules command to help with discoverability. While trying to integrate with SwiftLint, I found myself constantly referring to the source code of the various rules to determine what their defaults were, what the triggered or didn't trigger them etc. The recent addition of opt-in rules complicates things even further.

The current output of the rules command is limited to the name of the rule. It's not clear whether or not the rule is enabled by default, or if it has to be opted into.

Some proposals, roughly ordered in (estimated) level of effort:

  • Group opt-in rules and display them in a way that is makes them visually distinct from default rules
  • Show description of rule after it's identifier
  • Show parameters for configurable rules
    ** Alternatively, make it obvious whether or not a rule is configurable and require that users drill down for more details with something like swiftlint rules variable_name_min_length --help

If this is something that would be useful, I'd be interested in helping out.

Thank you for your time,
Noah

@marcelofabri
Copy link
Collaborator

I like how fastlane handles this:

$ fastlane actions
+--------------------------------+-------------------------------------------------------------------------------+---------------------------+
|                                                         Available fastlane actions                                                         |
+--------------------------------+-------------------------------------------------------------------------------+---------------------------+
| Action                         | Description                                                                   | Author                    |
+--------------------------------+-------------------------------------------------------------------------------+---------------------------+
| add_git_tag                    | This will add an annotated git tag to the current branch                      | lmirosevic                |
| appaloosa                      | Upload your app to Appaloosa Store                                            | Appaloosa                 |
| appetize                       | Create or Update apps on Appetize.io                                          | giginet                   |

...

| xcodebuild                     | Use the `xcodebuild` command to build and sign your app                       | dtrenz                    |
| xctest                         | Runs tests on the given simulator                                             | dtrenz                    |
| xctool                         | Run tests using xctool                                                        | KrauseFx                  |
+--------------------------------+-------------------------------------------------------------------------------+---------------------------+
  Total of 140 actions

Get more information for one specific action using `fastlane action [name]`

And then you can run fastlane action [name]:

$ fastlane action create_pull_request
Loading documentation for create_pull_request:

+-----------------------------------------------+
|              create_pull_request              |
+-----------------------------------------------+
| This will create a new pull request on GitHub |
|                                               |
| Created by seei                               |
+-----------------------------------------------+

+-------------+--------------------------------------------------------------------------------------------------------------------------+-------------------------------+
|                                                                          create_pull_request                                                                           |
+-------------+--------------------------------------------------------------------------------------------------------------------------+-------------------------------+
| Key         | Description                                                                                                              | Env Var                       |
+-------------+--------------------------------------------------------------------------------------------------------------------------+-------------------------------+
| * api_token | Personal API Token for GitHub - generate one at https://github.com/settings/tokens                                       | GITHUB_PULL_REQUEST_API_TOKEN |
| * repo      | The name of the repository you want to submit the pull request to                                                        | GITHUB_PULL_REQUEST_REPO      |
| * title     | The title of the pull request                                                                                            | GITHUB_PULL_REQUEST_TITLE     |
| body        | The contents of the pull request                                                                                         | GITHUB_PULL_REQUEST_BODY      |
| head        | The name of the branch where your changes are implemented (defaults to the current branch name) (default: 'development') | GITHUB_PULL_REQUEST_HEAD      |
| base        | The name of the branch you want your changes pulled into (defaults to `master`) (default: 'master')                      | GITHUB_PULL_REQUEST_BASE      |
+-------------+--------------------------------------------------------------------------------------------------------------------------+-------------------------------+
3 of the available parameters are required
They are marked with an asterisk *

More information can be found on https://github.com/fastlane/fastlane/blob/master/docs/Actions.md

@nmccann
Copy link
Contributor Author

nmccann commented Jan 21, 2016

@marcelofabri agreed, I too expected fast lane style output. Although I'm not sure the author column is needed, it kind of works against the notion that anyone can contribute.

But the rest of it is nice :)

@marcelofabri
Copy link
Collaborator

Sure, I agree with that. Also SwiftLint doesn't (as far as I know) support parameters as environment variables, do that column shouldn't exist.

@jpsim
Copy link
Collaborator

jpsim commented Jan 21, 2016

Yes, I'm wholly in favor of this. The rules command used to have more formatting (Markdown) when it was initially written, but that formatting made it hard to read as console output. The proposed table style makes sense to me!

@jpsim jpsim added the enhancement Ideas for improvements of existing features and rules. label Jan 29, 2016
@scottrhoyt scottrhoyt added this to the 1.0.0 milestone Feb 3, 2016
@jpsim
Copy link
Collaborator

jpsim commented Feb 6, 2016

many improvements to the rules command were included in 0.8.0. I'll close this issue, but please file new issues for specific improvements that can still be made.

@jpsim jpsim closed this as completed Feb 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules.
Projects
None yet
Development

No branches or pull requests

4 participants