Fork me on GitHub
#clj-kondo
<
2021-01-20
>
Felipe de Morais12:01:17

Is there a config to make clj-kondo fix the issues instead of just raise it? 👀

borkdude13:01:58

@felipejpa15 clj-kondo only outputs warnings or information that other tools can use to automatically fix the issues. clj-kondo itself will not rewrite your code

thanks 3
borkdude13:01:46

If you are looking for refactoring tools, maybe try clojure-lsp or clj-refactor

borkdude15:01:47

Any preferences?

$ clojure -M:clj-kondo --lang clj --lint - <<< "(clojure.core/x)"
<stdin>:1:2: warning: No such var: clojure.core/x
This uses the same message as the clojure compiler would output, but the linter is called :unresolved-var. So the message could also be:
Unresolved var: clojure.core/x

borkdude15:01:24

Hmm, I think Unresolved var is better for consistency and also, clj-kondo might have a false positive in which case "No such var" would not be true, but "Unresolved var" would be ;)

👍 3
borkdude19:01:26

Clj-kondo v2021.01.20 New: unresolved var linter and various other improvements! See https://github.com/clj-kondo/clj-kondo/blob/master/doc/linters.md#unresolved-var for details. Release notes: https://github.com/borkdude/clj-kondo/blob/master/CHANGELOG.md#v20210120

🎉 21
didibus21:01:20

wOOt WooT!!