crystal-ameba / ameba

A static code analysis tool for Crystal
https://crystal-ameba.github.io
MIT License
514 stars 35 forks source link

A dedicated `rules` command #440

Open devnote-dev opened 8 months ago

devnote-dev commented 8 months ago

This is more of an extension to #130 but implemented as a dedicated command. Most, if not all, Ameba rules have a comment describing the functionality of the rule, the YAML configuration key for the rule and code examples for some. Implementing these comments as part of the actual rules to be displayed in a dedicated command would help a lot with understanding how the rule works or what it's targeting.

For my specific use-case, it would help with identifying which rules are disabled by default so that I can enable them in the config instead of having to run ameba --all --except RulesThat,ShouldBe,Ignored. Ideally, a dedicated command to add all of these rules into the generated config file would be nice, but that's a separate issue.

Sija commented 7 months ago

There are --rules and --describe <rule-name> switches (see #390) that should alleviate your needs (at least to the certain degree) :)

Merit of #130 still holds and waits for a resolutions though.