clj-kondo

walterl 2025-09-09T10:22:53.700649Z

Hi. How can I get clj-kondo to follow symlinks when loading config? In a Clojure submodule, in a monorepo, I have a .clj-kondo symlink to ../.clj-kondo. But when I run clj-kondo from that submodule's directory, --lint output indicates that the config is not being loaded. If I add --config-dir ../.clj-kondo, it runs as expected.

borkdude 2025-09-09T10:24:11.050179Z

You could also add this in your local project:

.clj-kondo/config.edn
with:
{:config-paths ["../../.clj-kondo"]}

borkdude 2025-09-09T10:24:26.449929Z

this will load the additional ../.clj-kondo directory

borkdude 2025-09-09T10:24:42.312969Z

the double ../../ is because of it's relativeness to the config file

walterl 2025-09-09T10:25:07.598499Z

Yes! That seems like what I need. Let me try...

borkdude 2025-09-09T10:25:56.293169Z

it would probably be nice to follow the symlink too btw, Github issue welcome

walterl 2025-09-09T10:32:23.832539Z

Hmmm... maybe it was loading the config via the symlink, but something else is wrong.

walterl 2025-09-09T10:37:14.798649Z

The sub-dir is called base. When I run clj-kondo --lint src test from base (with a config as suggested above OR a symlinked dir), I get a whole bunch of "Unresolved symbol" errors regarding deps that are in base/deps.edn. When I run clj-kondo --config-dir ../.clj-kondo --lint src test I don't see any of those "Unresolved symbol" errors. OTOH, when I clear out the .clj-kondo/config.edn in my repo root, I get more errors, due to all the customizations (hooks, lint-as, etc) no longer being loaded.

walterl 2025-09-09T10:37:52.361119Z

Could it be that deps are cached in a path-sensitive way, causing the imports for those deps to not resolve correctly when run from the base sub-dir?

walterl 2025-09-09T10:40:01.222749Z

The affected libs are potemkin and manifold, if that matters.

borkdude 2025-09-09T10:40:23.230109Z

I need a repro in code in a github repo since doing this in prose is too confusing for me :)

👍 1
imre 2025-09-09T15:15:44.300859Z

.

walterl 2025-09-09T19:37:21.278199Z

https://github.com/clj-kondo/clj-kondo/pull/2622

phronmophobic 2025-09-09T19:40:12.519229Z

I ran the instructions from https://github.com/clj-kondo/clj-kondo/blob/master/doc/install.md#installation-script-macos-and-linux on my macbook and got:

$ ./install-clj-kondo
Downloading  to /tmp
mv: rename /tmp/clj-kondo to /usr/local/bin/clj-kondo: Permission denied
It seems like this has been run into before. https://clojurians.slack.com/archives/CHY97NXE2/p1708629564843289?thread_ts=1708625016.482119&cid=CHY97NXE2 I was able to work around it, but it might be worth a mention in the docs. Thanks! gratitude

borkdude 2025-09-09T19:51:13.800329Z

The docs say something about sudo I believe

phronmophobic 2025-09-09T19:52:36.266969Z

I did ctrl+f on this page https://github.com/clj-kondo/clj-kondo/blob/master/doc/install.md#installation-script-macos-and-linux and couldn't find any mention of sudo.

borkdude 2025-09-09T19:53:07.673609Z

Ah then it must be the babashka READMe that mentions it

borkdude 2025-09-09T19:53:16.979229Z

Sorry for confusing those

phronmophobic 2025-09-09T19:54:22.281819Z

No problem!