NoahTheDuke / splint

A Clojure linter focused on style and code shape.
https://cljdoc.org/d/io.github.noahtheduke/splint/
Mozilla Public License 2.0
109 stars 2 forks source link

FR: cli flag to enable specific rules, overriding all other configuration #13

Closed NoahTheDuke closed 1 month ago

NoahTheDuke commented 4 months ago

Problem statement

Looking for specific issues in a codebase can be time-consuming. Splint allows for enabling and disabling rules, but modifying .splint.edn to focus on a specific rule is inconvenient and error-prone. It would be a boon to allow for specifying rules at the command line while disabling all others.

Potential solution

Something like --only style/apply-str or --rule style/apply-str. Can take multiple entries. After the config is processed, update all rules to be disabled, then enable provided rules.

Prior art

RuboCop has --only which takes one or more cops separated by commas: rubocop --only Rails/Blank,Layout/HeredocIndentation,Naming/FileName.

clj-kondo allows for passing a config map: clj-kondo --lint corpus --config '^:replace {:linters {:redundant-let {:level :info}}}' I hate writing maps in the cli, so I don't wanna do that one. I also don't want to mess around with metadata, everything should be explicit imo.

NoahTheDuke commented 1 month ago

Implemented in 9ca4cfa.