borkdude / flycheck-clj-kondo

Emacs integration for clj-kondo via flycheck
94 stars 17 forks source link

feat: buffer-local var for lang override #10

Closed rschmukler closed 3 years ago

rschmukler commented 3 years ago

Adds functionality to override the linting language used by clj-kondo.

When connected to sibling cljs and clj repls in cider, it will use the major mode to decide where to execute evaluated sexps. When working with cljc files it can be useful to set the major mode of emacs to clojure-mode or clojurescript-mode to restrict where the sexps are being evaluated while you develop.

This PR adds the ability for a buffer to specify the language it would like to be linted as, allowing cljc buffers being edited in clojure-mode to still be linted by the cljc linter in clj-kondo.

borkdude commented 3 years ago

Reviewed by @sogaiu

borkdude commented 3 years ago

@rschmukler Looks good, although I wondered if eval was really necessary. I think flycheck-clj-kondo-lang is a better name than flycheck-clj-kondo-lint-lang since the option is called lang and not lint-lang.

rschmukler commented 3 years ago

@borkdude thanks for the review. I've updated the variable name. The eval is part of the flycheck-substitute-argument syntax. Just to be sure, I tried removing it and the macro fails to compile without it.

Thanks again!