"did you mean <>?" for the unknown rule diagnostic #106
Closed
a-frantz
started this conversation in
Rule Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Diagnostic invoked here.
If a user has a comment that reads
#@ except: SnackCase
we should suggestdid you mean 'SnakeCase'?
. The logic for determining the nearest rule should be exposed such that it can be accessed bysprocket
(so thatsprocket
can make similar suggestions for typos on thelint --except <>
command line).As part of this I also suggest we "upgrade" the current diagnostic into a full-fledged
Rule
that can be disabled. A pretty niche application, but there is a use case for this disabling. Imagine a user needs to runsprocket vX
in one environment andsprocket vY
in another.vY
has a rule (FooRule
) not implemented invX
. The lint directive#@ except: FooRule
would currently cause a diagnostic when runningvX
. There is currently no way to prevent that diagnostic from being emitted.I think the user should be able to write
#@ except: UnknownRule,FooRule
to get their desired behavior (no diagnostics emitted under either version).Beta Was this translation helpful? Give feedback.
All reactions