This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-23
Channels
- # announcements (6)
- # beginners (54)
- # calva (9)
- # cider (2)
- # clj-kondo (26)
- # cljsrn (2)
- # clojure (49)
- # clojure-brasil (1)
- # clojure-dev (3)
- # clojure-europe (11)
- # clojure-italy (28)
- # clojure-nl (5)
- # clojure-serbia (1)
- # clojure-spec (4)
- # clojure-uk (182)
- # clojuredesign-podcast (2)
- # clojurescript (59)
- # clojurex (9)
- # cursive (26)
- # data-science (11)
- # datomic (40)
- # duct (1)
- # emacs (3)
- # events (4)
- # figwheel-main (2)
- # fulcro (7)
- # instaparse (1)
- # kaocha (2)
- # leiningen (25)
- # off-topic (3)
- # re-frame (36)
- # reagent (15)
- # shadow-cljs (87)
- # spacemacs (12)
- # sql (20)
- # tools-deps (8)
- # vim (1)
- # yada (40)
Is it possible for library authors to define linter configs for consumers of the library? Sort of the inverse of the current method of using {:clj-kondo/config '{:lint-as ...}}
metadata, which has to be done manually by users on a per-project/namespace basis
@dharrigan thanks!
@qythium that's currently not possible but that could be useful indeed. macro authors could also give some more hints to clj-kondo where they introduce new vars or bindings
yeah, one concern would be whether it's too tightly coupled to a specific implementation - eg. Joker could use that information too but wouldn't look under a :clj-kondo/... namespace
one other concern would be that some people would find it cluttering their code if they don't use a linter
library/src/clj-kondo/config.edn <- this config will be "exported"? but then that would only work if you linted your entire classpath
if you would only lint your git-staged files you would already not see that config, so it might be too fragile
ah, do you mean that anything in a .clj-kondo/ directory won't make it into the exported JAR, so there would be no way to get that information if someone uses the lib as a Maven dependency?
even if it would be in the jar, it would only be seen by clj-kondo if you lint your source + all your libs
I had the impression that was what it did anyway? otherwise how does it provide arity warnings for 3rd party libs
I guess clj-kondo could save config information while linting libs also to the cache, but I'm not sure if that works yet
you'll get the problem of the config being scattered over multiple places which can be hard to debug and understand
so for now it might be a good start if library authors started documenting their preferred clj-kondo config in their README
we can also make some command line option to generate a config file based on what is in your libraries, that might be a more transparent way
so if library authors exported some clj-kondo config, this command line option would gather those and add them to your config.edn
I wonder if a good heuristic anyway would be to ignore unresolved-symbol warnings for the 2nd position in any form that starts with def...