Fork me on GitHub
#eastwood
<
2022-10-06
>
lread22:10:33

I just let eastwood loose on cljdoc, https://github.com/cljdoc/cljdoc/pull/683.

lread22:10:34

Admittedly I did not need to fix reflection warnings, but they did help me find many old usages of String interop that clojure.string can now replace.

lread22:10:48

Anyhoo thanks @U45T93RA6 for all the hard work on eastwood!

vemv22:10:38

🍺 🍺 ❤️

❤️ 4
🍻 4
borkdude09:10:17

Nice! Btw, there is also a :warn-on-reflection linter in clj-kondo: it doesn't check runtime reflection issues, but just warns that whenever you do Java interop and you haven't explicitly set this var :)

lread13:10:16

Thanks, it was an interesting exploration! Some of the findings I really appreciated from eastwood were: • when I am using deprecated Java things • all the reflection warnings (although again, one could argue I should not have addressed these for cljdoc) • warnings on suspicious code, like https://github.com/cljdoc/cljdoc/commit/e3560870b2cd3453706455f4e17bf494f2fc1c2f and https://github.com/cljdoc/cljdoc/commit/e50933bed71bb1793b45c0d20a66dc50a9968a91 and https://github.com/cljdoc/cljdoc/commit/2746d1ef43d702ed582acefcd76e5714d748edc9. • and the https://github.com/cljdoc/cljdoc/commit/5788c9b3236781dfdafb710d9ecfb113bda2874c was nice too.

borkdude13:10:27

Why is the first one suspicious? The second one can be detected by clj-kondo too: :redundant-call

borkdude14:10:16

The earmuff warning is something we could easily add to clj-kondo too

lread14:10:07

Ah good old :redudant-call I must not have that enabled for my kondo lint? For the first one, eastwood noticed that the when-not was based on a constant and would always evaluate to the same thing. Not necessarily something I had to address, but I appreciated the heads up. And I think I made the code clearer as a result.

lread14:10:19

There was also https://github.com/cljdoc/cljdoc/commit/d1314df5187e79f62ddd86cb948d20012508b194 (the warning was something to do with a let binding, probably after macro-expand?), but in hindsight, I think I might have addressed it mostly to quiet the eastwood warning. Code, I think is fine before and after. So 🤷.