NoahTheDuke / splint

A Clojure linter focused on style and code shape.

Home Page:https://cljdoc.org/d/io.github.noahtheduke/splint/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

NoahTheDuke opened this issue · comments

commented

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.

commented

Implemented in 9ca4cfa.