diff --git a/layers/+lang/clojure/README.org b/layers/+lang/clojure/README.org index f8f5cbc5a..1ca935109 100644 --- a/layers/+lang/clojure/README.org +++ b/layers/+lang/clojure/README.org @@ -18,6 +18,8 @@ - [[#usage][Usage]] - [[#cheatsheet][Cheatsheet]] - [[#linting][Linting]] + - [[#squiggly-linter][Squiggly linter]] + - [[#clj-kondo-linter][clj-kondo linter]] - [[#structuraly-safe-editing][Structuraly safe editing]] - [[#key-bindings][Key bindings]] - [[#working-with-clojure-files-barfage-slurpage--more][Working with clojure files (barfage, slurpage & more)]] @@ -189,10 +191,21 @@ some functions that deal with sorting maps. ** Linting Linting works via flycheck and disabled by default. -You can enable it like this: + +*** Squiggly linter + +It uses [[https://github.com/clojure-emacs/squiggly-clojure][squiggly-clojure]] behind the scene. You can enable it like this: #+BEGIN_SRC emacs-lisp - (setq clojure-enable-linters t) + (setq clojure-enable-linters 'squiggly) +#+END_SRC + +*** clj-kondo linter + +This linter based on static syntax check, require [[https://github.com/borkdude/clj-kondo][clj-kondo]] installed on your PATH. Detailed installation instructions can be found [[https://github.com/borkdude/clj-kondo/blob/master/doc/install.md][here]]. + +#+BEGIN_SRC emacs-lisp + (setq clojure-enable-linters 'clj-kondo) #+END_SRC Make sure to read the [[https://github.com/clojure-emacs/squiggly-clojure#warnings][warnings section]]. diff --git a/layers/+lang/clojure/packages.el b/layers/+lang/clojure/packages.el index 1595d897b..5ba286732 100644 --- a/layers/+lang/clojure/packages.el +++ b/layers/+lang/clojure/packages.el @@ -20,7 +20,8 @@ eldoc evil-cleverparens flycheck - (flycheck-clojure :toggle clojure-enable-linters) + (flycheck-clojure :toggle (eq clojure-enable-linters 'squiggly)) + (flycheck-clj-kondo :toggle (eq clojure-enable-linters 'clj-kondo)) ggtags counsel-gtags helm-gtags @@ -173,7 +174,7 @@ (with-eval-after-load 'golden-ratio (add-to-list 'golden-ratio-extra-commands 'cider-popup-buffer-quit-function)) ;; setup linters. NOTE: It must be done after both CIDER and Flycheck are loaded. - (when clojure-enable-linters + (when (eq clojure-enable-linters 'squiggly) (with-eval-after-load 'flycheck (flycheck-clojure-setup))) ;; add support for evil (evil-set-initial-state 'cider-stacktrace-mode 'motion) @@ -433,3 +434,7 @@ (defun clojure/init-flycheck-clojure () (use-package flycheck-clojure :if (configuration-layer/package-usedp 'flycheck))) + +(defun clojure/init-flycheck-clj-kondo () + (use-package flycheck-clj-kondo + :if (configuration-layer/package-usedp 'flycheck)))