Fork me on GitHub
#clj-kondo
<
2021-09-24
>
ericdallo15:09:17

I'd like to know if clj-kondo can access config paths inside a config-path of a external lib, let me explain the case 🧵

ericdallo15:09:37

At Nubank we have a lot of services using something lke this at each service:

{:config-paths ["nubank/a" "nubank/b" ...]} ; a lot more
we would like to centralize that in a dev lib that when bumped, it will already include all those config-paths. avoiding the need to update config-paths for each service, since we already have a bot that bump libs for all services

ericdallo15:09:09

so I'd like to have a lib that will have all the :config-paths and then each service would just include a:

:config-paths ["nubank/base"]

ericdallo15:09:36

I tried that, but clj-kondo is not finding the nubank.a hooks because they are problably not in the same folder

ericdallo15:09:52

do you see any easy way to do that?

ericdallo15:09:45

The idea behind this is to have one simple config.edn that is common for all libs, instead configuring each one manually

ericdallo15:09:12

the ~/.config/clj-kondo/config.edn is not enough as users need to manually have that on their machines/CI

borkdude15:09:38

yes, this should already work

borkdude15:09:58

but the config-paths are always relative from the config.edn where you define it

ericdallo15:09:25

exactly, I'm not finding the correct one so and getting:

WARNING: file nubank/state_flow.clj not found while loading hook
for example

borkdude15:09:12

you can include the base config in a library and when this library is linted then the config is copied to your .clj-kondo folder

borkdude15:09:16

and then you can include it

ericdallo15:09:12

that's exactly what I want, probably some wrong relative config-paths, I'll double check the paths after the copy

ericdallo15:09:08

Oh, your suggestion to check the copied folder indeed helps, let me fix it

ericdallo16:09:20

It worked :) I needed to change the base to somethine like this:

{:config-paths
["../a"
 "../b"
 "../c"
 ...
 ;; non nubank clj-kondo configs
 "../../marick/midje"
 ...]}