eastwood

All things realted to eastwood - the Clojure linter
2018-09-14T21:02:18.000100Z

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

2018-09-14T21:03:19.000100Z

(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"})

2018-09-14T21:21:10.000100Z

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"})

2018-09-14T21:23:47.000100Z

never mind, I see the difference that actually matters here, pebkac and not a bug

2018-09-14T22:00:04.000100Z

Sorry, no extended docs on the disable-warning macro in Eastwood, other than the existing code.

2018-09-14T22:00:34.000100Z

Glad you figured it out!

2018-09-14T22:02:51.000100Z

yeah, existing code was the trick to understanding what was happening

2018-09-14T22:05:41.000100Z

also - unexpected benefit of eastwood - I can mark code with fatal static errors as dead :D

2018-09-14T22:06:08.000100Z

(since I know that if any code path had ever called that code we would have known it was broken)

2018-09-14T22:06:39.000100Z

also, double test definitions revealing less test coverage than expected...

2018-09-14T23:16:50.000100Z

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?

2018-09-14T23:55:27.000100Z

double test definitions was my motivating use case for starting to hack on Eastwood in earnest, to add that feature.

2018-09-14T23:56:09.000100Z

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.

2018-09-14T23:57:59.000100Z

@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.

2018-09-14T23:58:33.000100Z

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.

2018-09-14T23:59:19.000100Z

I have a tiny bit of thoughts/advice on implementation, if someone wants to go for it.