clojure-emacs / squiggly-clojure

Flycheck checker for Clojure, using eastwood and core.typed.
GNU General Public License v3.0
204 stars 25 forks source link

Using as part of a next checker chain does not seem to work? #61

Closed didibus closed 5 years ago

didibus commented 5 years ago

I'm extending the support for the Clojure layer for spacemacs so that multiple linters can be configured to run. I am using flycheck's next-checker functionality to do so. The thing is, it seems when clojure-cider-eastwood is configured as the next checker for clj-kondo-clj, that it does not actually run, and so neither does its next-checkers kibit and core.typed.

Flycheck is properly configured, and mentions that all the linters are setup to run:

First checker to run:

  clj-kondo-clj (explicitly selected)
    - may enable:    yes
    - predicate:     t
    - executable:    Found at /home/didier/bin/clj-kondo
    - next checkers: clojure-joker, clojure-cider-eastwood

Checkers that may run as part of the first checker's chain:

  clojure-joker
    - may enable: yes
    - predicate:  t
    - executable: Found at /home/didier/bin/joker

  clojure-cider-eastwood
    - may enable:    yes
    - predicate:     t
    - next checkers: clojure-cider-kibit, clojure-cider-typed

  clojure-cider-kibit
    - may enable:    yes
    - predicate:     t
    - next checkers: clojure-cider-typed

  clojure-cider-typed
    - may enable: yes
    - predicate:  t

If I explicitly select clojure-cider-eastwood then it works, but any idea why as a next-checker it wouldn't? I'm guessing maybe something to do with the predicate it uses?

didibus commented 5 years ago

Nevermind, turned out to be because of the way flycheck works. I thought you could specify multiple next-checkers and have them all run, but it does not work like that. Each checker only runs one other when it is done which it picks from its list of next-checkers based on the first one that is available. So if you want to continue a chain to more then one, you need to add the next one to the next of the next. It is a bit complicated, but it works.