This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-06
Channels
- # announcements (12)
- # babashka (34)
- # beginners (85)
- # calva (76)
- # cider (14)
- # clj-kondo (49)
- # cljs-dev (32)
- # clojure (418)
- # clojure-europe (3)
- # clojure-france (4)
- # clojure-italy (17)
- # clojure-losangeles (8)
- # clojure-nl (5)
- # clojure-norway (2)
- # clojure-spec (2)
- # clojure-uk (88)
- # clojuredesign-podcast (4)
- # clojurescript (49)
- # clojurex (75)
- # clr (2)
- # core-async (13)
- # cursive (6)
- # datomic (57)
- # duct (31)
- # emacs (6)
- # fulcro (25)
- # graalvm (67)
- # graphql (13)
- # hoplon (1)
- # java (6)
- # juxt (11)
- # kaocha (5)
- # keechma (2)
- # leiningen (16)
- # mount (1)
- # off-topic (19)
- # pathom (2)
- # pedestal (1)
- # re-frame (11)
- # reagent (21)
- # reitit (22)
- # rewrite-clj (1)
- # shadow-cljs (98)
- # spacemacs (5)
- # sql (16)
- # tools-deps (8)
- # vim (28)
- # xtdb (4)
Hey, I just installed clj-kondo, and it is really nice! So, thanks! I use a rando editor (Kakoune), and it was about three lines of config.
Part of me appreciating it is this mode of editor integration, which I shall call "Just a Program".
sounds good! PR welcome here if you want to add editor integration documentation: https://github.com/borkdude/clj-kondo/blob/master/doc/editor-integration.md
Happily using it since early beta)
Beta of Catalina of course
wrt #515 (warn about missing require when using a known namespace), what exactly prevents warning about aliases?
that is a fundamental problem, because str
could be 1) a fully named namespace, 2) a Java class
the only way to lint this is using explicitly configuration, it cannot be detected automatically
OK, so that becomes more complicated. Either it's a class in java.lang, or it's imported, or there's a defrecord or deftype for it in the namespace, or it's a warning?
In terms of configuration, I, personally, would be happy to assume anything starting with a lower case letter is not a Java class.
this seems like a fixed number of clojure-flavor related exceptions, e.g. goog/ and js/ in cljs is like System/ in clj.
There as an issue about this which @dominicm linked recently. Let me try to find it...
Yeah, I was getting to asking whether aliases should be on #515 or a separate issue, but it might be neither.
@eraserhd Feel free to have a look at this. We can reconsider this issue at all times.
It's fairly easy to warn when foo is not a required namespace (alias) or imported class. Then we'd have t exclude known things like goog. Clj-kondo already have a list of all the by default available classes, so that's not a problem anymore either. So considering the progress of the last few months, maybe it's actually more feasible now...
I was thinking something like linting 500 big clojure projects and seeing what shakes out.
This goes beyond clj-kondo, probably, but a thing that's been on my to-do list for years is a thing that updates ones namespace as one types. Aliases are (or should) be used somewhat consistently in a project, so an analyzer could know what to do. I had this for C++ includes a long time ago, and it worked well.
> Aliases are (or should) be used somewhat consistently in a project There's actually a linter for this now
Yes: https://github.com/borkdude/clj-kondo/blob/master/doc/config.md#alias-consistency
You can generate the initial config using the analysis export which contains all the aliases: https://github.com/borkdude/clj-kondo/tree/master/analysis