Fork me on GitHub
#clj-kondo
<
2024-05-22
>
borkdude12:05:43

https://github.com/clj-kondo/clj-kondo: static analyzer and linter for Clojure code that sparks joy 2024.05.22 • https://github.com/clj-kondo/clj-kondo/issues/2323: New linter :redundant-str-call which detects unnecessary str calls. Off by default. • https://github.com/clj-kondo/clj-kondo/issues/2302: New linter: :equals-expected-position to enforce expected value to be in first (or last) position. See https://github.com/clj-kondo/clj-kondo/blob/master/doc/linters.mdhttps://github.com/clj-kondo/clj-kondo/issues/1035: Support SARIF output with --config {:output {:format :sarif}}https://github.com/clj-kondo/clj-kondo/issues/2307: import configs to intermediate dir • https://github.com/clj-kondo/clj-kondo/issues/2309: Report unused for expression • https://github.com/clj-kondo/clj-kondo/issues/2315: Fix regression with unused JavaScript namespace • https://github.com/clj-kondo/clj-kondo/issues/2304: Report unused value in defn body • https://github.com/clj-kondo/clj-kondo/issues/2227: Allow :flds to be used in keys destructuring for ClojureDart • https://github.com/clj-kondo/clj-kondo/issues/2316: Handle ignore hint on protocol method • https://github.com/clj-kondo/clj-kondo/issues/2322: Add location to warning about invalid unicode character • https://github.com/clj-kondo/clj-kondo/issues/2319: Support :discouraged-var on global JS values, like js/fetch

🎉 5
🚀 2
ambrosebs02:05:48

I'm not sure why but this release seemed to break some of my macro hooks https://github.com/typedclojure/typedclojure/actions/runs/9199303978/job/25303812581

ambrosebs02:05:35

they don't seem to be recognized any more

ambrosebs02:05:42

I'll try some of the snapshots between versions.

ambrosebs02:05:31

breaks on 2024.03.14-20240521.134427-19

borkdude08:05:52

@U055XFK8V hmmm, I'll take a look

borkdude09:05:11

@U055XFK8V how can I run this locally?

borkdude10:05:26

The bash function run-tests refers to a script ./script/test but I can't find it in the repo. Unfortunately it takes me a lot of time to go through this bash stuff to find out what's going on

borkdude10:05:19

One possible issue could be that you have linted/analyzed/imported configs with clj-kondo current and then lint with an older kondo, which doesn't work anymore since the imported configs are now in .clj-kondo/imports

borkdude10:05:42

$ rg "clj-kondo/clj-kondo"
example-projects/clj-kondo-hooks/deps.edn
5:           {:replace-deps {clj-kondo/clj-kondo {:mvn/version "2024.03.13"}}

borkdude15:05:16

@U055XFK8V I think I pointed to the cause in the message before yours

borkdude15:05:53

but I'll try your repro now

borkdude15:05:49

when I check out your repro, and mkdir -p .clj-kondo and then run script/lint it works

borkdude15:05:17

what else should I do to repro?

borkdude15:05:10

This is in deps.edn:

{:deps {org.clojure/clojure {:mvn/version "1.11.1"}
        org.typedclojure/typed.clj.runtime {:mvn/version "1.2.1"}}
 :aliases {:clj-kondo
           {:replace-deps {clj-kondo/clj-kondo {:mvn/version "2024.05.22"}}
            :main-opts ["-m" "clj-kondo.main"]}}}
which is the new version

ambrosebs15:05:40

hmm I get the output in bad.txt with the new version.

ambrosebs15:05:56

and good.txt with the previous version

borkdude15:05:21

oh I see, bash is screwing us:

borkdude@m1-3 /tmp/clj-kondo-2024-05-22-reprod (main) $ script/lint
+ rm -r .clj-kondo
rm: .clj-kondo: No such file or directory
borkdude@m1-3 /tmp/clj-kondo-2024-05-22-reprod (main) $ mkdir .clj-kondo
borkdude@m1-3 /tmp/clj-kondo-2024-05-22-reprod (main) $ script/lint
+ rm -r .clj-kondo
+ mkdir -p .clj-kondo
+ clojure -M:clj-kondo --version
clj-kondo v2024.05.22
++ clojure -Spath
Downloading: org/typedclojure/typed.clj.runtime/1.2.1/typed.clj.runtime-1.2.1.pom from clojars
Downloading: org/typedclojure/pom.typed/1.2.1/pom.typed-1.2.1.pom from clojars
Downloading: org/typedclojure/typed.clj.runtime/1.2.1/typed.clj.runtime-1.2.1.jar from clojars
+ clojure -M:clj-kondo --lint src:/Users/borkdude/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.jar:/Users/borkdude/.m2/repository/org/typedclojure/typed.clj.runtime/1.2.1/typed.clj.runtime-1.2.1.jar:/Users/borkdude/.m2/repository/org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar:/Users/borkdude/.m2/repository/org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar --copy-configs --skip-lint
Configs copied:
- .clj-kondo/imports/org.typedclojure/typed.clj.runtime
linting took 52ms, errors: 0, warnings: 0
+ tree .clj-kondo
script/lint: line 9: tree: command not found

borkdude15:05:15

yeah now I see:

+ clojure -M:clj-kondo --lint src --config '{:output {:format :text :summary false}}'
src/typed_example/clj_kondo_hooks.clj:4:11: error: Unresolved symbol: a
src/typed_example/clj_kondo_hooks.clj:4:21: error: Expected: number, received: string.
src/typed_example/clj_kondo_hooks.clj:5:3: error: Unexpected usage of recur.

👍 1
borkdude15:05:19

hm, I found the issue, but how on earth didn't any test catch this 😭

ambrosebs15:05:54

haha well I feel better about writing a test that I forgot how it worked 🙂

borkdude16:05:06

will make a new release tonight or tomorrow

borkdude16:05:03

merged. you can probably start using the snapshot

borkdude10:05:01

@U055XFK8V new release is out

ambrosebs14:05:14

thanks

👍 1