CLI: add option to list all available lint rules
duaraghav8 opened this issue · 0 comments
This is just an initial though, anyone is welcome to participate in this thread. Only once the format is finalised will I add this to Milestone.
Description
A user shouldn't have to head to the docs to view a list of rules (along with detailed description, parameters supplied, autofix availability). The CLI should allow this.
Use case
Much faster & more convenient for user because they don't have to switch windows (think ultra lazy). More convenient for maintainers because they don't have to worry about keeping docs in sync with state of rules any more. The CLI uses code to extract all necessary info from rules and displays the list.
Screenshots
N/A
Alternatives
Documentation - List of rules (different docs for core linter and different plugins)
Comments
Proposed usage, keeping in mind that a user might like to list
- all core lint rules
- rules from an installed plugin like
security
- rules from a rule set such as
solium:recommended
# List all rules of core linter
solium --list-rules
# List rules from a rule set
solium --list-rules --rulesets recommended
# List rules from 1 or more plugins
# Specifying --plugins means the core rules will not be displayed
solium --list-rules --plugins security,foobar
The output should be in a tabular form, just like in the docs
No. Name Description Arguments Autofix available
1 . `error-reason` Provide reason message in `error()` {..} `True`
2. ...