This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-03
Channels
- # announcements (5)
- # babashka (7)
- # beginners (119)
- # biff (4)
- # cider (7)
- # clj-kondo (26)
- # cljfx (3)
- # cljs-dev (2)
- # clojure (28)
- # clojure-austin (18)
- # clojure-europe (9)
- # clojure-france (6)
- # clojure-norway (4)
- # clojure-uk (3)
- # clojurescript (6)
- # community-development (1)
- # core-async (4)
- # cursive (9)
- # data-science (12)
- # datomic (13)
- # duct (18)
- # emacs (15)
- # etaoin (5)
- # events (13)
- # honeysql (46)
- # hyperfiddle (9)
- # jackdaw (5)
- # jobs (13)
- # keechma (4)
- # lsp (37)
- # malli (32)
- # nbb (14)
- # off-topic (10)
- # other-languages (2)
- # polylith (4)
- # programming-beginners (3)
- # reagent (27)
- # reitit (1)
- # shadow-cljs (32)
- # sql (11)
- # tools-build (5)
- # tools-deps (3)
- # vim (14)
- # xtdb (11)
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.
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 https://github.com/clj-kondo/clj-kondo/blob/master/src/clj_kondo/hooks_api.clj):
WARNING: error while trying to read hook for dumch.concatenative/defstackfn: prewalk does not exist
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
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.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
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
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)
Is kondo currently able to read deps.edn
to find the class paths that should be linted?
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!
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.
@stefan.toubia I recommend reading this: https://github.com/clj-kondo/clj-kondo/#project-setup
You can lint your src
folders without linting dependencies first, this works fine, but will give you less accurate analysis