This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-06
Channels
- # aleph (70)
- # announcements (9)
- # babashka (43)
- # babashka-sci-dev (6)
- # beginners (97)
- # cider (2)
- # clj-commons (3)
- # clj-kondo (41)
- # clojure (88)
- # clojure-europe (44)
- # clojure-nl (2)
- # clojure-spec (22)
- # clojurescript (65)
- # community-development (6)
- # conjure (10)
- # cursive (6)
- # datahike (13)
- # datomic (4)
- # eastwood (11)
- # events (1)
- # fulcro (45)
- # graalvm (1)
- # graphql (3)
- # hyperfiddle (3)
- # integrant (7)
- # jobs (1)
- # lambdaisland (1)
- # lsp (58)
- # nbb (4)
- # nrepl (3)
- # pathom (15)
- # shadow-cljs (27)
- # tools-deps (1)
I just let eastwood loose on cljdoc, https://github.com/cljdoc/cljdoc/pull/683.
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.
Anyhoo thanks @U45T93RA6 for all the hard work on eastwood!
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 :)
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.
Why is the first one suspicious?
The second one can be detected by clj-kondo too: :redundant-call
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.
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 🤷.