So, @seancorfield made me realize that if you change the arity of a fn in one namespace, and use it with the wrong arity in another namespace clj-kondo will catch the error. But, if the fn is deleted from the other namespace, or renamed, it won't catch those. Is that normal? Would it be possible for clj-kondo to warn on those as well? It seems to me if it can track the arity, it must also track what var is defined in each namespace no ?
Work in progress. I worked on this issue but it requires more work. It is something that I want to support eventually though.
Hi, This might be a naive question, but I haven’t been able to figure it out: How do I import library provided configs? Eg. Pathom comes with a .clj-kondo/config.edn, but my editor doesn’t pick it up. The guide of the config repo worked fine. So I got it to work for rum/fulcro etc. But I can’t figure out how to do it for everything outside of that (I’m still pretty new to Clojure so this is probably a rookie mistake)
@aleksander990 There is a difference between a config that a project itself uses and the config that is needed for consuming the code of that project.
You can read more about this here: https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#exporting-and-importing-configuration I'm going into a meeting now, but I'd be happy to answer more questions later.
yeah, I think I got that part. Eg: Adding the fulcro config to .clj-kondo/config/fulcro/config.edn (by following the instructions in the config repo) and then adding that to config-paths in my own config.edn. I just can’t figure out how to do the same for pathom (outside of simply copy pasting the config from their repo) No worries. clj-kondo feels like a lifesaver and is absolutely great for beginners. So I figured my ignorance might be of some help
I did read through the guide below, but still can’t wrap my head around it
Sounds good. Thank you for being so responsive!
ok, I'm back.
So my question is: How do I add an external libraries configuration to my linter? (in this particular case pathom) https://github.com/wilkerlucio/pathom I followed this guide to add the ones provided in this repo, and I figured I just have to tweak the approach for pathom? https://github.com/clj-kondo/config I just haven’t been able to figure out how
So what pathom should do in this case is export the config for its library in a clj-kondo.exports
directory that will be part of the library artifact
and preferable it should only export config for itself, not for other libraries (like fulcro, because fulcro is not part of pathom)
But for now you could also copy this config to clj-kondo/config, if pathom isn't doing this in the foreseeable future. Or just copy the relevant bits to your own config.edn file.
Ok, so it’s the clj-kondo.export
part that’s missing. That makes sense. Thanks!
I’ll copy it over for now
cool, sounds nice, I'll take a time to check on it later today 👍
@borkdude looks right? https://github.com/wilkerlucio/pathom/pull/186
@wilkerlucio Looks right to me!
cool, does this works with deps dependencies too?
So I assume there is already an issue for it and I shouldn't create one?
Can you teach clj-kondo to recognize data_readers ?
@didibus I don't think there is any logic for that yet.
Feel free to create an issue
This is the issue: https://github.com/clj-kondo/clj-kondo/issues/634
it works with whatever build tool, as long as its on the classpath
So anyone who has pathom on their classpath, should get a hint about the config with:
clj-kondo --no-warnings --lint "$(clojure -Spath -Sdeps)"
I was playing with it here
I updated my async library to provide those
and then add as a dep, when I used the clj-kondo --no-warnings --lint "$(clojure -Spath -A:provided)" --parallel
, it copied the file, as expected
but, if I get the same library, and add it via deps (instead of the clojars), then when I run the lint, no copy happens
I guess because in the second case the clj-kondo.exports
isn't at the root, but at resources
instead
it depends on your deps.edn, does it have "resources"
in its :paths
?
good point, let me check that
that was the missing bit! now that resources in the classpath its working 👍 thanks!
should a library commit those loaded external kondo configs, or leave ignored in the repo?
I think it's good to commit so anyone working on that project gets it automatically
makes sense
@aleksander990 released in pathom 2.3.1
Amazing! Thank you @wilkerlucio
🙏