Fork me on GitHub

I wonder what might be causing it. I don’t have any other format in the namespace. I also tried to delete .clj-kondo/.cache but the error still persists.


@islambeg format isn't available in .cljs

🙌 1

Oh didn’t know that, thanks!


🎉 4

Hey! I am trying to write a little stack based DSL and set up clj-kondo to check the syntax. May be someone did something like this? Two questions. 1. Is it a good idea in general to use clj-kondo for this? 2. I don't know how to parse syntax inside a hook. As I get it, there is no way to use core.spec or instaparse here. And I can't even require a clj-kondo.hooks-api/prewalk (but it seems to be in the

WARNING: error while trying to read hook for dumch.concatenative/defstackfn: prewalk does not exist


@arturdumchev In the hook environment you have clojure.walk/prewalk

👍 1
Stefan T19:08:35

When linting a directory, is it possible to globally exclude certain patterns? In my case I'm seeing that kondo spends a lot of time node_modules and some other directories with many files that I'd like to have kondo skip all together.


@stefan.toubia I recommend not including node_modules in the --lint arguments


If you're doing --lint . then change it into --lint src test whatever

Stefan T19:08:28

In my case I'd like to lint a directory containing dozens of projects all in one go. This directory contains more than just Clojure projects though.

Stefan T19:08:46

Basically I'm trying to lint the entire monorepo


@stefan.toubia Maybe a little bit of scripting is more appropriate here then. E.g. recurse through all repos and extract all source dirs or all .clj files and then pass that


You can call clj-kondo from #babashka as well


It's also recommended to call clj-kondo from within each project and not from a global parent directory. You can also do this with scripting

Stefan T19:08:50

Yeah OK maybe I'll give that a try, thanks. I agree that exclusion patterns are kind of a pain to deal with. Ignoring node_modules is a regular problem for most tools though (damn you Node!)


Haha, Node is the reason I moved all my code out of Dropbox (I used that as an extra safeguard before committing)

🥲 1
Stefan T19:08:45

Is kondo currently able to read deps.edn to find the class paths that should be linted?


you can feed clj-kondo a classpath with $(clojure -Spath)

Stefan T19:08:18

Ah of course. Well then I guess I'm already set, our monorepo has an aggregated deps.edn in the repo root with all projects paths listed. Thanks again for your help!


Note that this path will also include all dependencies

Stefan T19:08:34

Ah yes, this is true. Are there valid use cases for linting dependencies, does kondo need to do this to maybe lint macros from those dependencies? I'm back to wondering if a global exclude makes sense, in my case I could exclude .m2 and node_modules directories.


You can lint your src folders without linting dependencies first, this works fine, but will give you less accurate analysis


E.g. if you're interested in finding that your code calls with the wrong amount of arguments, you need to analyze first

Stefan T19:08:27

Ah ok thanks that makes sense.