Fork me on GitHub
#clj-kondo
<
2019-10-08
>
pithyless12:10:27

I'm seeing different linter errors on the CLI and in Spacemacs. On the CLI I'm running clj-kondo v2019.10.04-alpha; in spacemacs, I'm running (clojure :variables clojure-enable-linters 'clj-kondo ...)

pithyless12:10:48

How can I verify / debug what flycheck is actually running in emacs?

borkdude12:10:39

you can try flycheck-compile

pithyless12:10:55

ah, that looks more correct! So it looks like the default runner for flycheck is incorrectly configured

pithyless12:10:17

if I run flycheck-select-checker and set it to clj-kondo-clj I'm seeing the correct thing; any idea what to add to my .spacemacs to make sure it loads by default for clj/cljs/cljc/edn files?

pithyless12:10:01

I just chose the nuclear option, and temporarily removed joker from the path. Looks like it was always selecting joker over clj-kondo, even though I removed joker from my .spacemacs

pithyless12:10:30

@borkdude is it a known issue where emacs is apparently eating the last character of the error message?

borkdude13:10:03

I haven't seen this behavior before. There is spacemacs documention for kondo here: https://github.com/borkdude/clj-kondo/blob/master/doc/editor-integration.md#spacemacs And in the #spacemacs there are several kondo users.

pithyless13:10:13

Thanks, I've followed the wiki instructions per the develop branch; 🤷 I guess I'll look more into it later.

borkdude13:10:18

The people in #spacemacs have been very helpful to these kinds of issues before.

👍 4
Marc O'Morain15:10:54

Re this issue: https://github.com/borkdude/clj-kondo/issues/514 The motivating examples are parsing this:

{) ; => Unmatched delimiter: ) [at line 1, column 2]
and this:
[ ; => Unexpected EOF. [at line 1, column 2]

borkdude15:10:00

as discussed: maybe it's an idea to keep a reference to last opened delimiter. when Unmatched or Unexpected happened, we can include the row and col of that last opened delimiter (if there is one).

Marc O'Morain15:10:37

What should the error messages actually be in this case? For the second example, if I forget to close a ) in a function on line 5 of a 300 line file, the error is currently that there was an unexpected EOF on line 300, not that was an unclosed paren on line 5. So there error message is 295 lines away from the error.

borkdude15:10:16

In the first case I'd say: an extra unmatched delimiter for the opening {

borkdude15:10:50

In the second case: does it work to also report the last opened delimiter position?

borkdude15:10:24

( <-so this one foo (.....) (....)

borkdude15:10:04

so as soon we encounter a closing delimiter, we forget about the last opened one

borkdude15:10:40

but as soon as we encounter one of the above errors, we also report the last opened delimiter that wasn't closed yet