From 8717763483b06f894c2d80f27daa44ba5cdc7129 Mon Sep 17 00:00:00 2001 From: Daniel Leong Date: Fri, 6 Mar 2020 15:56:21 -0500 Subject: [PATCH] ktlint: Explicitly pass editorconfig path, if found This enables ktlint to respect editorconfig rules when the file has been copied to a temporary directory --- autoload/ale/handlers/ktlint.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autoload/ale/handlers/ktlint.vim b/autoload/ale/handlers/ktlint.vim index ad999485df..f01708bce4 100644 --- a/autoload/ale/handlers/ktlint.vim +++ b/autoload/ale/handlers/ktlint.vim @@ -9,10 +9,12 @@ function! ale#handlers#ktlint#GetCommand(buffer) abort let l:executable = ale#Var(a:buffer, 'kotlin_ktlint_executable') let l:options = ale#Var(a:buffer, 'kotlin_ktlint_options') let l:rulesets = ale#handlers#ktlint#GetRulesets(a:buffer) + let l:editorconfig = ale#path#FindNearestFile(a:buffer, '.editorconfig') return ale#Escape(l:executable) \ . (empty(l:options) ? '' : ' ' . l:options) \ . (empty(l:rulesets) ? '' : ' ' . l:rulesets) + \ . (empty(l:editorconfig) ? '' : ' --editorconfig ' . ale#Escape(l:editorconfig)) \ . ' %t' endfunction