Fork me on GitHub
#clj-kondo
<
2021-12-26
>
scaturr18:12:53

How does one handle dependencies via :macroexpand? I use camel-snake-kebab to generate a name and when I run clj-kondo I get an error like this:

WARNING: file camel_snake_kebab/core.clj not found while loading hook
WARNING: error while trying to read hook for my.lib/defmagic: Could not find namespace: camel-snake-kebab.core.

borkdude18:12:06

you cannot load dependencies from hooks unless you put those dependencies in your config dir. but I don't recommend doing that, keep your hooks as small as possible for better performance

scaturr18:12:39

Ah. Thank you 🙂

Kurt Harriger21:12:21

Hi there, I wanted to contribute a few documentation updates to the fulcro user guide https://github.com/fulcrologic/fulcro-developer-guide/pull/98/files which currently includes a step

[#clj-kondo]*clj-kondo support*: Fulcro exports configs for the clj-kondo linter (used e.g. by Calva). To import them, create `.clj-kondo/config.edn` containing `{}` and run `clj-kondo --copy-configs --dependencies --lint (clojure -Spath)` and follow the printed instructions for adding them to the config file.
When I ran this it appeared to do nothing. I think this step is obsolete as vscode did not complain about defsc and as far as I can tell clj-kondo can now discover these configs automatically… but I was asked if I could confirm before they merge these documentation changes.

wilkerlucio10:12:58

hello, I saw it but, altough its not required to include de config paths, running with —copy-configs is still required to happen once

borkdude21:12:07

Yes, the newest clj-kondo now does this automatically :thumbsup:

gratitude-thank-you 1
wilkerlucio01:12:06

the part of copying the configs from the deps is also automatic now? (no need for --copy-configs?)

borkdude07:12:28

That part still requires the flag

Kurt Harriger19:12:44

so if I rm -r .clj-kondo and rm -r .lsp an then restart visual studio I can confirm that vscode is automatically downloading config files into .clj-kondo folder evne without an empty config.edn file.

tree -a .clj-kondo -L 1
.clj-kondo
├── .cache
├── com.fulcrologic
└── com.wsscode
This appears to happen when starting up clojure lsp. If I delete the .clj-kondo folder without removing the .lsp folder the files do not reappear. If I then run clj-kondo --copy-configs --dependencies --lint '(clojure -Spath)' and check the .clj-kondo folder it does create a .cache/lock file but it does not seem to otherwise download any files until clojure lsp is started

borkdude19:12:23

--lint '$(clojure -Spath)'

borkdude19:12:28

you forgot the dolllar

Kurt Harriger19:12:06

oh interesting the fulcro dev guide did not have this $ either and command listed there gave an error

Kurt Harriger19:12:27

I thought it needed to be quoted, but actually it needed a $

Kurt Harriger19:12:09

either way it doesn’t seem this command is necessary as they do seem to automaticallly be downloaded when clojure lsp starts

Kurt Harriger19:12:31

is it worth putting this back in the development guide with the $ ? are there cases where it is necessary to do this manually

borkdude19:12:42

not everyone uses clojure-lsp

borkdude19:12:01

but you can add a note that if you do, then it executes those commands already

Kurt Harriger19:12:13

:thumbsup: thanks