diff options
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/fix/registry.vim | 5 | ||||
-rw-r--r-- | autoload/ale/fixers/npmgroovylint.vim | 16 | ||||
-rw-r--r-- | autoload/ale/linter.vim | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/autoload/ale/fix/registry.vim b/autoload/ale/fix/registry.vim index 66cdc707..2f7edba8 100644 --- a/autoload/ale/fix/registry.vim +++ b/autoload/ale/fix/registry.vim @@ -610,6 +610,11 @@ let s:default_registry = { \ 'function': 'ale#fixers#rustywind#Fix', \ 'suggested_filetypes': ['html'], \ 'description': 'Sort Tailwind CSS classes', +\ }, +\ 'npm-groovy-lint': { +\ 'function': 'ale#fixers#npmgroovylint#Fix', +\ 'suggested_filetypes': ['groovy'], +\ 'description': 'Fix Groovy files with npm-groovy-fix.', \ } \} diff --git a/autoload/ale/fixers/npmgroovylint.vim b/autoload/ale/fixers/npmgroovylint.vim new file mode 100644 index 00000000..39e43cf6 --- /dev/null +++ b/autoload/ale/fixers/npmgroovylint.vim @@ -0,0 +1,16 @@ +" Author: lucas-str <lucas.sturelle@ik.me> +" Description: Integration of npm-groovy-lint for Groovy files. + +call ale#Set('groovy_npmgroovylint_fix_options', '--fix') + +function! ale#fixers#npmgroovylint#Fix(buffer) abort + let l:executable = ale#Var(a:buffer, 'groovy_npmgroovylint_executable') + let l:options = ale#Var(a:buffer, 'groovy_npmgroovylint_fix_options') + + return { + \ 'command': ale#Escape(l:executable) + \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ' %t', + \ 'read_temporary_file': 1, + \} +endfunction diff --git a/autoload/ale/linter.vim b/autoload/ale/linter.vim index d90deace..8b943ea0 100644 --- a/autoload/ale/linter.vim +++ b/autoload/ale/linter.vim @@ -43,6 +43,7 @@ let s:default_ale_linters = { \ 'csh': ['shell'], \ 'elixir': ['credo', 'dialyxir', 'dogma'], \ 'go': ['gofmt', 'golint', 'gopls', 'govet'], +\ 'groovy': ['npm-groovy-lint'], \ 'hack': ['hack'], \ 'help': [], \ 'inko': ['inko'], |