-
Notifications
You must be signed in to change notification settings - Fork 66
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
Provide a way to disable warnings for particular macros, or inside all macro invocations #114
Comments
If you did extend it to functions, would that be a halfway-decent approach to #21? And if you can do it in your own code, can you also do it with some sort of metadata? or at least at the function definition somehow or another? |
It isn't in a released Eastwood version yet, but I have implemented new ways to configure the disabling of warnings for :suspicious-expression and :constant-test warnings based upon what macro expansions the warned-about expression was created from. I will probably extend this to other linters as I find uses for them, or perhaps simply implement it for every linter if it starts to become the majority of them where it seems useful. |
@jafingerhut Would you consider providing any defaults around this? For example: (clojure.test/is (= (:status val) #{:done})) will cause a (clojure.test/is (= #{:done} (:status val))) I'm not sure if suppressing |
This has been possible for a while via (disable-warning
{:linter :suspicious-test
:if-inside-macroexpansion-of ... so the issue is safe to close now :) |
Given that:
It seems that having a way to disable such warnings for particular macros, without modifying the source code of the library, is a desirable thing. Issue #21 would be able to handle selectively disabling warnings, perhaps even in individual expressions within a macro definition (perhaps tricky inside syntax-quoted forms), but it does not address the issue of disabling warnings in projects you do not wish to edit.
A fairly straightforward 'granularity' for this would be to specify a collection of pairs containing (set of macros, set of linters to disable), where macros are specified by their names, perhaps fully qualified, e.g. korma.core/select, and linters by their keyword names in the Eastwood documentation.
Places these could be put:
It might be useful to extend this to functions or var definitions inside any namespace. Not clear if that is useful, but think about it.
The text was updated successfully, but these errors were encountered: