Fork me on GitHub
#clj-kondo
<
2023-04-18
>
imre16:04:49

When importing configuration from libs, a merge of those configs must take place somewhere if I'm not wrong. Is the order of this merge known?

borkdude17:04:54

@U08BJGV6E external configs are merged in arbitrary order, after that comes local configuration (`.clj-kondo/config.edn`), then namespace-local config

imre17:04:25

Thank you!

imre18:04:38

If I have my uber-great-config in a dependency and want it to override all other imported configs, is there currently a way to do that?

imre18:04:27

An idea came that we'd want a centrally managed clj-kondo base config that would live in repo A and be used by all other projects living in separate repos.

imre18:04:27

so I'd need something like: all 3rd party configs < my special imported configs < local config < namespace-local config

imre10:04:27

Any suggestions about this? Or is there an already established way to do something similar?

borkdude11:04:18

you can add a :config-paths entry with shared configs

borkdude11:04:38

or add the configs to a dependency and then use clojure-lsp or --copy-configs

borkdude11:04:01

the merging order shouldn't matter since third party configs should only be concerned with specific libs

imre11:04:41

Thanks, I'll give it a go, then. I'm still marginally concerned that I cannot reliably override parts of a third party config but I guess it should be a rare need.

borkdude11:04:05

explicit :config-paths has precedence over copied configs

imre11:04:00

Oh, so anything I name there explicitly overrides anything that's copied? Or is it if there's a config-paths entry then any other copied configs won't be considered?

borkdude11:04:32

:config-paths is basically treated like local config

imre11:04:39

Oh, that's excellent, then

imre11:04:09

And I'm guessing the 'real' local config still takes precedence over those?

borkdude11:04:32

I think so, if I recall correctly

imre11:04:52

Copied < config-paths < local < namespace

imre11:04:03

Exactly what I'm looking for

imre11:04:08

Thank you!

🙏 1
Noah Bogart17:04:38

is it possible to print the current merged config? (before processing a given file)

2
Noah Bogart17:04:36

cool, thank you

borkdude17:04:39

you can also just lint an empty string and then you'll get the config back in run!