clj-kondo

https://github.com/clj-kondo/clj-kondo
2020-11-20T17:18:14.478800Z

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

borkdude 2020-11-20T17:27:58.479Z

yes, all the configs merge

borkdude 2020-11-20T17:28:16.479200Z

does this give a problem?

borkdude 2020-11-20T17:28:41.479600Z

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

borkdude 2020-11-20T17:29:54.479900Z

^ @mynomoto

2020-11-20T17:35:20.481900Z

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.

borkdude 2020-11-20T17:38:37.482900Z

@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

borkdude 2020-11-20T17:39:19.483500Z

@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

borkdude 2020-11-20T17:39:35.483900Z

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

2020-11-20T17:41:45.484500Z

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

borkdude 2020-11-20T17:42:48.485200Z

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

2020-11-20T17:43:46.485800Z

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

borkdude 2020-11-20T17:44:16.486200Z

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

borkdude 2020-11-20T17:44:20.486500Z

as a JVM lib

borkdude 2020-11-20T17:44:24.486700Z

as output from run!

borkdude 2020-11-20T17:46:20.486900Z

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

2020-11-20T18:02:14.487200Z

Ok, thanks. I will try that.