From a56d51ec1cd40172e94a6cb017049c0a7fed08e5 Mon Sep 17 00:00:00 2001 From: Christoph Frick Date: Thu, 22 Sep 2022 00:24:01 +0200 Subject: [PATCH] Pass input via stdin and filename as arg to clj-kondo (#4315) This allows using linters like `:namespace-name-mismatch`. This replaces: https://github.com/dense-analysis/ale/pull/4109 --- ale_linters/clojure/clj_kondo.vim | 3 ++- test/linter/test_clj_kondo.vader | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ale_linters/clojure/clj_kondo.vim b/ale_linters/clojure/clj_kondo.vim index a023f8b6..b470cf0c 100644 --- a/ale_linters/clojure/clj_kondo.vim +++ b/ale_linters/clojure/clj_kondo.vim @@ -8,7 +8,8 @@ function! ale_linters#clojure#clj_kondo#GetCommand(buffer) abort let l:command = 'clj-kondo' \ . ale#Pad(l:options) - \ . ' --lint %t' + \ . ' --lint -' + \ . ' --filename %s' return l:command endfunction diff --git a/test/linter/test_clj_kondo.vader b/test/linter/test_clj_kondo.vader index 869f9f2a..e62211c4 100644 --- a/test/linter/test_clj_kondo.vader +++ b/test/linter/test_clj_kondo.vader @@ -6,10 +6,10 @@ After: Execute(The default command should be correct): AssertLinter 'clj-kondo', 'clj-kondo' - \ . ' --cache --lint %t' + \ . ' --cache --lint - --filename %s' Execute(Extra options should be supported): let g:ale_clojure_clj_kondo_options = '--config ./clj-kondo/config.edn' AssertLinter 'clj-kondo', 'clj-kondo' - \ . ' --config ./clj-kondo/config.edn --lint %t' + \ . ' --config ./clj-kondo/config.edn --lint - --filename %s'