diff options
author | sridhars <sridhars@users.noreply.github.com> | 2018-07-24 16:42:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-24 16:42:26 -0500 |
commit | 4446cf15bea403204b5097f1bfc74267af32553c (patch) | |
tree | 325b0370a3b511efa2a498ee6959fe16c56c1b20 /ale_linters | |
parent | 0da4c6e4ad009a37b482d301a19b6d024aa0ae0a (diff) | |
parent | 341857477011f703664b31d8d76f6872f8399c66 (diff) | |
download | ale-4446cf15bea403204b5097f1bfc74267af32553c.zip |
Merge pull request #1 from w0rp/master
update
Diffstat (limited to 'ale_linters')
24 files changed, 107 insertions, 83 deletions
diff --git a/ale_linters/apiblueprint/drafter.vim b/ale_linters/apiblueprint/drafter.vim index 9cded359..198709f9 100644 --- a/ale_linters/apiblueprint/drafter.vim +++ b/ale_linters/apiblueprint/drafter.vim @@ -31,6 +31,6 @@ call ale#linter#Define('apiblueprint', { \ 'name': 'drafter', \ 'output_stream': 'stderr', \ 'executable': 'drafter', -\ 'command': 'drafter --use-line-num --validate %t', +\ 'command': 'drafter --use-line-num --validate', \ 'callback': 'ale_linters#apiblueprint#drafter#HandleErrors', \}) diff --git a/ale_linters/asciidoc/writegood.vim b/ale_linters/asciidoc/writegood.vim index c986cc6c..a29b7e9c 100644 --- a/ale_linters/asciidoc/writegood.vim +++ b/ale_linters/asciidoc/writegood.vim @@ -1,9 +1,4 @@ " Author: Sumner Evans <sumner.evans98@gmail.com> " Description: write-good for AsciiDoc files -call ale#linter#Define('asciidoc', { -\ 'name': 'write-good', -\ 'executable_callback': 'ale#handlers#writegood#GetExecutable', -\ 'command_callback': 'ale#handlers#writegood#GetCommand', -\ 'callback': 'ale#handlers#writegood#Handle', -\}) +call ale#handlers#writegood#DefineLinter('asciidoc') diff --git a/ale_linters/c/clangd.vim b/ale_linters/c/clangd.vim new file mode 100644 index 00000000..5aa2e221 --- /dev/null +++ b/ale_linters/c/clangd.vim @@ -0,0 +1,29 @@ +" Author: Andrey Melentyev <andrey.melentyev@protonmail.com> +" Description: Clangd language server + +call ale#Set('c_clangd_executable', 'clangd') +call ale#Set('c_clangd_options', '') + +function! ale_linters#c#clangd#GetProjectRoot(buffer) abort + let l:project_root = ale#path#FindNearestFile(a:buffer, 'compile_commands.json') + return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : '' +endfunction + +function! ale_linters#c#clangd#GetExecutable(buffer) abort + return ale#Var(a:buffer, 'c_clangd_executable') +endfunction + +function! ale_linters#c#clangd#GetCommand(buffer) abort + let l:executable = ale_linters#c#clangd#GetExecutable(a:buffer) + let l:options = ale#Var(a:buffer, 'c_clangd_options') + + return ale#Escape(l:executable) . (!empty(l:options) ? ' ' . l:options : '') +endfunction + +call ale#linter#Define('c', { +\ 'name': 'clangd', +\ 'lsp': 'stdio', +\ 'executable_callback': 'ale_linters#c#clangd#GetExecutable', +\ 'command_callback': 'ale_linters#c#clangd#GetCommand', +\ 'project_root_callback': 'ale_linters#c#clangd#GetProjectRoot', +\}) diff --git a/ale_linters/elixir/dialyxir.vim b/ale_linters/elixir/dialyxir.vim index 5ef3a047..bba0ae14 100644 --- a/ale_linters/elixir/dialyxir.vim +++ b/ale_linters/elixir/dialyxir.vim @@ -28,7 +28,7 @@ endfunction call ale#linter#Define('elixir', { \ 'name': 'dialyxir', \ 'executable': 'mix', -\ 'command': 'mix dialyzer', +\ 'command': 'mix help dialyzer && mix dialyzer', \ 'callback': 'ale_linters#elixir#dialyxir#Handle', \}) diff --git a/ale_linters/fortran/language_server.vim b/ale_linters/fortran/language_server.vim new file mode 100644 index 00000000..fd763fcf --- /dev/null +++ b/ale_linters/fortran/language_server.vim @@ -0,0 +1,27 @@ +" Author: unpairedbracket ben.spiers22@gmail.com +" Description: A language server for fortran + +call ale#Set('fortran_language_server_executable', 'fortls') +call ale#Set('fortran_language_server_use_global', get(g:, 'ale_use_global_executables', 0)) + +function! ale_linters#fortran#language_server#GetExecutable(buffer) abort + return ale#Var(a:buffer, 'fortran_language_server_executable') +endfunction + +function! ale_linters#fortran#language_server#GetCommand(buffer) abort + return ale#Escape(ale_linters#fortran#language_server#GetExecutable(a:buffer)) +endfunction + +function! ale_linters#fortran#language_server#GetProjectRoot(buffer) abort + let l:fortls_file = ale#path#FindNearestFile(a:buffer, '.fortls') + + return !empty(l:fortls_file) ? fnamemodify(l:fortls_file, ':h') : '' +endfunction + +call ale#linter#Define('fortran', { +\ 'name': 'language_server', +\ 'lsp': 'stdio', +\ 'executable_callback': 'ale_linters#fortran#language_server#GetExecutable', +\ 'command_callback': 'ale_linters#fortran#language_server#GetCommand', +\ 'project_root_callback': 'ale_linters#fortran#language_server#GetProjectRoot', +\}) diff --git a/ale_linters/go/gobuild.vim b/ale_linters/go/gobuild.vim index 068877a3..c4608071 100644 --- a/ale_linters/go/gobuild.vim +++ b/ale_linters/go/gobuild.vim @@ -70,7 +70,8 @@ function! ale_linters#go#gobuild#Handler(buffer, lines) abort endfunction call ale#linter#Define('go', { -\ 'name': 'go build', +\ 'name': 'gobuild', +\ 'aliases': ['go build'], \ 'executable': 'go', \ 'command_chain': [ \ {'callback': 'ale_linters#go#gobuild#GoEnv', 'output_stream': 'stdout'}, diff --git a/ale_linters/go/govet.vim b/ale_linters/go/govet.vim index edf9eb66..e94e6ecd 100644 --- a/ale_linters/go/govet.vim +++ b/ale_linters/go/govet.vim @@ -9,7 +9,8 @@ function! ale_linters#go#govet#GetCommand(buffer) abort endfunction call ale#linter#Define('go', { -\ 'name': 'go vet', +\ 'name': 'govet', +\ 'aliases': ['go vet'], \ 'output_stream': 'stderr', \ 'executable': 'go', \ 'command_callback': 'ale_linters#go#govet#GetCommand', diff --git a/ale_linters/haskell/cabal_ghc.vim b/ale_linters/haskell/cabal_ghc.vim new file mode 100644 index 00000000..003adf5d --- /dev/null +++ b/ale_linters/haskell/cabal_ghc.vim @@ -0,0 +1,19 @@ +" Author: Eric Wolf <ericwolf42@gmail.com> +" Description: ghc for Haskell files called with cabal exec + +call ale#Set('haskell_cabal_ghc_options', '-fno-code -v0') + +function! ale_linters#haskell#cabal_ghc#GetCommand(buffer) abort + return 'cabal exec -- ghc ' + \ . ale#Var(a:buffer, 'haskell_cabal_ghc_options') + \ . ' %t' +endfunction + +call ale#linter#Define('haskell', { +\ 'name': 'cabal_ghc', +\ 'aliases': ['cabal-ghc'], +\ 'output_stream': 'stderr', +\ 'executable': 'cabal', +\ 'command_callback': 'ale_linters#haskell#cabal_ghc#GetCommand', +\ 'callback': 'ale#handlers#haskell#HandleGHCFormat', +\}) diff --git a/ale_linters/haskell/ghc-mod.vim b/ale_linters/haskell/ghc-mod.vim index 1b15d8c2..eb032f50 100644 --- a/ale_linters/haskell/ghc-mod.vim +++ b/ale_linters/haskell/ghc-mod.vim @@ -2,14 +2,16 @@ " Description: ghc-mod for Haskell files call ale#linter#Define('haskell', { -\ 'name': 'ghc-mod', +\ 'name': 'ghc_mod', +\ 'aliases': ['ghc-mod'], \ 'executable': 'ghc-mod', \ 'command': 'ghc-mod --map-file %s=%t check %s', \ 'callback': 'ale#handlers#haskell#HandleGHCFormat', \}) call ale#linter#Define('haskell', { -\ 'name': 'stack-ghc-mod', +\ 'name': 'stack_ghc_mod', +\ 'aliases': ['stack-ghc-mod'], \ 'executable': 'stack', \ 'command': 'stack exec ghc-mod -- --map-file %s=%t check %s', \ 'callback': 'ale#handlers#haskell#HandleGHCFormat', diff --git a/ale_linters/haskell/stack_build.vim b/ale_linters/haskell/stack_build.vim index 44e2e86f..f5bdf4b8 100644 --- a/ale_linters/haskell/stack_build.vim +++ b/ale_linters/haskell/stack_build.vim @@ -13,7 +13,8 @@ function! ale_linters#haskell#stack_build#GetCommand(buffer) abort endfunction call ale#linter#Define('haskell', { -\ 'name': 'stack-build', +\ 'name': 'stack_build', +\ 'aliases': ['stack-build'], \ 'output_stream': 'stderr', \ 'executable': 'stack', \ 'command_callback': 'ale_linters#haskell#stack_build#GetCommand', diff --git a/ale_linters/haskell/stack_ghc.vim b/ale_linters/haskell/stack_ghc.vim index 0367dc24..d702aa68 100644 --- a/ale_linters/haskell/stack_ghc.vim +++ b/ale_linters/haskell/stack_ghc.vim @@ -2,7 +2,8 @@ " Description: ghc for Haskell files, using Stack call ale#linter#Define('haskell', { -\ 'name': 'stack-ghc', +\ 'name': 'stack_ghc', +\ 'aliases': ['stack-ghc'], \ 'output_stream': 'stderr', \ 'executable': 'stack', \ 'command': 'stack ghc -- -fno-code -v0 %t', diff --git a/ale_linters/help/writegood.vim b/ale_linters/help/writegood.vim index 11254cd2..eeb21a73 100644 --- a/ale_linters/help/writegood.vim +++ b/ale_linters/help/writegood.vim @@ -1,9 +1,4 @@ " Author: Sumner Evans <sumner.evans98@gmail.com> " Description: write-good for vim Help files -call ale#linter#Define('help', { -\ 'name': 'write-good', -\ 'executable_callback': 'ale#handlers#writegood#GetExecutable', -\ 'command_callback': 'ale#handlers#writegood#GetCommand', -\ 'callback': 'ale#handlers#writegood#Handle', -\}) +call ale#handlers#writegood#DefineLinter('help') diff --git a/ale_linters/html/writegood.vim b/ale_linters/html/writegood.vim index 9fae8821..6a2bd8e5 100644 --- a/ale_linters/html/writegood.vim +++ b/ale_linters/html/writegood.vim @@ -1,9 +1,4 @@ " Author: Sumner Evans <sumner.evans98@gmail.com> -" Description: write-good for nroff files +" Description: write-good for html files -call ale#linter#Define('html', { -\ 'name': 'write-good', -\ 'executable_callback': 'ale#handlers#writegood#GetExecutable', -\ 'command_callback': 'ale#handlers#writegood#GetCommand', -\ 'callback': 'ale#handlers#writegood#Handle', -\}) +call ale#handlers#writegood#DefineLinter('html') diff --git a/ale_linters/markdown/remark_lint.vim b/ale_linters/markdown/remark_lint.vim index 195b0f5a..d9c2efb6 100644 --- a/ale_linters/markdown/remark_lint.vim +++ b/ale_linters/markdown/remark_lint.vim @@ -1,3 +1,4 @@ +scriptencoding utf-8 " Author rhysd https://rhysd.github.io/, Dirk Roorda (dirkroorda), Adrián González Rus (@adrigzr) " Description: remark-lint for Markdown files call ale#Set('markdown_remark_lint_executable', 'remark') @@ -43,7 +44,8 @@ function! ale_linters#markdown#remark_lint#Handle(buffer, lines) abort endfunction call ale#linter#Define('markdown', { -\ 'name': 'remark-lint', +\ 'name': 'remark_lint', +\ 'aliases': ['remark-lint'], \ 'executable_callback': 'ale_linters#markdown#remark_lint#GetExecutable', \ 'command_callback': 'ale_linters#markdown#remark_lint#GetCommand', \ 'callback': 'ale_linters#markdown#remark_lint#Handle', diff --git a/ale_linters/markdown/writegood.vim b/ale_linters/markdown/writegood.vim index 21dbff1a..7108e7ac 100644 --- a/ale_linters/markdown/writegood.vim +++ b/ale_linters/markdown/writegood.vim @@ -1,9 +1,4 @@ " Author: Sumner Evans <sumner.evans98@gmail.com> " Description: write-good for Markdown files -call ale#linter#Define('markdown', { -\ 'name': 'write-good', -\ 'executable_callback': 'ale#handlers#writegood#GetExecutable', -\ 'command_callback': 'ale#handlers#writegood#GetCommand', -\ 'callback': 'ale#handlers#writegood#Handle', -\}) +call ale#handlers#writegood#DefineLinter('markdown') diff --git a/ale_linters/nroff/writegood.vim b/ale_linters/nroff/writegood.vim index d318fb28..bcf344f6 100644 --- a/ale_linters/nroff/writegood.vim +++ b/ale_linters/nroff/writegood.vim @@ -1,9 +1,4 @@ " Author: Sumner Evans <sumner.evans98@gmail.com> " Description: write-good for nroff files -call ale#linter#Define('nroff', { -\ 'name': 'write-good', -\ 'executable_callback': 'ale#handlers#writegood#GetExecutable', -\ 'command_callback': 'ale#handlers#writegood#GetCommand', -\ 'callback': 'ale#handlers#writegood#Handle', -\}) +call ale#handlers#writegood#DefineLinter('nroff') diff --git a/ale_linters/po/writegood.vim b/ale_linters/po/writegood.vim index 5a01cb66..14686473 100644 --- a/ale_linters/po/writegood.vim +++ b/ale_linters/po/writegood.vim @@ -1,9 +1,4 @@ " Author: Cian Butler https://github.com/butlerx " Description: write-good for PO files -call ale#linter#Define('po', { -\ 'name': 'write-good', -\ 'executable_callback': 'ale#handlers#writegood#GetExecutable', -\ 'command_callback': 'ale#handlers#writegood#GetCommand', -\ 'callback': 'ale#handlers#writegood#Handle', -\}) +call ale#handlers#writegood#DefineLinter('po') diff --git a/ale_linters/pod/writegood.vim b/ale_linters/pod/writegood.vim index 14ed5c0c..9f5461e6 100644 --- a/ale_linters/pod/writegood.vim +++ b/ale_linters/pod/writegood.vim @@ -1,9 +1,4 @@ " Author: Sumner Evans <sumner.evans98@gmail.com> " Description: write-good for Pod files -call ale#linter#Define('pod', { -\ 'name': 'write-good', -\ 'executable_callback': 'ale#handlers#writegood#GetExecutable', -\ 'command_callback': 'ale#handlers#writegood#GetCommand', -\ 'callback': 'ale#handlers#writegood#Handle', -\}) +call ale#handlers#writegood#DefineLinter('pod') diff --git a/ale_linters/rst/writegood.vim b/ale_linters/rst/writegood.vim index 12137dbf..26b1152a 100644 --- a/ale_linters/rst/writegood.vim +++ b/ale_linters/rst/writegood.vim @@ -1,9 +1,4 @@ " Author: Sumner Evans <sumner.evans98@gmail.com> " Description: write-good for reStructuredText files -call ale#linter#Define('rst', { -\ 'name': 'write-good', -\ 'executable_callback': 'ale#handlers#writegood#GetExecutable', -\ 'command_callback': 'ale#handlers#writegood#GetCommand', -\ 'callback': 'ale#handlers#writegood#Handle', -\}) +call ale#handlers#writegood#DefineLinter('rst') diff --git a/ale_linters/sml/smlnj_cm.vim b/ale_linters/sml/smlnj_cm.vim index 96cd7bd9..7a482307 100644 --- a/ale_linters/sml/smlnj_cm.vim +++ b/ale_linters/sml/smlnj_cm.vim @@ -9,7 +9,8 @@ endfunction " Using CM requires that we set "lint_file: 1", since it reads the files " from the disk itself. call ale#linter#Define('sml', { -\ 'name': 'smlnj-cm', +\ 'name': 'smlnj_cm', +\ 'aliases': ['smlnj-cm'], \ 'executable_callback': 'ale#handlers#sml#GetExecutableSmlnjCm', \ 'lint_file': 1, \ 'command_callback': 'ale_linters#sml#smlnj_cm#GetCommand', diff --git a/ale_linters/tex/writegood.vim b/ale_linters/tex/writegood.vim index dc59de2e..c1aeace9 100644 --- a/ale_linters/tex/writegood.vim +++ b/ale_linters/tex/writegood.vim @@ -1,9 +1,4 @@ " Author: Sumner Evans <sumner.evans98@gmail.com> " Description: write-good for TeX files -call ale#linter#Define('tex', { -\ 'name': 'write-good', -\ 'executable_callback': 'ale#handlers#writegood#GetExecutable', -\ 'command_callback': 'ale#handlers#writegood#GetCommand', -\ 'callback': 'ale#handlers#writegood#Handle', -\}) +call ale#handlers#writegood#DefineLinter('tex') diff --git a/ale_linters/texinfo/writegood.vim b/ale_linters/texinfo/writegood.vim index 8104c634..4427f056 100644 --- a/ale_linters/texinfo/writegood.vim +++ b/ale_linters/texinfo/writegood.vim @@ -1,9 +1,4 @@ " Author: Sumner Evans <sumner.evans98@gmail.com> " Description: write-good for Texinfo files -call ale#linter#Define('texinfo', { -\ 'name': 'write-good', -\ 'executable_callback': 'ale#handlers#writegood#GetExecutable', -\ 'command_callback': 'ale#handlers#writegood#GetCommand', -\ 'callback': 'ale#handlers#writegood#Handle', -\}) +call ale#handlers#writegood#DefineLinter('texinfo') diff --git a/ale_linters/text/writegood.vim b/ale_linters/text/writegood.vim index ff76ce42..81b935d4 100644 --- a/ale_linters/text/writegood.vim +++ b/ale_linters/text/writegood.vim @@ -1,9 +1,4 @@ " Author: Sumner Evans <sumner.evans98@gmail.com> " Description: write-good for text files -call ale#linter#Define('text', { -\ 'name': 'write-good', -\ 'executable_callback': 'ale#handlers#writegood#GetExecutable', -\ 'command_callback': 'ale#handlers#writegood#GetCommand', -\ 'callback': 'ale#handlers#writegood#Handle', -\}) +call ale#handlers#writegood#DefineLinter('text') diff --git a/ale_linters/xhtml/writegood.vim b/ale_linters/xhtml/writegood.vim index 83d1863b..1fcba182 100644 --- a/ale_linters/xhtml/writegood.vim +++ b/ale_linters/xhtml/writegood.vim @@ -1,9 +1,4 @@ " Author: Sumner Evans <sumner.evans98@gmail.com> " Description: write-good for XHTML files -call ale#linter#Define('xhtml', { -\ 'name': 'write-good', -\ 'executable_callback': 'ale#handlers#writegood#GetExecutable', -\ 'command_callback': 'ale#handlers#writegood#GetCommand', -\ 'callback': 'ale#handlers#writegood#Handle', -\}) +call ale#handlers#writegood#DefineLinter('xhtml') |