-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
Handle not
in :condition-always-true
/ new linter - :condition-always-false
#2373
Comments
Hmm yes, perhaps we should rename |
Btw, one thing that prevented me to handle the false case in a Slack discussion was the following: (def debug false)
(if debug ...) It would be annoying if clj-kondo complained about that particular usage. |
Btw, this does warn:
|
@borkdude maybe For your example of a debug flag, maybe it'd be possible to add config to the linter with exception names? Like |
Ah wait, this already doesn't warn:
but |
OK, the current way
and
so only on passing a fn and a var, which are commonly reported mistakes. I guess |
[ Leave this text in if you want to promote it. ]
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Is your feature request related to a problem? Please describe.
The
:condition-always-true
linter is very helpful, but it "breaks" when inverting the check withnot
for example.Describe the solution you'd like
It'd be great if
:condition-always-true
could work in cases like(when (not true) ...)
as well, or maybe a separate linter:condition-always-false
.Describe alternatives you've considered
Sometimes the boolean logic is just setup in a way where you get
(not ...)
and so the linter fails to catch errors in there.Additional context
repro.clj
:The text was updated successfully, but these errors were encountered: