Fork me on GitHub
#clj-kondo
<
2022-05-05
>
grahamcarlyle10:05:25

I'm setting up a project's clj-kondo config which uses an library that has an exported clj-kondo config. The manual recommends that I use clj-kondo with --copy-configs etc. and then refer to these copied configs via the :config-paths setting in the project's config.edn. This all works fine but I'm a worried that the libraries exported config will change and so my copy will unwittingly get stale. Do I just have to live with this risk, hoping that any change in the library will result in my stale copied config results in a linting fail, or is there some mechanism I could use to keep my copied config in sync with the library's exported version?

borkdude10:05:13

@grahamcarlyle you don't have to set :config-paths anymore, I should probably remove that. as long as there is a two-level directory like .clj-kondo/foo/bar/config.edn in there, it will be picked up automatically. To keep up to date:

clj-kondo --lint $(clojure -Spath) --copy-configs --dependencies --skip-lint

borkdude10:05:29

and then check into source control whatever is copied to .clj-kondo/... except the .cache directory

grahamcarlyle10:05:08

@borkdude thanks I will remove my :config-paths setting. So I have to manually keep the copied config up to date, its a shame that this can't be done automatically by clj-kondo (via some integration with deps or whatever)

borkdude10:05:21

I expect the config churn to not be so great and with --skip-lint this should happen sub-second

borkdude10:05:47

you could hook it to some git commit hook or bb task

👍 1