is there extended documentation on defining eastwood configs? I have theoretically disabled a warning, and I don't get any error from the config, but I still get warnings
(disable-warning
{:linter :suspicious-expression
:if-inside-macroexpansion-of '#{accounting-common.spec/defkeys}
:within-depth 6
:reason "defkeys generates a call to and which sometimes has one arg and that is OK"})
the following works, which might indicate an eastwood bug?
(disable-warning
{:linter :suspicious-expression
:for-macro 'clojure.core/and
:if-inside-macroexpansion-of #{'accounting-common.spec/defkeys}
:within-depth 6
:reason "defkeys generates a call to and which sometimes has one arg and that is OK"})
never mind, I see the difference that actually matters here, pebkac and not a bug
Sorry, no extended docs on the disable-warning macro in Eastwood, other than the existing code.
Glad you figured it out!
yeah, existing code was the trick to understanding what was happening
also - unexpected benefit of eastwood - I can mark code with fatal static errors as dead :D
(since I know that if any code path had ever called that code we would have known it was broken)
also, double test definitions revealing less test coverage than expected...
Hwody there, I saw this doc about inline ignoring warnings: https://github.com/jonase/eastwood/blob/master/doc/README-clojure-annotations.md Is this a design discussion or has it been implemented?
double test definitions was my motivating use case for starting to hack on Eastwood in earnest, to add that feature.
It is such an easy mistake to make when copying and pasting deftest definitions using clojure.test, and it is very difficult to notice that mistake unless you go to the trouble of tweaking a test to make sure it can fail.
@rymndhng I started hacking on a way to add specially-formatted comments to disable Eastwood warnings, localized to a specific form in your Clojure code, rather than disabling a linter entirely. I never got it into a working form.
I don't know of any existing thing that works like tools.reader does for reading Clojure data/code, that remembers the existence and contents of comments.
I have a tiny bit of thoughts/advice on implementation, if someone wants to go for it.