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

Allow filtering of rules in rules command #1270

Closed
natanrolnik opened this issue Feb 1, 2017 · 2 comments
Closed

Allow filtering of rules in rules command #1270

natanrolnik opened this issue Feb 1, 2017 · 2 comments
Labels
enhancement Ideas for improvements of existing features and rules.

Comments

@natanrolnik
Copy link
Contributor

natanrolnik commented Feb 1, 2017

I started implementing a filtering feature in the rules command yesterday. For example, showing only enabled, disabled, the ones that only show warnings, and more.

When looking into the code, I initially thought of adding options to RulesOptions. But as RulesCommand accepts only one Argument at the moment, I think it would make sense one of the choices:

A - Keep using RulesCommand for both; if a rule identifier is passed, it always wins over the other options; otherwise, it will list all rules (and filter if filter-enabled is passed).
B - Create a new command, RuleCommand (Singular, not plural), that prints only the rule that relates to the passed identifier. And keep RulesCommand only for displaying multiple rules, according to the filtering options.

Both choices have their pros/cons, and I personally prefer A. Do you see any better way of doing this? I'll be happy to open a PR in the next few days according to the suggestions here.

@marcelofabri marcelofabri added the enhancement Ideas for improvements of existing features and rules. label Feb 1, 2017
@natanrolnik
Copy link
Contributor Author

natanrolnik commented Feb 2, 2017

Ok, I gave it a try in #1275 and chose option A. Please let me know your thoughts.

@marcelofabri
Copy link
Collaborator

Fixed in #1293 💯

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

2 participants