Fork me on GitHub
#emacs
<
2019-10-28
>
orestis15:10:09

Is clj-kondo supposed to work in combination with Joker, or should I remove Joker entirely?

practicalli-johnny13:10:26

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 🙂

borkdude15:10:12

@orestis you can use them both. see the docs of flycheck-clj-kondo

borkdude15:10:40

they both have the same output format so in theory you could even write a script that concats the output 🙂

orestis15:10:50

I guess I'm just wondering if clj-kondo is a superset of Joker -- would I see two warnings about an unused variable then?

borkdude15:10:17

yes, sometimes you would see two warnings. to solve that I've made a wrapper script which greps out certain warnings

borkdude15:10:41

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

đź‘Ť 4
borkdude15:10:23

I've placed that in some directory on the path which has priority over /usr/local/bin

orestis15:10:58

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?

borkdude15:10:27

Putting config in .clj-kondo/config.edn is the preferred location

borkdude15:10:40

oh sorry, misread

borkdude15:10:02

no, a library can not supply clj-kondo config. that's a nice feature to have for sure

borkdude15:10:19

for now it's best if the library makes a section in the README about this probably

orestis15:10:03

OK. I remember from somewhere that you would also accept PRs for commonly used macros, is that so?

borkdude15:10:21

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

borkdude15:10:10

@orestis sure, after some agreement on "commonly used" 🙂

orestis15:10:41

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.

borkdude15:10:26

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

borkdude15:10:32

it's probably more robust if the macro author makes a clj-kondo PR with config for his/her macro

borkdude15:10:36

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

borkdude15:10:22

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

orestis15:10:50

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!

Eric Ihli19:10:07

What's a good way to jump-to-definition without Cider?

Lu19:10:51

Dumb-jump?

Lu19:10:16

Guesses pretty accurately

Eric Ihli19:10:28

Looks like that will work. Thanks!

Lu19:10:22

No prob :)

dpsutton19:10:23

lsp mode can provider this as well

sogaiu22:10:50

@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.

Eric Ihli07:10:20

Is it published anywhere?

sogaiu13:10:09

yes, hope to post more when i'm not struggling with mobile input :)