Confirming - the expectation for the .clj-kondo/imports directory in my project is that it is committed to VCS?
I commit those yes
Ok. Those are created/updated at a point in time with a command like this?
clj-kondo --lint "$(clojure -Spath)" --dependencies --copy-configs --skip-lintyes
FWIW: confusion is coming from the recent Cursive + clj-kondo release where I now have a bunch of these files, and I do not know how they were created
Got it - thank you π
ok, I think Cursive might be doing this for you
similar to clojure-lsp
Do you have any idea if the editors see this directory as managed by them? e.g., theyβll update it as my deps change over time. Or am I supposed to manually update it with the above command regularly?
depends on the editor
clojure-lsp does re-analyze stuff when deps.edn have changed I think (cc @ericdallo)
or maybe when the lsp server starts
I can't say for Cursive
Makes sense. Thanks for the quick response!
yes when starts. BTW at Nubank we stopped completly commiting those, especially because LSP always opy them from kondo/deps, so it's reproducable already with that deps you have
our git ignore looks like:
/.clj-kondo/*
!/.clj-kondo/config.ednthat git config only works when you don't have any other hook files in your project but makes sense, whatever works
commit those generated lots of noise for devs, all the time a new lib was bumped and them it needed to update it along with project changes
yes, we have hooks in a central place
in the future I'd like clj-kondo to have the concept of a classpath too so it can maybe just read those files directly from the classpath, although I don't know how much of a slowdown that will be
yeah that would be nice
Sorry if this is a dumb question but am I doing something wrong, or should I open a bug on GH?
I created a new project to make sure it's not something weird with my config. (Kondo version = 2025.07.28)
(ns example.x)
(defn ^:deprecated deprecated-fn-1 [x]
(+ x 1))
(defn ^:deprecated deprecated-fn-2 [x]
(+ x 1))
(defn ^:deprecated deprecated-fn-3 [x]
(+ x 1))
(defn y [x]
(-> x
#_{:clj-kondo/ignore [:deprecated-var]}
deprecated-fn-1
#_{:clj-kondo/ignore [:deprecated-var]}
deprecated-fn-2
deprecated-fn-3))
When I run Kondo:
cam@Cam-PC:~/test-project$ clj -M:kondo
src/example/x.clj:14:9: info: Redundant ignore
src/example/x.clj:15:7: warning: #'example.x/deprecated-fn-1 is deprecated
src/example/x.clj:18:7: warning: #'example.x/deprecated-fn-3 is deprecated
linting took 61ms, errors: 0, warnings: 2
I would have expected deprecated-fn-3 to trigger a warning, but not deprecated-fn-1. Also, not sure why this would be considered a redundant ignoreI ran into this while working on real code and I created this minimal example to double-check stuff before posting here
It is likely because clj kondo has a built to expand -> forms and the expansion is nested
@camsaul here's a solution PR: https://github.com/clj-kondo/clj-kondo/pull/2611