This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-11
Channels
- # aleph (3)
- # announcements (3)
- # aws (7)
- # babashka (121)
- # beginners (82)
- # calva (40)
- # chlorine-clover (37)
- # clj-kondo (68)
- # cljsrn (4)
- # clojure (43)
- # clojure-australia (1)
- # clojure-dev (6)
- # clojure-europe (15)
- # clojure-italy (2)
- # clojure-nl (1)
- # clojure-provo (3)
- # clojure-spec (23)
- # clojure-taiwan (1)
- # clojure-uk (21)
- # clojurescript (214)
- # code-reviews (1)
- # conjure (4)
- # core-async (10)
- # cursive (52)
- # datahike (5)
- # datascript (5)
- # datomic (62)
- # duct (1)
- # emacs (4)
- # fulcro (8)
- # graalvm (1)
- # helix (1)
- # honeysql (5)
- # integrant (1)
- # jackdaw (32)
- # jobs (3)
- # jobs-discuss (16)
- # juxt (1)
- # kaocha (3)
- # lsp (6)
- # malli (2)
- # meander (6)
- # nrepl (1)
- # off-topic (46)
- # other-languages (4)
- # pathom (7)
- # polylith (13)
- # re-frame (3)
- # releases (2)
- # shadow-cljs (56)
- # spacemacs (15)
- # tools-deps (3)
- # unrepl (1)
- # utah-clojurians (1)
I noticed if I have a home config with a custom :lint-as
and add a project config that has also a :lint-as
but both lint-as are different, clj-kondo doesn't merge it
example: home
:lint-as {a b}
project
:lint-as {c d}
I would expect a final config of
:lint-as {a b
c d}
hum, I will try to make a minimal repro, but it seems to me the final result is:
:lint-as {c d}
LMK if I'm doing anything wrong: https://github.com/clj-kondo/clj-kondo/issues/1279
user=> (clj-kondo/merge-configs '{:lint-as {a b}} '{:lint-as {c d}})
{:lint-as {a b, c d}}
If you remove the project config, does it still use the home one - is your home config used at all?
yeah, for some reason, clj-kondo is not detecting the home config, only if I move it to xdg-config one
the merge works fine now ๐
That's crazy, in nubank we always used the config on ~/.clj-kondo/config.edn
and it always worked
This is the first commit where the home config was read: https://github.com/clj-kondo/clj-kondo/commit/edd4ff14c286c644921cd84f874ff007699f01f4#diff-abd35172092e4f3c0969a9f59bd79ed193be63b1107549915d49758fae78bee7
(defn home-config []
(let [home-dir (if-let [xdg-config-home (System/getenv "XDG_CONFIG_HOME")]
(io/file xdg-config-home "clj-kondo")
(io/file (System/getProperty "user.home") ".config" "clj-kondo"))]
(when (.exists home-dir)
(read-config-from-dir home-dir))))
yeah, it makes sense, I still don't understand how that was/is working for a lot of people
@U04V15CAJ I think I found a bug with a copy-configs, sorry for bother you again ๐
โข I have a .config/clj-kondo config with :config-paths ["nubank/state-flow"]
โข if the project doesn't contains a .clj-kondo
dir, everything works, since clj-kondo copy the lib config to the global clj-kondo location and the config-paths works.
โข if the project has a .clj-kondo
dir, clj-kondo will copy the lib config to the project clj-kondo, but the :config-paths
from the global one will not work and the project will not have the lib config configured correctly
I confirmed that adding :config-paths ["nubank/state-flow"]
to the project clj-kondo config works, so I think that's the issue, clj-kondo should check for config-paths on both configs and if finds, it should check for the folders on both config dirs as well
yes, this makes sense. you should add :config-paths to the clj-kondo directory that is relative to the copied configs
I think you should just re-import your configs once again, if you decide that your project is going to have a .clj-kondo config
Yes, my point is that clj-kondo is copying the config to the project one but the config with the config-paths is on the global one
I think this is the same issue @U95713QV7 was having
but in my opinion this is just how it works, I don't think clj-kondo has to look in multiple places. it tells you that you should add a config dir to your local config if you copy the configs
if you don't agree with how that works, you can move your config to the global config as well, manually
perhaps I am missing something, but I'm kind of tired today and perhaps explaining it crystal clear in an issue helps
the issue was in some other thread ๐ My point is just that we'd like to avoid manual moves or something like that to work well will everyone that use the project, I'll try to simulate a local repro to make sure we are talking about the same thing
Related to this โ๏ธ I created this issue: https://github.com/clj-kondo/clj-kondo/issues/1281