diff options
author | 莊喬 <bootleq@gmail.com> | 2021-07-17 21:07:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-17 22:07:02 +0900 |
commit | f83a1f70d542ac885b72d1161140d6d999e2d7b2 (patch) | |
tree | 14554776e3fbd17ec79871dfed944dd6f560280e /ale_linters | |
parent | a6a8131306f873c33c1983fbc74f0989bc6a4921 (diff) | |
download | ale-f83a1f70d542ac885b72d1161140d6d999e2d7b2.zip |
Add option to clojure clj-kondo linter (#3812)
Allow define `clojure_clj_kondo_options` to customize command options
for `clj-kondo`.
The `--cache` in original command is now defined as default.
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/clojure/clj_kondo.vim | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ale_linters/clojure/clj_kondo.vim b/ale_linters/clojure/clj_kondo.vim index eb60ce77..e3f93b6b 100644 --- a/ale_linters/clojure/clj_kondo.vim +++ b/ale_linters/clojure/clj_kondo.vim @@ -1,6 +1,18 @@ " Author: Masashi Iizuka <liquidz.uo@gmail.com> " Description: linter for clojure using clj-kondo https://github.com/borkdude/clj-kondo +call ale#Set('clojure_clj_kondo_options', '--cache') + +function! ale_linters#clojure#clj_kondo#GetCommand(buffer) abort + let l:options = ale#Var(a:buffer, 'clojure_clj_kondo_options') + + let l:command = 'clj-kondo' + \ . ale#Pad(l:options) + \ . ' --lint %t' + + return l:command +endfunction + function! ale_linters#clojure#clj_kondo#HandleCljKondoFormat(buffer, lines) abort " output format " <filename>:<line>:<column>: <issue type>: <message> @@ -29,6 +41,6 @@ call ale#linter#Define('clojure', { \ 'name': 'clj-kondo', \ 'output_stream': 'stdout', \ 'executable': 'clj-kondo', -\ 'command': 'clj-kondo --cache --lint %t', +\ 'command': function('ale_linters#clojure#clj_kondo#GetCommand'), \ 'callback': 'ale_linters#clojure#clj_kondo#HandleCljKondoFormat', \}) |