Fork me on GitHub
#clj-kondo
<
2020-11-20
>
mynomoto17:11:14

When using several :config-paths is it expected that configs for :unresolved-symbol, :deprecated-var, :output to merge/concatenate?

borkdude17:11:58

yes, all the configs merge

borkdude17:11:16

does this give a problem?

borkdude17:11:41

you can prevent merging / override by putting ^:replace on a map value

mynomoto17:11:20

I may be doing something wrong then. I have a monorepo and on the toplevel I added a config to make my editor happy. I was trying to only have :config-paths pointing to the subprojects configs. But when I deleted the rest of the configuration on the toplevel warnings started to show on the editor.

borkdude17:11:37

@mynomoto if you could make a small github repo that mimics your problem, I'd be happy to take a look. You can probably make deliberate mistakes in the config and they will get logged as warnings, to see if they are being processed at all

borkdude17:11:19

@mynomoto Note that clj-kondo will only look up one time for a .clj-kondo directory. .clj-kondo directories on a higher level won't be seen

borkdude17:11:35

so if you have a .clj-kondo in your subrepo and one on the top-level, only the subrepo one will be considered

mynomoto17:11:45

Is there a way to see the config that is being used after the :config-paths are processed?

borkdude17:11:48

not currently, but you could try with clj-kondo in the JVM and stick a println somewhere in clj-kondo/impl/config.clj

mynomoto17:11:46

Ok, thanks. I will try to investigate/reproduce on a small project.

borkdude17:11:16

oh btw, you might be able to see the config when you use clj-kondo.core

borkdude17:11:20

as a JVM lib

borkdude17:11:24

as output from run!

borkdude17:11:20

user=> (require '[clj-kondo.core :as k])
nil
user=> (keys (k/run! {:lint ["src"]}))
(:findings :config :summary)
^ @mynomoto

mynomoto18:11:14

Ok, thanks. I will try that.