This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-07
Channels
- # babashka (17)
- # beginners (33)
- # calva (9)
- # cider (2)
- # clj-kondo (17)
- # cljs-dev (2)
- # cljsrn (2)
- # clojars (3)
- # clojure (60)
- # clojure-australia (2)
- # clojure-europe (8)
- # clojure-gamedev (5)
- # clojurescript (27)
- # cursive (2)
- # emacs (9)
- # fulcro (8)
- # gratitude (5)
- # lsp (41)
- # malli (3)
- # meander (18)
- # pathom (5)
- # polylith (25)
- # re-frame (17)
- # reagent (1)
- # rewrite-clj (6)
- # shadow-cljs (11)
- # uncomplicate (5)
- # vim (6)
- # web-security (5)
I've just added clj-kondo.exports
to next.jdbc
-- can someone sanity check that I did it correctly? https://github.com/seancorfield/next-jdbc/commit/99f814bb258a8e11924f6cb9f72274daa04647b8 -- I know that the with-transaction
macro is already baked into clj-kondo
but this will pave the way for any future macros added to next.jdbc
. I am about to move on to Expectations next.
@seancorfield That looks good. Note that you don't have to duplicate your config. You can refer to your config in the exported directory by adding it to :config-paths
in .clj-kondo/config.edn
Note that namespaces inside the exported directory should also follow an org/lib structure. Instead of hooks.next-jdbc
choose seancorfield.next-jdbc
for example, this will ensure that you won't get conflicts with anyone else that writes hooks for this library
Ah, I thought the hooks were already "local" to that tree. My bad. As for the "copy", that's what happens when I run clj-kondo --copy-configs --dependencies --lint "$(clojure -Spath)"
on the project so I can work within it.
(and that seems to be what the documentation suggests you should do, BTW)
(updated the next-jdbc
hook to
)
Clojure-LSP automatically lints the code with those settings so everyone who uses clojure-lsp will receive those configs in their .clj-kondo
directory and then can opt in via :config-paths
Is the expectation that a project should .gitignore
everything in the .clj-kondo
folder except config.edn
? I'm already ignoring .clj-kondo/.cache
in most projects...
@seancorfield No, just .cache
. The config (also imported configs) can be checked in so linting works the same for everyone who runs clj-kondo on it, in CI, etc.
OK. And, just to be clear, that means the "duplicated" config since clj-kondo
copies it when you run that command (that I showed above).
You can gitignore that part of your .clj-kondo for your specific project, since its already in your source control, especially when you configure it via :config-paths
For other users of your library I recommend checking in into their source control in the .clj-kondo
dir
OK, thanks. That helps clarify things -- but isn't obvious from the docs.