This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-28
Channels
- # announcements (2)
- # babashka (16)
- # bangalore-clj (1)
- # beginners (93)
- # boot (11)
- # calva (5)
- # cider (13)
- # clj-kondo (49)
- # cljdoc (14)
- # cljs-dev (1)
- # clojure (99)
- # clojure-dev (3)
- # clojure-europe (1)
- # clojure-india (1)
- # clojure-italy (9)
- # clojure-nl (3)
- # clojure-poland (1)
- # clojure-russia (1)
- # clojure-spec (31)
- # clojure-uk (21)
- # clojured (2)
- # clojurescript (18)
- # core-async (12)
- # cursive (36)
- # data-science (1)
- # datomic (54)
- # duct (3)
- # emacs (33)
- # events (1)
- # fulcro (17)
- # jobs (1)
- # joker (8)
- # keechma (1)
- # leiningen (7)
- # malli (8)
- # nrepl (19)
- # pathom (6)
- # planck (18)
- # re-frame (20)
- # reagent (18)
- # shadow-cljs (3)
- # sql (7)
- # vim (31)
Is clj-kondo supposed to work in combination with Joker, or should I remove Joker entirely?
I am living a joker free life now and havent missed it. One less binary to install and update. I sometimes run Kibit before I do a commit, but that rarely suggests anything now I use clj-kondo - or maybe I am just getting better at idiomatic Clojure 🙂
they both have the same output format so in theory you could even write a script that concats the output 🙂
I guess I'm just wondering if clj-kondo is a superset of Joker -- would I see two warnings about an unused variable then?
yes, sometimes you would see two warnings. to solve that I've made a wrapper script which greps out certain warnings
This is my joker wrapper script:
#!/usr/bin/env bash
## turn off some joker features, so I can test clj-kondo better
/usr/local/bin/joker "$@" 2>&1 \
| grep -v "unused parameter" \
| grep -v "unused binding" \
| grep -v "unused namespace" \
| grep -v "unsupported binding form" \
| grep -iv "unable to resolve symbol" \
| grep -v "duplicate require" \
| sed -e 's/$/ (joker)/'
exit 0
I've placed that in some directory on the path which has priority over /usr/local/bin
Also anotther Q since I have you here -- can a library vendor supply clj-kondo linting rules? So if a library has a macro that should be linted as defn
, is that what :clj-kondo/config
in the namespace metadata refers to?
I've just answered a question about that here: https://github.com/borkdude/clj-kondo.lsp/issues/2#issuecomment-546999812
no, a library can not supply clj-kondo config. that's a nice feature to have for sure
OK. I remember from somewhere that you would also accept PRs for commonly used macros, is that so?
or maybe there should be a central location in the clj-kondo repo that lists all kinds of macros and config that people can opt in to
Hehe that's the crux I guess. But would be nice if a library author could provide some metadata directly in the defmacro
that clj-kondo could pick up.
technically that's a bit challenging, since the rule has to be known at the time of use and the order in which these things are linted is not predictable
it's probably more robust if the macro author makes a clj-kondo PR with config for his/her macro
if it's just config, I'd be happy to support it. if there is custom analyzing needed beyond the config, then we have to make the trade-off if this is worth the time and energy
maybe it makes sense to have a third-party.edn config file that people can optionally turn on and where macro authors can supply their PR
FWIW, here's an issue: https://github.com/borkdude/clj-kondo/issues/559 -- but I can't make a compelling argument whether the library is "commonly used", so feel free to just ignore. Thanks for creating this!
@ericihli fwiw, it's still a bit early, but i've written something that produces a TAGS file that tries to cover one's project as well as its dependencies. using this TAGS file, one can do jump to definition with emacs' built-in xref-find-defiintions (M-.). it uses cl-kondo in the hopes of doing a decent job of static analysis.