Fork me on GitHub
#clj-kondo
<
2023-03-16
>
Søren Sjørup09:03:23

I’m getting this:

❯ echo '(import "")' | clj-kondo --lint -
<stdin>:0:0: error: Can't parse <stdin>, java.lang.NullPointerException
linting took 39ms, errors: 1, warnings: 0
❯ clj-kondo --version
clj-kondo v2023.02.17
Should I just report an issue on github, and try to fix it?

borkdude09:03:06

That isn't valid clojure, so do you mean: clj-kondo should not crash?

Søren Sjørup09:03:35

I would prefer a error message saying it’s not valid clojure.

borkdude09:03:55

right. issue and/or PR welcome

borkdude09:03:06

The catch-all linter we use for this is called :syntax

joakimen12:03:54

Is there any way to ignore a given namespace in clj-kondo? Like, applying #_:clj-kondo/ignore to everything in a namespace, without pasting the ignore-string in front of every form. Sometimes I like to flesh out a program structure upfront (function signatures, variables, ..) while leaving the bodies empty (with a ;; TODO ), which obviously trips up the linting. How do you guys work around this during WIP-stages of things?

borkdude12:03:40

You can do either metadata on the ns or use :config-in-ns

borkdude12:03:44

or you can use :output :exclude-files

joakimen12:03:49

Spot on. That was a trove of documentation i somehow missed

borkdude12:03:25

I'm currently working on an easier mode to silence everything in a macro. E.g. {:clj-kondo/ignore true} and {:clj-kondo/ignore [:unresolved-symbol]}

borkdude12:03:59

here is a small demo: https://twitter.com/borkdude/status/1636108402043518981 but we could have the same for a namespace maybe

👀 2
joakimen13:03:30

Thanks again for the help! Worked nicely with namespace metadata, though with specific rules. Will keep an eye on #C06MAR553 for updates then, a one-shot rule to ignore everything would be practical indeed