Compare commits
124 commits
Author | SHA1 | Date | |
---|---|---|---|
80ef6ef6a7 | |||
|
0a0535546f | ||
|
b7363bef7d | ||
|
193a4b9336 | ||
|
f476c28b29 | ||
|
08cfd5f90c | ||
|
565ffa0dc5 | ||
|
857723e7d5 | ||
|
8a77290553 | ||
|
b6bf6ecdbc | ||
|
540952ca8e | ||
|
ad7ffe2875 | ||
|
2c2c7ceb1d | ||
|
acbe527e15 | ||
|
2096562899 | ||
|
fbbb8c17d9 | ||
|
1d0690f6d7 | ||
|
aea5de282e | ||
|
f64db199f1 | ||
|
7e20d9c639 | ||
|
7ec684206c | ||
|
b15706d9a9 | ||
|
d86371cd29 | ||
|
cfa3e6a924 | ||
|
82f8a04e18 | ||
|
478a2883a6 | ||
|
0ddf16194d | ||
|
0292e5a458 | ||
|
b6ccd60dd0 | ||
|
b5209d31e8 | ||
|
4941bd8d0e | ||
|
8b304f77b7 | ||
|
ab5257c344 | ||
|
89f8d3e456 | ||
|
5915a0ee39 | ||
|
608b6dafd4 | ||
|
5972b97223 | ||
|
fcb7932d7d | ||
|
f979da54d4 | ||
|
716b46e10d | ||
|
a3329ef3fc | ||
|
c2ab885384 | ||
|
5dc884b24d | ||
|
91b7a75afb | ||
|
dda132c1a2 | ||
|
33b3331b04 | ||
|
0f822b063c | ||
|
31e0f48d62 | ||
|
7c4decf804 | ||
|
b13f290390 | ||
|
23db293bdf | ||
|
52fe924a13 | ||
|
bb095df25e | ||
|
4df87eaadd | ||
|
c589e3d57d | ||
|
863fb60695 | ||
|
1832240cff | ||
|
65fc5d11c7 | ||
|
7ef55a8615 | ||
|
ea60fcea39 | ||
|
9dad25778f | ||
|
bc63325881 | ||
|
34e6368610 | ||
|
dffc162dd6 | ||
|
ef898fa303 | ||
|
be47e37bbc | ||
|
9849c79ff7 | ||
|
b28a6ddbe4 | ||
|
d562d53102 | ||
|
dd413a4732 | ||
|
038789f0ed | ||
|
acf9c92ab4 | ||
|
7cd25181b2 | ||
|
1d3b542031 | ||
|
8675bfc4ab | ||
|
7b50b3ec82 | ||
|
a5ec4143d2 | ||
|
042dec059a | ||
|
eddda2f8b5 | ||
|
045c92ed65 | ||
|
aa29c91cdc | ||
|
13c839cf16 | ||
|
f6af75aac4 | ||
|
e18aba1d7e | ||
|
5005871644 | ||
|
65fa901ef0 | ||
|
ba1540a545 | ||
|
2ef45ab745 | ||
|
adba2bd919 | ||
|
29acafdaf4 | ||
|
547716eabb | ||
|
112fcf7dd5 | ||
|
68d4a2216c | ||
|
ff388bbcd5 | ||
|
b5a5cdf920 | ||
|
eecbacb742 | ||
|
f1747901cc | ||
|
b6d1c41925 | ||
|
c9d66b861b | ||
|
7a1a534305 | ||
|
401b964e9c | ||
|
ff8d4c5286 | ||
|
5285b0b332 | ||
|
e98a3899da | ||
|
80342b119a | ||
|
d9a3722e06 | ||
|
1e34210f9a | ||
|
681c35169f | ||
|
d8f71c46da | ||
|
b0eaddadc9 | ||
|
3b0c67e42c | ||
|
c90b45c559 | ||
|
e2d3dca486 | ||
|
c165c7c5d1 | ||
|
48cae6afc4 | ||
|
0548cf9177 | ||
|
4d4d2d8122 | ||
|
2c9c5dec1e | ||
|
e43e7065da | ||
|
2495744fc3 | ||
|
87ffc9b55c | ||
|
d4b43d23f4 | ||
|
537d162ee7 | ||
|
4b56b91ac8 |
143 changed files with 3053 additions and 212 deletions
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
|||
Copyright (c) 2016-2017, w0rp <devw0rp@gmail.com>
|
||||
Copyright (c) 2016-2018, w0rp <devw0rp@gmail.com>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
35
README.md
35
README.md
|
@ -1,4 +1,4 @@
|
|||
# Asynchronous Lint Engine [](https://travis-ci.org/w0rp/ale) [](https://ci.appveyor.com/project/w0rp/ale)
|
||||
# Asynchronous Lint Engine [](https://travis-ci.org/w0rp/ale) [](https://ci.appveyor.com/project/w0rp/ale)
|
||||
|
||||
|
||||

|
||||
|
@ -79,8 +79,8 @@ formatting.
|
|||
| Awk | [gawk](https://www.gnu.org/software/gawk/)|
|
||||
| Bash | shell [-n flag](https://www.gnu.org/software/bash/manual/bash.html#index-set), [shellcheck](https://www.shellcheck.net/), [shfmt](https://github.com/mvdan/sh) |
|
||||
| Bourne Shell | shell [-n flag](http://linux.die.net/man/1/sh), [shellcheck](https://www.shellcheck.net/), [shfmt](https://github.com/mvdan/sh) |
|
||||
| C | [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint), [gcc](https://gcc.gnu.org/), [clang](http://clang.llvm.org/), [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html)|
|
||||
| C++ (filetype cpp) | [clang](http://clang.llvm.org/), [clangcheck](http://clang.llvm.org/docs/ClangCheck.html) !!, [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html), [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint) !!, [gcc](https://gcc.gnu.org/) |
|
||||
| C | [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint), [clang](http://clang.llvm.org/), [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html), [flawfinder](https://www.dwheeler.com/flawfinder/), [gcc](https://gcc.gnu.org/) |
|
||||
| C++ (filetype cpp) | [clang](http://clang.llvm.org/), [clangcheck](http://clang.llvm.org/docs/ClangCheck.html) !!, [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html), [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint) !!, [flawfinder](https://www.dwheeler.com/flawfinder/), [gcc](https://gcc.gnu.org/) |
|
||||
| CUDA | [nvcc](http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html) |
|
||||
| C# | [mcs](http://www.mono-project.com/docs/about-mono/languages/csharp/) see:`help ale-cs-mcs` for details, [mcsc](http://www.mono-project.com/docs/about-mono/languages/csharp/) !! see:`help ale-cs-mcsc` for details and configuration|
|
||||
| Chef | [foodcritic](http://www.foodcritic.io/) |
|
||||
|
@ -93,16 +93,19 @@ formatting.
|
|||
| D | [dmd](https://dlang.org/dmd-linux.html) |
|
||||
| Dafny | [dafny](https://rise4fun.com/Dafny) !! |
|
||||
| Dart | [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) !!, [language_server](https://github.com/natebosch/dart_language_server) |
|
||||
| Dockerfile | [hadolint](https://github.com/lukasmartinelli/hadolint) |
|
||||
| Elixir | [credo](https://github.com/rrrene/credo), [dogma](https://github.com/lpil/dogma) !! |
|
||||
| Dockerfile | [hadolint](https://github.com/hadolint/hadolint) |
|
||||
| Elixir | [credo](https://github.com/rrrene/credo), [dialyxir](https://github.com/jeremyjh/dialyxir), [dogma](https://github.com/lpil/dogma) !!|
|
||||
| Elm | [elm-format](https://github.com/avh4/elm-format), [elm-make](https://github.com/elm-lang/elm-make) |
|
||||
| Erb | [erb](https://github.com/jeremyevans/erubi), [erubis](https://github.com/kwatch/erubis) |
|
||||
| Erb | [erb](https://apidock.com/ruby/ERB), [erubi](https://github.com/jeremyevans/erubi), [erubis](https://github.com/kwatch/erubis) |
|
||||
| Erlang | [erlc](http://erlang.org/doc/man/erlc.html), [SyntaxErl](https://github.com/ten0s/syntaxerl) |
|
||||
| Fish | fish [-n flag](https://linux.die.net/man/1/fish)
|
||||
| Fortran | [gcc](https://gcc.gnu.org/) |
|
||||
| Fountain | [proselint](http://proselint.com/) |
|
||||
| FusionScript | [fusion-lint](https://github.com/RyanSquared/fusionscript) |
|
||||
| Git Commit Messages | [gitlint](https://github.com/jorisroovers/gitlint) |
|
||||
| GLSL | [glslang](https://github.com/KhronosGroup/glslang), [glslls](https://github.com/svenstaro/glsl-language-server) |
|
||||
| Go | [gofmt](https://golang.org/cmd/gofmt/), [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports), [go vet](https://golang.org/cmd/vet/), [golint](https://godoc.org/github.com/golang/lint), [gometalinter](https://github.com/alecthomas/gometalinter) !!, [go build](https://golang.org/cmd/go/) !!, [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) !!, [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) !! |
|
||||
| GraphQL | [eslint](http://eslint.org/), [gqlint](https://github.com/happylinks/gqlint) |
|
||||
| Go | [gofmt](https://golang.org/cmd/gofmt/), [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports), [go vet](https://golang.org/cmd/vet/) !!, [golint](https://godoc.org/github.com/golang/lint), [gotype](https://godoc.org/golang.org/x/tools/cmd/gotype), [gometalinter](https://github.com/alecthomas/gometalinter) !!, [go build](https://golang.org/cmd/go/) !!, [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) !!, [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) !! |
|
||||
| GraphQL | [eslint](http://eslint.org/), [gqlint](https://github.com/happylinks/gqlint), [prettier](https://github.com/prettier/prettier) |
|
||||
| Haml | [haml-lint](https://github.com/brigade/haml-lint) |
|
||||
| Handlebars | [ember-template-lint](https://github.com/rwjblue/ember-template-lint) |
|
||||
| Haskell | [brittany](https://github.com/lspitzner/brittany), [ghc](https://www.haskell.org/ghc/), [stack-ghc](https://haskellstack.org/), [stack-build](https://haskellstack.org/) !!, [ghc-mod](https://github.com/DanielG/ghc-mod), [stack-ghc-mod](https://github.com/DanielG/ghc-mod), [hlint](https://hackage.haskell.org/package/hlint), [hdevtools](https://hackage.haskell.org/package/hdevtools), [hfmt](https://github.com/danstiner/hfmt) |
|
||||
|
@ -110,15 +113,15 @@ formatting.
|
|||
| Idris | [idris](http://www.idris-lang.org/) |
|
||||
| Java | [checkstyle](http://checkstyle.sourceforge.net), [javac](http://www.oracle.com/technetwork/java/javase/downloads/index.html), [google-java-format](https://github.com/google/google-java-format) |
|
||||
| JavaScript | [eslint](http://eslint.org/), [flow](https://flowtype.org/), [jscs](http://jscs.info/), [jshint](http://jshint.com/), [prettier](https://github.com/prettier/prettier), [prettier-eslint](https://github.com/prettier/prettier-eslint), [prettier-standard](https://github.com/sheerun/prettier-standard), [standard](http://standardjs.com/), [xo](https://github.com/sindresorhus/xo)
|
||||
| JSON | [jsonlint](http://zaa.ch/jsonlint/), [prettier](https://github.com/prettier/prettier) |
|
||||
| JSON | [fixjson](https://github.com/rhysd/fixjson), [jsonlint](http://zaa.ch/jsonlint/), [jq](https://stedolan.github.io/jq/), [prettier](https://github.com/prettier/prettier) |
|
||||
| Kotlin | [kotlinc](https://kotlinlang.org) !!, [ktlint](https://ktlint.github.io) !! see `:help ale-integration-kotlin` for configuration instructions |
|
||||
| LaTeX | [alex](https://github.com/wooorm/alex) !!, [chktex](http://www.nongnu.org/chktex/), [lacheck](https://www.ctan.org/pkg/lacheck), [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
||||
| Less | [lessc](https://www.npmjs.com/package/less), [prettier](https://github.com/prettier/prettier), [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| LLVM | [llc](https://llvm.org/docs/CommandGuide/llc.html) |
|
||||
| Lua | [luacheck](https://github.com/mpeterv/luacheck) |
|
||||
| Lua | [luac](https://www.lua.org/manual/5.1/luac.html), [luacheck](https://github.com/mpeterv/luacheck) |
|
||||
| Mail | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) |
|
||||
| Make | [checkmake](https://github.com/mrtazz/checkmake) |
|
||||
| Markdown | [alex](https://github.com/wooorm/alex) !!, [mdl](https://github.com/mivok/markdownlint), [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [remark-lint](https://github.com/wooorm/remark-lint) !!, [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
||||
| Markdown | [alex](https://github.com/wooorm/alex) !!, [mdl](https://github.com/mivok/markdownlint), [prettier](https://github.com/prettier/prettier), [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [remark-lint](https://github.com/wooorm/remark-lint) !!, [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
||||
| MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) |
|
||||
| Nim | [nim check](https://nim-lang.org/docs/nimc.html) !! |
|
||||
| nix | [nix-instantiate](http://nixos.org/nix/manual/#sec-nix-instantiate) |
|
||||
|
@ -127,14 +130,16 @@ formatting.
|
|||
| Objective-C++ | [clang](http://clang.llvm.org/) |
|
||||
| OCaml | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-ocaml-merlin` for configuration instructions, [ols](https://github.com/freebroccolo/ocaml-language-server) |
|
||||
| Perl | [perl -c](https://perl.org/), [perl-critic](https://metacpan.org/pod/Perl::Critic) |
|
||||
| PHP | [hack](http://hacklang.org/), [hackfmt](https://github.com/facebook/flow/tree/master/hack/hackfmt), [langserver](https://github.com/felixfbecker/php-language-server), [phan](https://github.com/phan/phan) see `:help ale-php-phan` to instructions, [php -l](https://secure.php.net/), [phpcs](https://github.com/squizlabs/PHP_CodeSniffer), [phpmd](https://phpmd.org), [phpstan](https://github.com/phpstan/phpstan), [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer) |
|
||||
| PHP | [hack](http://hacklang.org/), [hackfmt](https://github.com/facebook/flow/tree/master/hack/hackfmt), [langserver](https://github.com/felixfbecker/php-language-server), [phan](https://github.com/phan/phan) see `:help ale-php-phan` to instructions, [php -l](https://secure.php.net/), [phpcs](https://github.com/squizlabs/PHP_CodeSniffer), [phpmd](https://phpmd.org), [phpstan](https://github.com/phpstan/phpstan), [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer), [php-cs-fixer](http://cs.sensiolabs.org/) |
|
||||
| PO | [alex](https://github.com/wooorm/alex) !!, [msgfmt](https://www.gnu.org/software/gettext/manual/html_node/msgfmt-Invocation.html), [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
||||
| Pod | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
||||
| Pony | [ponyc](https://github.com/ponylang/ponyc) |
|
||||
| proto | [protoc-gen-lint](https://github.com/ckaznocha/protoc-gen-lint) |
|
||||
| Pug | [pug-lint](https://github.com/pugjs/pug-lint) |
|
||||
| Puppet | [puppet](https://puppet.com), [puppet-lint](https://puppet-lint.com) |
|
||||
| Python | [autopep8](https://github.com/hhatto/autopep8), [flake8](http://flake8.pycqa.org/en/latest/), [isort](https://github.com/timothycrosley/isort), [mypy](http://mypy-lang.org/), [prospector](http://github.com/landscapeio/prospector), [pycodestyle](https://github.com/PyCQA/pycodestyle), [pyls](https://github.com/palantir/python-language-server), [pylint](https://www.pylint.org/) !!, [yapf](https://github.com/google/yapf) |
|
||||
| R | [lintr](https://github.com/jimhester/lintr) |
|
||||
| ReasonML | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-integration-reason-merlin` for configuration instructions, [ols](https://github.com/freebroccolo/ocaml-language-server), [refmt](https://github.com/reasonml/reason-cli) |
|
||||
| ReasonML | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-reasonml-ols` for configuration instructions, [ols](https://github.com/freebroccolo/ocaml-language-server), [refmt](https://github.com/reasonml/reason-cli) |
|
||||
| reStructuredText | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [rstcheck](https://github.com/myint/rstcheck), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
||||
| Re:VIEW | [redpen](http://redpen.cc/) |
|
||||
| RPM spec | [rpmlint](https://github.com/rpm-software-management/rpmlint) (disabled by default; see `:help ale-integration-spec`) |
|
||||
|
@ -158,6 +163,7 @@ formatting.
|
|||
| Verilog | [iverilog](https://github.com/steveicarus/iverilog), [verilator](http://www.veripool.org/projects/verilator/wiki/Intro) |
|
||||
| Vim | [vint](https://github.com/Kuniwak/vint) |
|
||||
| Vim help^ | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
||||
| Vue | [prettier](https://github.com/prettier/prettier) |
|
||||
| XHTML | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
||||
| XML | [xmllint](http://xmlsoft.org/xmllint.html) |
|
||||
| YAML | [swaglint](https://github.com/byCedric/swaglint), [yamllint](https://yamllint.readthedocs.io/) |
|
||||
|
@ -571,6 +577,9 @@ let g:ale_open_list = 1
|
|||
let g:ale_keep_list_window_open = 1
|
||||
```
|
||||
|
||||
You can also set `let g:ale_list_vertical = 1` to open the windows vertically
|
||||
instead of the default horizontally.
|
||||
|
||||
<a name="faq-jsx-stylelint-eslint"></a>
|
||||
|
||||
### 5.xii. How can I check JSX files with both stylelint and eslint?
|
||||
|
|
30
ale_linters/c/flawfinder.vim
Normal file
30
ale_linters/c/flawfinder.vim
Normal file
|
@ -0,0 +1,30 @@
|
|||
" Author: Christian Gibbons <cgibbons@gmu.edu>
|
||||
" Description: flawfinder linter for c files
|
||||
|
||||
call ale#Set('c_flawfinder_executable', 'flawfinder')
|
||||
call ale#Set('c_flawfinder_options', '')
|
||||
call ale#Set('c_flawfinder_minlevel', 1)
|
||||
|
||||
function! ale_linters#c#flawfinder#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'c_flawfinder_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#c#flawfinder#GetCommand(buffer) abort
|
||||
|
||||
" Set the minimum vulnerability level for flawfinder to bother with
|
||||
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'c_flawfinder_minlevel')
|
||||
|
||||
return ale#Escape(ale_linters#c#flawfinder#GetExecutable(a:buffer))
|
||||
\ . ' -CDQS'
|
||||
\ . ale#Var(a:buffer, 'c_flawfinder_options')
|
||||
\ . l:minlevel
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'flawfinder',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable_callback': 'ale_linters#c#flawfinder#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#c#flawfinder#GetCommand',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\})
|
|
@ -24,9 +24,9 @@ function! ale_linters#cpp#clangcheck#GetCommand(buffer) abort
|
|||
" detected.
|
||||
return ale#Escape(ale_linters#cpp#clangcheck#GetExecutable(a:buffer))
|
||||
\ . ' -analyze %s'
|
||||
\ . (empty(l:build_dir) ? ' -extra-arg -Xclang -extra-arg -analyzer-output=text' : '')
|
||||
\ . (!empty(l:user_options) ? ' ' . l:user_options : '')
|
||||
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||
\ . (empty(l:build_dir) ? ' -extra-arg -Xanalyzer -extra-arg -analyzer-output=text' : '')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
|
|
30
ale_linters/cpp/flawfinder.vim
Normal file
30
ale_linters/cpp/flawfinder.vim
Normal file
|
@ -0,0 +1,30 @@
|
|||
" Author: Christian Gibbons <cgibbons@gmu.edu>
|
||||
" Description: flawfinder linter for c++ files
|
||||
|
||||
call ale#Set('cpp_flawfinder_executable', 'flawfinder')
|
||||
call ale#Set('cpp_flawfinder_options', '')
|
||||
call ale#Set('cpp_flawfinder_minlevel', 1)
|
||||
|
||||
function! ale_linters#cpp#flawfinder#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'cpp_flawfinder_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cpp#flawfinder#GetCommand(buffer) abort
|
||||
|
||||
" Set the minimum vulnerability level for flawfinder to bother with
|
||||
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'cpp_flawfinder_minlevel')
|
||||
|
||||
return ale#Escape(ale_linters#cpp#flawfinder#GetExecutable(a:buffer))
|
||||
\ . ' -CDQS'
|
||||
\ . ale#Var(a:buffer, 'cpp_flawfinder_options')
|
||||
\ . l:minlevel
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'flawfinder',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable_callback': 'ale_linters#cpp#flawfinder#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#cpp#flawfinder#GetCommand',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\})
|
|
@ -10,7 +10,7 @@ function! s:GetWorkingDirectory(buffer) abort
|
|||
return l:working_directory
|
||||
endif
|
||||
|
||||
return fnamemodify(bufname(a:buffer), ':p:h')
|
||||
return expand('#' . a:buffer . ':p:h')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cs#mcsc#GetCommand(buffer) abort
|
||||
|
|
|
@ -2,31 +2,51 @@
|
|||
|
||||
" always, yes, never
|
||||
call ale#Set('dockerfile_hadolint_use_docker', 'never')
|
||||
call ale#Set('dockerfile_hadolint_docker_image', 'lukasmartinelli/hadolint')
|
||||
call ale#Set('dockerfile_hadolint_docker_image', 'hadolint/hadolint')
|
||||
|
||||
function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
|
||||
" Matches patterns line the following:
|
||||
"
|
||||
" stdin:19: F: Pipe chain should start with a raw value.
|
||||
let l:pattern = '\v^/dev/stdin:?(\d+)? (\S+) (.+)$'
|
||||
" /dev/stdin:19 DL3001 Pipe chain should start with a raw value.
|
||||
" /dev/stdin:19:3 unexpected thing
|
||||
let l:pattern = '\v^/dev/stdin:(\d+):?(\d+)? ((DL|SC)(\d+) )?(.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:lnum = 0
|
||||
let l:colnum = 0
|
||||
|
||||
if l:match[1] isnot# ''
|
||||
let l:lnum = l:match[1] + 0
|
||||
endif
|
||||
|
||||
if l:match[2] isnot# ''
|
||||
let l:colnum = l:match[2] + 0
|
||||
endif
|
||||
|
||||
let l:type = 'W'
|
||||
let l:text = l:match[3]
|
||||
let l:text = l:match[6]
|
||||
let l:detail = l:match[6]
|
||||
let l:domain = 'https://github.com/hadolint/hadolint/wiki/'
|
||||
|
||||
if l:match[4] is# 'SC'
|
||||
let l:domain = 'https://github.com/koalaman/shellcheck/wiki/'
|
||||
endif
|
||||
|
||||
if l:match[5] isnot# ''
|
||||
let l:code = l:match[4] . l:match[5]
|
||||
let l:link = ' ( ' . l:domain . l:code . ' )'
|
||||
let l:detail = l:code . l:link . "\n\n" . l:detail
|
||||
else
|
||||
let l:type = 'E'
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:lnum,
|
||||
\ 'col': 0,
|
||||
\ 'col': l:colnum,
|
||||
\ 'type': l:type,
|
||||
\ 'text': l:text,
|
||||
\ 'nr': l:match[2],
|
||||
\ 'detail': l:detail
|
||||
\})
|
||||
endfor
|
||||
|
||||
|
|
|
@ -32,6 +32,6 @@ endfunction
|
|||
call ale#linter#Define('elixir', {
|
||||
\ 'name': 'credo',
|
||||
\ 'executable': 'mix',
|
||||
\ 'command': 'mix credo suggest --format=flycheck --read-from-stdin %s',
|
||||
\ 'command': 'mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s',
|
||||
\ 'callback': 'ale_linters#elixir#credo#Handle',
|
||||
\})
|
||||
|
|
34
ale_linters/elixir/dialyxir.vim
Normal file
34
ale_linters/elixir/dialyxir.vim
Normal file
|
@ -0,0 +1,34 @@
|
|||
" Author: Fran C. - https://github.com/franciscoj
|
||||
" Description: Add dialyzer support for elixir through dialyxir
|
||||
" https://github.com/jeremyjh/dialyxir
|
||||
|
||||
function! ale_linters#elixir#dialyxir#Handle(buffer, lines) abort
|
||||
" Matches patterns line the following:
|
||||
"
|
||||
" lib/filename.ex:19: Function fname/1 has no local return
|
||||
let l:pattern = '\v(.+):(\d+): (.+)$'
|
||||
let l:output = []
|
||||
let l:type = 'W'
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
if bufname(a:buffer) == l:match[1]
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'col': 0,
|
||||
\ 'type': l:type,
|
||||
\ 'text': l:match[3],
|
||||
\})
|
||||
endif
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('elixir', {
|
||||
\ 'name': 'dialyxir',
|
||||
\ 'executable': 'mix',
|
||||
\ 'command': 'mix dialyzer',
|
||||
\ 'callback': 'ale_linters#elixir#dialyxir#Handle',
|
||||
\})
|
||||
|
|
@ -32,7 +32,7 @@ endfunction
|
|||
call ale#linter#Define('elixir', {
|
||||
\ 'name': 'dogma',
|
||||
\ 'executable': 'mix',
|
||||
\ 'command': 'mix dogma %s --format=flycheck',
|
||||
\ 'command': 'mix help dogma && mix dogma %s --format=flycheck',
|
||||
\ 'lint_file': 1,
|
||||
\ 'callback': 'ale_linters#elixir#dogma#Handle',
|
||||
\})
|
||||
|
|
35
ale_linters/eruby/erubi.vim
Normal file
35
ale_linters/eruby/erubi.vim
Normal file
|
@ -0,0 +1,35 @@
|
|||
" Author: Eddie Lebow https://github.com/elebow
|
||||
" Description: eruby checker using `erubi`
|
||||
|
||||
function! ale_linters#eruby#erubi#CheckErubi(buffer) abort
|
||||
return 'ruby -r erubi/capture_end -e ' . ale#Escape('""')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#eruby#erubi#GetCommand(buffer, check_erubi_output) abort
|
||||
let l:rails_root = ale#ruby#FindRailsRoot(a:buffer)
|
||||
|
||||
if (!empty(a:check_erubi_output))
|
||||
" The empty command in CheckErubi returns nothing if erubi runs and
|
||||
" emits an error if erubi is not present
|
||||
return ''
|
||||
endif
|
||||
|
||||
if empty(l:rails_root)
|
||||
return 'ruby -r erubi/capture_end -e ' . ale#Escape('puts Erubi::CaptureEndEngine.new($stdin.read).src') . '< %t | ruby -c'
|
||||
endif
|
||||
|
||||
" Rails-flavored eRuby does not comply with the standard as understood by
|
||||
" Erubi, so we'll have to do some substitution. This does not reduce the
|
||||
" effectiveness of the linter---the translated code is still evaluated.
|
||||
return 'ruby -r erubi/capture_end -e ' . ale#Escape('puts Erubi::CaptureEndEngine.new($stdin.read.gsub(%{<%=},%{<%}), nil, %{-}).src') . '< %t | ruby -c'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('eruby', {
|
||||
\ 'name': 'erubi',
|
||||
\ 'executable': 'ruby',
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale_linters#eruby#erubi#CheckErubi'},
|
||||
\ {'callback': 'ale_linters#eruby#erubi#GetCommand', 'output_stream': 'stderr'},
|
||||
\ ],
|
||||
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
||||
\})
|
36
ale_linters/fish/fish.vim
Normal file
36
ale_linters/fish/fish.vim
Normal file
|
@ -0,0 +1,36 @@
|
|||
" Author: Niraj Thapaliya - https://github.com/nthapaliya
|
||||
" Description: Lints fish files using fish -n
|
||||
|
||||
function! ale_linters#fish#fish#Handle(buffer, lines) abort
|
||||
" Matches patterns such as:
|
||||
"
|
||||
" home/.config/fish/functions/foo.fish (line 1): Missing end to balance this function definition
|
||||
" function foo
|
||||
" ^
|
||||
" <W> fish: Error while reading file .config/fish/functions/foo.fish
|
||||
let l:pattern = '^.* (line \(\d\+\)): \(.*\)$'
|
||||
let l:output = []
|
||||
|
||||
let l:i = 0
|
||||
while l:i < len(a:lines)
|
||||
let l:match = matchlist(a:lines[l:i], l:pattern)
|
||||
if len(l:match) && len(l:match[2])
|
||||
call add(l:output, {
|
||||
\ 'col': len(a:lines[l:i + 2]),
|
||||
\ 'lnum': str2nr(l:match[1]),
|
||||
\ 'text': l:match[2],
|
||||
\})
|
||||
endif
|
||||
let l:i += 1
|
||||
endwhile
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('fish', {
|
||||
\ 'name': 'fish',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'fish',
|
||||
\ 'command': 'fish -n %t',
|
||||
\ 'callback': 'ale_linters#fish#fish#Handle',
|
||||
\})
|
9
ale_linters/fountain/proselint.vim
Normal file
9
ale_linters/fountain/proselint.vim
Normal file
|
@ -0,0 +1,9 @@
|
|||
" Author: Jansen Mitchell https://github.com/JansenMitchell
|
||||
" Description: proselint for Fountain files
|
||||
|
||||
call ale#linter#Define('fountain', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
52
ale_linters/gitcommit/gitlint.vim
Normal file
52
ale_linters/gitcommit/gitlint.vim
Normal file
|
@ -0,0 +1,52 @@
|
|||
" Author: Nick Yamane <nick.diego@gmail.com>
|
||||
" Description: gitlint for git commit message files
|
||||
|
||||
let g:ale_gitcommit_gitlint_executable =
|
||||
\ get(g:, 'ale_gitcommit_gitlint_executable', 'gitlint')
|
||||
let g:ale_gitcommit_gitlint_options = get(g:, 'ale_gitcommit_gitlint_options', '')
|
||||
let g:ale_gitcommit_gitlint_use_global = get(g:, 'ale_gitcommit_gitlint_use_global', 0)
|
||||
|
||||
|
||||
function! ale_linters#gitcommit#gitlint#GetExecutable(buffer) abort
|
||||
return ale#python#FindExecutable(a:buffer, 'gitcommit_gitlint', ['gitlint'])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#gitcommit#gitlint#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'gitcommit_gitlint_options')
|
||||
let l:executable = ale_linters#gitcommit#gitlint#GetExecutable(a:buffer)
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' lint'
|
||||
endfunction
|
||||
|
||||
|
||||
function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
|
||||
" Matches patterns line the following:
|
||||
let l:pattern = '\v^(\d+): (\w+) (.*)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:code = l:match[2]
|
||||
|
||||
let l:item = {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'text': l:match[3],
|
||||
\ 'code': l:code,
|
||||
\ 'type': 'E',
|
||||
\}
|
||||
|
||||
call add(l:output, l:item)
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
|
||||
call ale#linter#Define('gitcommit', {
|
||||
\ 'name': 'gitlint',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#gitcommit#gitlint#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#gitcommit#gitlint#GetCommand',
|
||||
\ 'callback': 'ale_linters#gitcommit#gitlint#Handle',
|
||||
\})
|
||||
|
|
@ -1,9 +1,14 @@
|
|||
" Author: Joshua Rubin <joshua@rubixconsulting.com>, Ben Reedy <https://github.com/breed808>,
|
||||
" Jeff Willette <jrwillette88@gmail.com>
|
||||
" Description: go build for Go files
|
||||
|
||||
" inspired by work from dzhou121 <dzhou121@gmail.com>
|
||||
|
||||
call ale#Set('go_gobuild_options', '')
|
||||
|
||||
function! ale_linters#go#gobuild#ResetEnv() abort
|
||||
unlet! s:go_env
|
||||
endfunction
|
||||
|
||||
function! ale_linters#go#gobuild#GoEnv(buffer) abort
|
||||
if exists('s:go_env')
|
||||
return ''
|
||||
|
@ -13,6 +18,8 @@ function! ale_linters#go#gobuild#GoEnv(buffer) abort
|
|||
endfunction
|
||||
|
||||
function! ale_linters#go#gobuild#GetCommand(buffer, goenv_output) abort
|
||||
let l:options = ale#Var(a:buffer, 'go_gobuild_options')
|
||||
|
||||
if !exists('s:go_env')
|
||||
let s:go_env = {
|
||||
\ 'GOPATH': a:goenv_output[0],
|
||||
|
@ -20,10 +27,16 @@ function! ale_linters#go#gobuild#GetCommand(buffer, goenv_output) abort
|
|||
\}
|
||||
endif
|
||||
|
||||
let l:gopath_env_command = has('win32')
|
||||
\ ? 'set GOPATH=' . ale#Escape(s:go_env.GOPATH) . ' && '
|
||||
\ : 'GOPATH=' . ale#Escape(s:go_env.GOPATH) . ' '
|
||||
|
||||
" Run go test in local directory with relative path
|
||||
return 'GOPATH=' . s:go_env.GOPATH
|
||||
\ . ' cd ' . fnamemodify(bufname(a:buffer), ':.:h')
|
||||
\ . ' && go test -c -o /dev/null ./'
|
||||
return l:gopath_env_command
|
||||
\ . ale#path#BufferCdString(a:buffer)
|
||||
\ . 'go test'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' -c -o /dev/null ./'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#go#gobuild#GetMatches(lines) abort
|
||||
|
|
23
ale_linters/go/gotype.vim
Normal file
23
ale_linters/go/gotype.vim
Normal file
|
@ -0,0 +1,23 @@
|
|||
" Author: Jelte Fennema <github-public@jeltef.nl>
|
||||
" Description: gotype for Go files
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'gotype',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'gotype',
|
||||
\ 'command_callback': 'ale_linters#go#gotype#GetCommand',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||
\})
|
||||
|
||||
"\ 'command':
|
||||
function! ale_linters#go#gotype#GetCommand(buffer) abort
|
||||
let l:cur_file = expand('#' . a:buffer . ':p')
|
||||
if l:cur_file =~# '_test\.go$'
|
||||
return
|
||||
endif
|
||||
|
||||
let l:module_files = globpath(expand('#' . a:buffer . ':p:h'), '*.go', 0, 1)
|
||||
let l:other_module_files = filter(l:module_files, 'v:val isnot# ' . ale#util#EscapeVim(l:cur_file) . ' && v:val !~# "_test\.go$"')
|
||||
return 'gotype %t ' . join(map(l:other_module_files, 'ale#Escape(v:val)'))
|
||||
|
||||
endfunction
|
|
@ -1,10 +1,35 @@
|
|||
" Author: neersighted <bjorn@neersighted.com>
|
||||
" Description: go vet for Go files
|
||||
"
|
||||
" Author: John Eikenberry <jae@zhar.net>
|
||||
" Description: updated to work with go1.10
|
||||
|
||||
function! ale_linters#go#govet#GetCommand(buffer) abort
|
||||
return ale#path#BufferCdString(a:buffer) . ' go vet .'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#go#govet#Handler(buffer, lines) abort
|
||||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:? ?(.+)$'
|
||||
let l:output = []
|
||||
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'text': l:match[4],
|
||||
\ 'type': 'E',
|
||||
\})
|
||||
endfor
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'go vet',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'go',
|
||||
\ 'command': 'go vet %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||
\ 'command_callback': 'ale_linters#go#govet#GetCommand',
|
||||
\ 'callback': 'ale_linters#go#govet#Handler',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
|
|
@ -1,10 +1,32 @@
|
|||
" Author: Ben Reedy <https://github.com/breed808>
|
||||
" Description: staticcheck for Go files
|
||||
|
||||
call ale#Set('go_staticcheck_options', '')
|
||||
call ale#Set('go_staticcheck_lint_package', 0)
|
||||
|
||||
function! ale_linters#go#staticcheck#GetCommand(buffer) abort
|
||||
let l:filename = expand('#' . a:buffer . ':t')
|
||||
let l:options = ale#Var(a:buffer, 'go_staticcheck_options')
|
||||
let l:lint_package = ale#Var(a:buffer, 'go_staticcheck_lint_package')
|
||||
|
||||
" BufferCdString is used so that we can be sure the paths output from
|
||||
" staticcheck can be calculated to absolute paths in the Handler
|
||||
if l:lint_package
|
||||
return ale#path#BufferCdString(a:buffer)
|
||||
\ . 'staticcheck'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||
endif
|
||||
|
||||
return ale#path#BufferCdString(a:buffer)
|
||||
\ . 'staticcheck'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' ' . ale#Escape(l:filename)
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'staticcheck',
|
||||
\ 'executable': 'staticcheck',
|
||||
\ 'command': 'staticcheck %s',
|
||||
\ 'command_callback': 'ale_linters#go#staticcheck#GetCommand',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'lint_file': 1,
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: ghc for Haskell files
|
||||
|
||||
call ale#Set('haskell_ghc_options', '-fno-code -v0')
|
||||
|
||||
function! ale_linters#haskell#ghc#GetCommand(buffer) abort
|
||||
return 'ghc '
|
||||
\ . ale#Var(a:buffer, 'haskell_ghc_options')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'ghc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'ghc',
|
||||
\ 'command': 'ghc -fno-code -v0 %t',
|
||||
\ 'command_callback': 'ale_linters#haskell#ghc#GetCommand',
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
" Author: KabbAmine <amine.kabb@gmail.com>, deathmaz <00maz1987@gmail.com>, diartyz <diartyz@gmail.com>
|
||||
" Description: HTMLHint for checking html files
|
||||
|
||||
call ale#Set('html_htmlhint_options', '--format=unix')
|
||||
call ale#Set('html_htmlhint_options', '')
|
||||
call ale#Set('html_htmlhint_executable', 'htmlhint')
|
||||
call ale#Set('html_htmlhint_use_global', 0)
|
||||
|
||||
|
@ -12,9 +12,22 @@ function! ale_linters#html#htmlhint#GetExecutable(buffer) abort
|
|||
endfunction
|
||||
|
||||
function! ale_linters#html#htmlhint#GetCommand(buffer) abort
|
||||
return ale_linters#html#htmlhint#GetExecutable(a:buffer)
|
||||
\ . ' ' . ale#Var(a:buffer, 'html_htmlhint_options')
|
||||
\ . ' %t'
|
||||
let l:options = ale#Var(a:buffer, 'html_htmlhint_options')
|
||||
let l:config = l:options !~# '--config'
|
||||
\ ? ale#path#FindNearestFile(a:buffer, '.htmlhintrc')
|
||||
\ : ''
|
||||
|
||||
if !empty(l:config)
|
||||
let l:options .= ' --config ' . ale#Escape(l:config)
|
||||
endif
|
||||
|
||||
if !empty(l:options)
|
||||
let l:options = substitute(l:options, '--format=unix', '', '')
|
||||
endif
|
||||
|
||||
return ale#Escape(ale_linters#html#htmlhint#GetExecutable(a:buffer))
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --format=unix %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('html', {
|
||||
|
|
|
@ -25,8 +25,16 @@ function! ale_linters#html#tidy#GetCommand(buffer) abort
|
|||
\ 'utf-8': '-utf8',
|
||||
\ }, &fileencoding, '-utf8')
|
||||
|
||||
" On macOS, old tidy (released on 31 Oct 2006) is installed. It does not
|
||||
" consider HTML5 so we should avoid it.
|
||||
let l:executable = ale#Var(a:buffer, 'html_tidy_executable')
|
||||
if has('mac') && l:executable is# 'tidy' && exists('*exepath')
|
||||
\ && exepath(l:executable) is# '/usr/bin/tidy'
|
||||
return ''
|
||||
endif
|
||||
|
||||
return printf('%s %s %s -',
|
||||
\ ale#Var(a:buffer, 'html_tidy_executable'),
|
||||
\ l:executable,
|
||||
\ ale#Var(a:buffer, 'html_tidy_options'),
|
||||
\ l:file_encoding
|
||||
\)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'eslint',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'executable_callback': 'ale#handlers#eslint#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#eslint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#eslint#Handle',
|
||||
|
|
40
ale_linters/lua/luac.vim
Normal file
40
ale_linters/lua/luac.vim
Normal file
|
@ -0,0 +1,40 @@
|
|||
" Author: Jon Xie https://github.com/xiejiangzhi
|
||||
" Description: luac linter for lua files
|
||||
|
||||
call ale#Set('lua_luac_executable', 'luac')
|
||||
|
||||
function! ale_linters#lua#luac#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'lua_luac_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#lua#luac#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#lua#luac#GetExecutable(a:buffer)
|
||||
return ale#Escape(l:executable) . ' -p - '
|
||||
endfunction
|
||||
|
||||
function! ale_linters#lua#luac#Handle(buffer, lines) abort
|
||||
" Matches patterns line the following:
|
||||
"
|
||||
" luac: stdin:5: '=' expected near ')'
|
||||
" luac: stdin:8: ')' expected (to close '(' at line 6) near '123'
|
||||
let l:pattern = '\v^.*:(\d+): (.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'type': 'E',
|
||||
\ 'text': l:match[2],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('lua', {
|
||||
\ 'name': 'luac',
|
||||
\ 'executable_callback': 'ale_linters#lua#luac#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#lua#luac#GetCommand',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale_linters#lua#luac#Handle',
|
||||
\})
|
|
@ -1,5 +1,20 @@
|
|||
" Author: Steve Dignam <steve@dignam.xyz>
|
||||
" Description: Support for mdl, a markdown linter
|
||||
" Author: Steve Dignam <steve@dignam.xyz>, Josh Leeb-du Toit <joshleeb.com>
|
||||
" Description: Support for mdl, a markdown linter.
|
||||
|
||||
call ale#Set('markdown_mdl_executable', 'mdl')
|
||||
call ale#Set('markdown_mdl_options', '')
|
||||
|
||||
function! ale_linters#markdown#mdl#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'markdown_mdl_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#markdown#mdl#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#markdown#mdl#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'markdown_mdl_options')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#markdown#mdl#Handle(buffer, lines) abort
|
||||
" matches: '(stdin):173: MD004 Unordered list style'
|
||||
|
@ -19,7 +34,7 @@ endfunction
|
|||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'mdl',
|
||||
\ 'executable': 'mdl',
|
||||
\ 'command': 'mdl',
|
||||
\ 'executable_callback': 'ale_linters#markdown#mdl#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#markdown#mdl#GetCommand',
|
||||
\ 'callback': 'ale_linters#markdown#mdl#Handle'
|
||||
\})
|
||||
|
|
|
@ -27,12 +27,20 @@ function! ale_linters#perl#perl#Handle(buffer, lines) abort
|
|||
let l:output = []
|
||||
let l:basename = expand('#' . a:buffer . ':t')
|
||||
|
||||
let l:type = 'E'
|
||||
if a:lines[-1] =~# 'syntax OK'
|
||||
let l:type = 'W'
|
||||
endif
|
||||
|
||||
let l:seen = {}
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:line = l:match[3]
|
||||
let l:file = l:match[2]
|
||||
let l:text = l:match[1]
|
||||
let l:type = 'E'
|
||||
|
||||
if ale#path#IsBufferPath(a:buffer, l:match[2])
|
||||
if ale#path#IsBufferPath(a:buffer, l:file)
|
||||
\ && !has_key(l:seen,l:line)
|
||||
\ && (
|
||||
\ l:text isnot# 'BEGIN failed--compilation aborted'
|
||||
\ || empty(l:output)
|
||||
|
@ -43,6 +51,8 @@ function! ale_linters#perl#perl#Handle(buffer, lines) abort
|
|||
\ 'text': l:text,
|
||||
\ 'type': l:type,
|
||||
\})
|
||||
|
||||
let l:seen[l:line] = 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
|
|
11
ale_linters/po/alex.vim
Normal file
11
ale_linters/po/alex.vim
Normal file
|
@ -0,0 +1,11 @@
|
|||
" Author: Cian Butler https://github.com/butlerx
|
||||
" Description: alex for PO files
|
||||
|
||||
call ale#linter#Define('po', {
|
||||
\ 'name': 'alex',
|
||||
\ 'executable': 'alex',
|
||||
\ 'command': 'alex %s -t',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale#handlers#alex#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
10
ale_linters/po/msgfmt.vim
Normal file
10
ale_linters/po/msgfmt.vim
Normal file
|
@ -0,0 +1,10 @@
|
|||
" Author: Cian Butler https://github.com/butlerx
|
||||
" Description: msgfmt for PO files
|
||||
|
||||
call ale#linter#Define('po', {
|
||||
\ 'name': 'msgfmt',
|
||||
\ 'executable': 'msgfmt',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'command': 'msgfmt --statistics %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
9
ale_linters/po/proselint.vim
Normal file
9
ale_linters/po/proselint.vim
Normal file
|
@ -0,0 +1,9 @@
|
|||
" Author: Cian Butler https://github.com/butlerx
|
||||
" Description: proselint for PO files
|
||||
|
||||
call ale#linter#Define('po', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
9
ale_linters/po/write-good.vim
Normal file
9
ale_linters/po/write-good.vim
Normal file
|
@ -0,0 +1,9 @@
|
|||
" 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',
|
||||
\})
|
21
ale_linters/pony/ponyc.vim
Normal file
21
ale_linters/pony/ponyc.vim
Normal file
|
@ -0,0 +1,21 @@
|
|||
" Description: ponyc linter for pony files
|
||||
|
||||
call ale#Set('pony_ponyc_executable', 'ponyc')
|
||||
call ale#Set('pony_ponyc_options', '--pass paint')
|
||||
|
||||
function! ale_linters#pony#ponyc#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'pony_ponyc_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#pony#ponyc#GetCommand(buffer) abort
|
||||
return ale#Escape(ale_linters#pony#ponyc#GetExecutable(a:buffer))
|
||||
\ . ' ' . ale#Var(a:buffer, 'pony_ponyc_options')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('pony', {
|
||||
\ 'name': 'ponyc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#pony#ponyc#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#pony#ponyc#GetCommand',
|
||||
\ 'callback': 'ale#handlers#pony#HandlePonycFormat',
|
||||
\})
|
|
@ -1,12 +1,20 @@
|
|||
" Author: Jeff Willette <jrwillette88@gmail.com>
|
||||
" Description: run the protoc-gen-lint plugin for the protoc binary
|
||||
|
||||
call ale#Set('proto_protoc_gen_lint_options', '')
|
||||
|
||||
function! ale_linters#proto#protoc_gen_lint#GetCommand(buffer) abort
|
||||
let l:dirname = expand('#' . a:buffer . ':p:h')
|
||||
|
||||
return 'protoc'
|
||||
\ . ' -I ' . ale#Escape(l:dirname)
|
||||
\ . ' --lint_out=. ' . '%s'
|
||||
let l:options = ['-I ' . ale#Escape(l:dirname)]
|
||||
|
||||
if !empty(ale#Var(a:buffer, 'proto_protoc_gen_lint_options'))
|
||||
let l:options += [ale#Var(a:buffer, 'proto_protoc_gen_lint_options')]
|
||||
endif
|
||||
|
||||
let l:options += ['--lint_out=. ' . '%s']
|
||||
|
||||
return 'protoc' . ' ' . join(l:options)
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('proto', {
|
||||
|
|
|
@ -105,11 +105,16 @@ function! ale_linters#python#flake8#Handle(buffer, lines) abort
|
|||
\ 'type': 'W',
|
||||
\}
|
||||
|
||||
if l:code[:0] is# 'F' || l:code is# 'E999'
|
||||
let l:item.type = 'E'
|
||||
if l:code[:0] is# 'F'
|
||||
if l:code isnot# 'F401'
|
||||
let l:item.type = 'E'
|
||||
endif
|
||||
elseif l:code[:0] is# 'E'
|
||||
let l:item.type = 'E'
|
||||
let l:item.sub_type = 'style'
|
||||
|
||||
if l:code isnot# 'E999' && l:code isnot# 'E112'
|
||||
let l:item.sub_type = 'style'
|
||||
endif
|
||||
elseif l:code[:0] is# 'W'
|
||||
let l:item.sub_type = 'style'
|
||||
endif
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
" Author: Keith Smiley <k@keith.so>, w0rp <devw0rp@gmail.com>
|
||||
" Description: mypy support for optional python typechecking
|
||||
|
||||
let g:ale_python_mypy_executable =
|
||||
\ get(g:, 'ale_python_mypy_executable', 'mypy')
|
||||
let g:ale_python_mypy_options = get(g:, 'ale_python_mypy_options', '')
|
||||
let g:ale_python_mypy_use_global = get(g:, 'ale_python_mypy_use_global', 0)
|
||||
call ale#Set('python_mypy_executable', 'mypy')
|
||||
call ale#Set('python_mypy_ignore_invalid_syntax', 0)
|
||||
call ale#Set('python_mypy_options', '')
|
||||
call ale#Set('python_mypy_use_global', 0)
|
||||
|
||||
function! ale_linters#python#mypy#GetExecutable(buffer) abort
|
||||
return ale#python#FindExecutable(a:buffer, 'python_mypy', ['mypy'])
|
||||
|
@ -45,6 +45,12 @@ function! ale_linters#python#mypy#Handle(buffer, lines) abort
|
|||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
" Skip invalid syntax errors if the option is on.
|
||||
if l:match[5] is# 'invalid syntax'
|
||||
\&& ale#Var(a:buffer, 'python_mypy_ignore_invalid_syntax')
|
||||
continue
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
|
|
|
@ -44,8 +44,8 @@ function! ale_linters#python#pycodestyle#Handle(buffer, lines) abort
|
|||
\ 'code': l:match[4],
|
||||
\}
|
||||
|
||||
" E999 is not a style error, it's a syntax error.
|
||||
if l:match[4] is# 'E999'
|
||||
" E999 and E112 are syntax errors.
|
||||
if l:match[4] is# 'E999' || l:match[4] is# 'E112'
|
||||
unlet l:item.sub_type
|
||||
endif
|
||||
|
||||
|
|
|
@ -1,14 +1,29 @@
|
|||
" Author: Michel Lang <michellang@gmail.com>, w0rp <devw0rp@gmail.com>
|
||||
" Author: Michel Lang <michellang@gmail.com>, w0rp <devw0rp@gmail.com>,
|
||||
" Fenner Macrae <fmacrae.dev@gmail.com>
|
||||
" Description: This file adds support for checking R code with lintr.
|
||||
|
||||
let g:ale_r_lintr_options =
|
||||
\ get(g:, 'ale_r_lintr_options', 'lintr::with_defaults()')
|
||||
let g:ale_r_lintr_options = get(g:, 'ale_r_lintr_options', 'with_defaults()')
|
||||
" A reasonable alternative default:
|
||||
" \ get(g:, 'ale_r_lintr_options', 'lintr::with_defaults(object_usage_linter = NULL)')
|
||||
" get(g:, 'ale_r_lintr_options', 'with_defaults(object_usage_linter = NULL)')
|
||||
|
||||
|
||||
let g:ale_r_lintr_lint_package = get(g:, 'ale_r_lintr_lint_package', 0)
|
||||
|
||||
function! ale_linters#r#lintr#GetCommand(buffer) abort
|
||||
if ale#Var(a:buffer, 'r_lintr_lint_package')
|
||||
let l:lint_cmd = 'lint_package(cache = FALSE, linters = '
|
||||
\ . ale#Var(a:buffer, 'r_lintr_options') . ')'
|
||||
else
|
||||
let l:lint_cmd = 'lint(cache = FALSE, commandArgs(TRUE), '
|
||||
\ . ale#Var(a:buffer, 'r_lintr_options') . ')'
|
||||
endif
|
||||
|
||||
let l:cmd_string = 'suppressPackageStartupMessages(library(lintr));'
|
||||
\ . l:lint_cmd
|
||||
|
||||
return ale#path#BufferCdString(a:buffer)
|
||||
\ . 'Rscript -e ' . ale#Escape('lintr::lint(commandArgs(TRUE)[1], eval(parse(text = commandArgs(TRUE)[2])))') . ' %t' . ' ' . ale#Escape(ale#Var(a:buffer, 'r_lintr_options'))
|
||||
\ . 'Rscript -e '
|
||||
\ . ale#Escape(l:cmd_string) . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('r', {
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
" Author: Daniel Schemala <istjanichtzufassen@gmail.com>
|
||||
" Author: Daniel Schemala <istjanichtzufassen@gmail.com>,
|
||||
" Ivan Petkov <ivanppetkov@gmail.com>
|
||||
" Description: rustc invoked by cargo for rust files
|
||||
|
||||
call ale#Set('rust_cargo_use_check', 1)
|
||||
call ale#Set('rust_cargo_check_all_targets', 0)
|
||||
call ale#Set('rust_cargo_default_feature_behavior', 'default')
|
||||
call ale#Set('rust_cargo_include_features', '')
|
||||
|
||||
function! ale_linters#rust#cargo#GetCargoExecutable(bufnr) abort
|
||||
if ale#path#FindNearestFile(a:bufnr, 'Cargo.toml') isnot# ''
|
||||
|
@ -29,10 +32,27 @@ function! ale_linters#rust#cargo#GetCommand(buffer, version_output) abort
|
|||
\ && ale#Var(a:buffer, 'rust_cargo_check_all_targets')
|
||||
\ && ale#semver#GTE(l:version, [0, 22, 0])
|
||||
|
||||
let l:include_features = ale#Var(a:buffer, 'rust_cargo_include_features')
|
||||
if !empty(l:include_features)
|
||||
let l:include_features = ' --features ' . ale#Escape(l:include_features)
|
||||
endif
|
||||
|
||||
let l:default_feature_behavior = ale#Var(a:buffer, 'rust_cargo_default_feature_behavior')
|
||||
if l:default_feature_behavior is# 'all'
|
||||
let l:include_features = ''
|
||||
let l:default_feature = ' --all-features'
|
||||
elseif l:default_feature_behavior is# 'none'
|
||||
let l:default_feature = ' --no-default-features'
|
||||
else
|
||||
let l:default_feature = ''
|
||||
endif
|
||||
|
||||
return 'cargo '
|
||||
\ . (l:use_check ? 'check' : 'build')
|
||||
\ . (l:use_all_targets ? ' --all-targets' : '')
|
||||
\ . ' --frozen --message-format=json -q'
|
||||
\ . l:default_feature
|
||||
\ . l:include_features
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('rust', {
|
||||
|
|
|
@ -12,11 +12,16 @@ let g:ale_sh_shellcheck_exclusions =
|
|||
let g:ale_sh_shellcheck_executable =
|
||||
\ get(g:, 'ale_sh_shellcheck_executable', 'shellcheck')
|
||||
|
||||
let g:ale_sh_shellcheck_use_global =
|
||||
\ get(g:, 'ale_sh_shellcheck_use_global', 0)
|
||||
|
||||
let g:ale_sh_shellcheck_options =
|
||||
\ get(g:, 'ale_sh_shellcheck_options', '')
|
||||
|
||||
function! ale_linters#sh#shellcheck#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'sh_shellcheck_executable')
|
||||
return ale#node#FindExecutable(a:buffer, 'sh_shellcheck', [
|
||||
\ 'node_modules/.bin/shellcheck',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#sh#shellcheck#GetDialectArgument(buffer) abort
|
||||
|
|
|
@ -2,30 +2,56 @@
|
|||
" Description: This file implements debugging information for ALE
|
||||
|
||||
let s:global_variable_list = [
|
||||
\ 'ale_cache_executable_check_failures',
|
||||
\ 'ale_change_sign_column_color',
|
||||
\ 'ale_command_wrapper',
|
||||
\ 'ale_completion_delay',
|
||||
\ 'ale_completion_enabled',
|
||||
\ 'ale_completion_max_suggestions',
|
||||
\ 'ale_echo_cursor',
|
||||
\ 'ale_echo_msg_error_str',
|
||||
\ 'ale_echo_msg_format',
|
||||
\ 'ale_echo_msg_info_str',
|
||||
\ 'ale_echo_msg_warning_str',
|
||||
\ 'ale_enabled',
|
||||
\ 'ale_fix_on_save',
|
||||
\ 'ale_fixers',
|
||||
\ 'ale_history_enabled',
|
||||
\ 'ale_history_log_output',
|
||||
\ 'ale_keep_list_window_open',
|
||||
\ 'ale_lint_delay',
|
||||
\ 'ale_lint_on_enter',
|
||||
\ 'ale_lint_on_filetype_changed',
|
||||
\ 'ale_lint_on_save',
|
||||
\ 'ale_lint_on_text_changed',
|
||||
\ 'ale_lint_on_insert_leave',
|
||||
\ 'ale_linter_aliases',
|
||||
\ 'ale_linters',
|
||||
\ 'ale_linters_explicit',
|
||||
\ 'ale_list_window_size',
|
||||
\ 'ale_list_vertical',
|
||||
\ 'ale_loclist_msg_format',
|
||||
\ 'ale_max_buffer_history_size',
|
||||
\ 'ale_max_signs',
|
||||
\ 'ale_maximum_file_size',
|
||||
\ 'ale_open_list',
|
||||
\ 'ale_pattern_options',
|
||||
\ 'ale_pattern_options_enabled',
|
||||
\ 'ale_set_balloons',
|
||||
\ 'ale_set_highlights',
|
||||
\ 'ale_set_loclist',
|
||||
\ 'ale_set_quickfix',
|
||||
\ 'ale_set_signs',
|
||||
\ 'ale_sign_column_always',
|
||||
\ 'ale_sign_error',
|
||||
\ 'ale_sign_info',
|
||||
\ 'ale_sign_offset',
|
||||
\ 'ale_sign_style_error',
|
||||
\ 'ale_sign_style_warning',
|
||||
\ 'ale_sign_warning',
|
||||
\ 'ale_statusline_format',
|
||||
\ 'ale_type_map',
|
||||
\ 'ale_warn_about_trailing_blank_lines',
|
||||
\ 'ale_warn_about_trailing_whitespace',
|
||||
\]
|
||||
|
||||
|
|
|
@ -19,6 +19,10 @@ function! ale#definition#Execute(expr) abort
|
|||
execute a:expr
|
||||
endfunction
|
||||
|
||||
function! ale#definition#ClearLSPData() abort
|
||||
let s:go_to_definition_map = {}
|
||||
endfunction
|
||||
|
||||
function! ale#definition#Open(options, filename, line, column) abort
|
||||
if a:options.open_in_tab
|
||||
call ale#definition#Execute('tabedit ' . fnameescape(a:filename))
|
||||
|
|
|
@ -76,6 +76,13 @@ function! ale#engine#InitBufferInfo(buffer) abort
|
|||
return 0
|
||||
endfunction
|
||||
|
||||
" Clear LSP linter data for the linting engine.
|
||||
function! ale#engine#ClearLSPData() abort
|
||||
let s:lsp_linter_map = {}
|
||||
endfunction
|
||||
|
||||
" This function is documented and part of the public API.
|
||||
"
|
||||
" Return 1 if ALE is busy checking a given buffer
|
||||
function! ale#engine#IsCheckingBuffer(buffer) abort
|
||||
let l:info = get(g:ale_buffer_info, a:buffer, {})
|
||||
|
@ -142,36 +149,40 @@ function! s:GatherOutput(job_id, line) abort
|
|||
endif
|
||||
endfunction
|
||||
|
||||
function! s:HandleLoclist(linter_name, buffer, loclist) abort
|
||||
let l:buffer_info = get(g:ale_buffer_info, a:buffer, {})
|
||||
function! ale#engine#HandleLoclist(linter_name, buffer, loclist) abort
|
||||
let l:info = get(g:ale_buffer_info, a:buffer, {})
|
||||
|
||||
if empty(l:buffer_info)
|
||||
if empty(l:info)
|
||||
return
|
||||
endif
|
||||
|
||||
" Remove this linter from the list of active linters.
|
||||
" This may have already been done when the job exits.
|
||||
call filter(l:buffer_info.active_linter_list, 'v:val isnot# a:linter_name')
|
||||
call filter(l:info.active_linter_list, 'v:val isnot# a:linter_name')
|
||||
|
||||
" Make some adjustments to the loclists to fix common problems, and also
|
||||
" to set default values for loclist items.
|
||||
let l:linter_loclist = ale#engine#FixLocList(a:buffer, a:linter_name, a:loclist)
|
||||
|
||||
" Remove previous items for this linter.
|
||||
call filter(g:ale_buffer_info[a:buffer].loclist, 'v:val.linter_name isnot# a:linter_name')
|
||||
" Add the new items.
|
||||
call extend(g:ale_buffer_info[a:buffer].loclist, l:linter_loclist)
|
||||
call filter(l:info.loclist, 'v:val.linter_name isnot# a:linter_name')
|
||||
|
||||
" Sort the loclist again.
|
||||
" We need a sorted list so we can run a binary search against it
|
||||
" for efficient lookup of the messages in the cursor handler.
|
||||
call sort(g:ale_buffer_info[a:buffer].loclist, 'ale#util#LocItemCompare')
|
||||
" We don't need to add items or sort the list when this list is empty.
|
||||
if !empty(l:linter_loclist)
|
||||
" Add the new items.
|
||||
call extend(l:info.loclist, l:linter_loclist)
|
||||
|
||||
" Sort the loclist again.
|
||||
" We need a sorted list so we can run a binary search against it
|
||||
" for efficient lookup of the messages in the cursor handler.
|
||||
call sort(l:info.loclist, 'ale#util#LocItemCompare')
|
||||
endif
|
||||
|
||||
if ale#ShouldDoNothing(a:buffer)
|
||||
return
|
||||
endif
|
||||
|
||||
call ale#engine#SetResults(a:buffer, g:ale_buffer_info[a:buffer].loclist)
|
||||
call ale#engine#SetResults(a:buffer, l:info.loclist)
|
||||
endfunction
|
||||
|
||||
function! s:HandleExit(job_id, exit_code) abort
|
||||
|
@ -217,7 +228,7 @@ function! s:HandleExit(job_id, exit_code) abort
|
|||
|
||||
let l:loclist = ale#util#GetFunction(l:linter.callback)(l:buffer, l:output)
|
||||
|
||||
call s:HandleLoclist(l:linter.name, l:buffer, l:loclist)
|
||||
call ale#engine#HandleLoclist(l:linter.name, l:buffer, l:loclist)
|
||||
endfunction
|
||||
|
||||
function! s:HandleLSPDiagnostics(conn_id, response) abort
|
||||
|
@ -231,7 +242,7 @@ function! s:HandleLSPDiagnostics(conn_id, response) abort
|
|||
|
||||
let l:loclist = ale#lsp#response#ReadDiagnostics(a:response)
|
||||
|
||||
call s:HandleLoclist(l:linter_name, l:buffer, l:loclist)
|
||||
call ale#engine#HandleLoclist(l:linter_name, l:buffer, l:loclist)
|
||||
endfunction
|
||||
|
||||
function! s:HandleTSServerDiagnostics(response, error_type) abort
|
||||
|
@ -256,7 +267,7 @@ function! s:HandleTSServerDiagnostics(response, error_type) abort
|
|||
let l:loclist = get(l:info, 'semantic_loclist', [])
|
||||
\ + get(l:info, 'syntax_loclist', [])
|
||||
|
||||
call s:HandleLoclist('tsserver', l:buffer, l:loclist)
|
||||
call ale#engine#HandleLoclist('tsserver', l:buffer, l:loclist)
|
||||
endfunction
|
||||
|
||||
function! s:HandleLSPErrorMessage(error_message) abort
|
||||
|
@ -315,6 +326,12 @@ function! ale#engine#SetResults(buffer, loclist) abort
|
|||
|
||||
" Reset the save event marker, used for opening windows, etc.
|
||||
call setbufvar(a:buffer, 'ale_save_event_fired', 0)
|
||||
" Set a marker showing how many times a buffer has been checked.
|
||||
call setbufvar(
|
||||
\ a:buffer,
|
||||
\ 'ale_linted',
|
||||
\ getbufvar(a:buffer, 'ale_linted', 0) + 1
|
||||
\)
|
||||
|
||||
" Automatically remove all managed temporary files and directories
|
||||
" now that all jobs have completed.
|
||||
|
@ -512,7 +529,7 @@ function! s:RunJob(options) abort
|
|||
endif
|
||||
endif
|
||||
|
||||
let l:command = ale#job#PrepareCommand(l:command)
|
||||
let l:command = ale#job#PrepareCommand(l:buffer, l:command)
|
||||
let l:job_options = {
|
||||
\ 'mode': 'nl',
|
||||
\ 'exit_cb': function('s:HandleExit'),
|
||||
|
@ -703,6 +720,13 @@ function! s:CheckWithLSP(buffer, linter) abort
|
|||
\ : ale#lsp#message#DidChange(a:buffer)
|
||||
let l:request_id = ale#lsp#Send(l:id, l:change_message, l:root)
|
||||
|
||||
" If this was a file save event, also notify the server of that.
|
||||
if a:linter.lsp isnot# 'tsserver'
|
||||
\&& getbufvar(a:buffer, 'ale_save_event_fired', 0)
|
||||
let l:save_message = ale#lsp#message#DidSave(a:buffer)
|
||||
let l:request_id = ale#lsp#Send(l:id, l:save_message, l:root)
|
||||
endif
|
||||
|
||||
if l:request_id != 0
|
||||
if index(l:info.active_linter_list, a:linter.name) < 0
|
||||
call add(l:info.active_linter_list, a:linter.name)
|
||||
|
|
|
@ -222,7 +222,7 @@ function! s:RunJob(options) abort
|
|||
\)
|
||||
call s:CreateTemporaryFileForJob(l:buffer, l:temporary_file, l:input)
|
||||
|
||||
let l:command = ale#job#PrepareCommand(l:command)
|
||||
let l:command = ale#job#PrepareCommand(l:buffer, l:command)
|
||||
let l:job_options = {
|
||||
\ 'mode': 'nl',
|
||||
\ 'exit_cb': function('s:HandleExit'),
|
||||
|
@ -392,7 +392,13 @@ function! s:GetCallbacks() abort
|
|||
endif
|
||||
endif
|
||||
|
||||
call add(l:corrected_list, ale#util#GetFunction(l:Item))
|
||||
try
|
||||
call add(l:corrected_list, ale#util#GetFunction(l:Item))
|
||||
catch /E475/
|
||||
" Rethrow exceptions for failing to get a function so we can print
|
||||
" a friendly message about it.
|
||||
throw 'BADNAME ' . v:exception
|
||||
endtry
|
||||
endfor
|
||||
|
||||
return l:corrected_list
|
||||
|
@ -427,7 +433,7 @@ function! ale#fix#Fix(...) abort
|
|||
|
||||
try
|
||||
let l:callback_list = s:GetCallbacks()
|
||||
catch /E700/
|
||||
catch /E700\|BADNAME/
|
||||
let l:function_name = join(split(split(v:exception, ':')[3]))
|
||||
let l:echo_message = printf(
|
||||
\ 'There is no fixer named `%s`. Check :ALEFixSuggest',
|
||||
|
|
|
@ -45,7 +45,7 @@ let s:default_registry = {
|
|||
\ },
|
||||
\ 'prettier': {
|
||||
\ 'function': 'ale#fixers#prettier#Fix',
|
||||
\ 'suggested_filetypes': ['javascript', 'typescript', 'json', 'css', 'scss', 'less'],
|
||||
\ 'suggested_filetypes': ['javascript', 'typescript', 'json', 'css', 'scss', 'less', 'markdown', 'graphql', 'vue'],
|
||||
\ 'description': 'Apply prettier to a file.',
|
||||
\ },
|
||||
\ 'prettier_eslint': {
|
||||
|
@ -104,6 +104,11 @@ let s:default_registry = {
|
|||
\ 'suggested_filetypes': ['php'],
|
||||
\ 'description': 'Fix PHP files with phpcbf.',
|
||||
\ },
|
||||
\ 'php_cs_fixer': {
|
||||
\ 'function': 'ale#fixers#php_cs_fixer#Fix',
|
||||
\ 'suggested_filetypes': ['php'],
|
||||
\ 'description': 'Fix PHP files with php-cs-fixer.',
|
||||
\ },
|
||||
\ 'clang-format': {
|
||||
\ 'function': 'ale#fixers#clangformat#Fix',
|
||||
\ 'suggested_filetypes': ['c', 'cpp'],
|
||||
|
@ -159,6 +164,16 @@ let s:default_registry = {
|
|||
\ 'suggested_filetypes': ['java'],
|
||||
\ 'description': 'Fix Java files with google-java-format.',
|
||||
\ },
|
||||
\ 'fixjson': {
|
||||
\ 'function': 'ale#fixers#fixjson#Fix',
|
||||
\ 'suggested_filetypes': ['json'],
|
||||
\ 'description': 'Fix JSON files with fixjson.',
|
||||
\ },
|
||||
\ 'jq': {
|
||||
\ 'function': 'ale#fixers#jq#Fix',
|
||||
\ 'suggested_filetypes': ['json'],
|
||||
\ 'description': 'Fix JSON files with jq.',
|
||||
\ },
|
||||
\}
|
||||
|
||||
" Reset the function registry to the default entries.
|
||||
|
|
27
autoload/ale/fixers/fixjson.vim
Normal file
27
autoload/ale/fixers/fixjson.vim
Normal file
|
@ -0,0 +1,27 @@
|
|||
" Author: rhysd <https://rhysd.github.io>
|
||||
" Description: Integration of fixjson with ALE.
|
||||
|
||||
call ale#Set('json_fixjson_executable', 'fixjson')
|
||||
call ale#Set('json_fixjson_options', '')
|
||||
call ale#Set('json_fixjson_use_global', 0)
|
||||
|
||||
function! ale#fixers#fixjson#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'json_fixjson', [
|
||||
\ 'node_modules/.bin/fixjson',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#fixjson#Fix(buffer) abort
|
||||
let l:executable = ale#Escape(ale#fixers#fixjson#GetExecutable(a:buffer))
|
||||
let l:filename = ale#Escape(bufname(a:buffer))
|
||||
let l:command = l:executable . ' --stdin-filename ' . l:filename
|
||||
|
||||
let l:options = ale#Var(a:buffer, 'json_fixjson_options')
|
||||
if l:options isnot# ''
|
||||
let l:command .= ' ' . l:options
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': l:command
|
||||
\}
|
||||
endfunction
|
|
@ -15,12 +15,8 @@ function! ale#fixers#isort#Fix(buffer) abort
|
|||
return 0
|
||||
endif
|
||||
|
||||
let l:config = ale#path#FindNearestFile(a:buffer, '.isort.cfg')
|
||||
let l:config_options = !empty(l:config)
|
||||
\ ? ' --settings-path ' . ale#Escape(l:config)
|
||||
\ : ''
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . l:config_options . ' -',
|
||||
\ 'command': ale#path#BufferCdString(a:buffer)
|
||||
\ . ale#Escape(l:executable) . ' -',
|
||||
\}
|
||||
endfunction
|
||||
|
|
15
autoload/ale/fixers/jq.vim
Normal file
15
autoload/ale/fixers/jq.vim
Normal file
|
@ -0,0 +1,15 @@
|
|||
call ale#Set('json_jq_executable', 'jq')
|
||||
call ale#Set('json_jq_options', '')
|
||||
|
||||
function! ale#fixers#jq#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'json_jq_executable')
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#jq#Fix(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'json_jq_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(ale#fixers#jq#GetExecutable(a:buffer))
|
||||
\ . ' . ' . l:options,
|
||||
\}
|
||||
endfunction
|
23
autoload/ale/fixers/php_cs_fixer.vim
Normal file
23
autoload/ale/fixers/php_cs_fixer.vim
Normal file
|
@ -0,0 +1,23 @@
|
|||
" Author: Julien Deniau <julien.deniau@gmail.com>
|
||||
" Description: Fixing files with php-cs-fixer.
|
||||
|
||||
call ale#Set('php_cs_fixer_executable', 'php-cs-fixer')
|
||||
call ale#Set('php_cs_fixer_use_global', 0)
|
||||
|
||||
function! ale#fixers#php_cs_fixer#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'php_cs_fixer', [
|
||||
\ 'vendor/bin/php-cs-fixer',
|
||||
\ 'php-cs-fixer'
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#php_cs_fixer#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#php_cs_fixer#GetExecutable(a:buffer)
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' fix %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
|
||||
|
|
@ -10,8 +10,6 @@ function! ale#fixers#rustfmt#Fix(buffer) abort
|
|||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
|
|
|
@ -24,7 +24,7 @@ function! ale#handlers#gcc#HandleGCCFormat(buffer, lines) abort
|
|||
" <stdin>:8:5: warning: conversion lacks type at end of format [-Wformat=]
|
||||
" <stdin>:10:27: error: invalid operands to binary - (have ‘int’ and ‘char *’)
|
||||
" -:189:7: note: $/${} is unnecessary on arithmetic variables. [SC2004]
|
||||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+)?:? ([^:]+): (.+)$'
|
||||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+)?:? ([^:]+): ?(.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
|
|
34
autoload/ale/handlers/pony.vim
Normal file
34
autoload/ale/handlers/pony.vim
Normal file
|
@ -0,0 +1,34 @@
|
|||
scriptencoding utf-8
|
||||
" Description: This file defines a handler function which ought to work for
|
||||
" any program which outputs errors in the format that ponyc uses.
|
||||
|
||||
function! s:RemoveUnicodeQuotes(text) abort
|
||||
let l:text = a:text
|
||||
let l:text = substitute(l:text, '[`´‘’]', '''', 'g')
|
||||
let l:text = substitute(l:text, '\v\\u2018([^\\]+)\\u2019', '''\1''', 'g')
|
||||
let l:text = substitute(l:text, '[“”]', '"', 'g')
|
||||
|
||||
return l:text
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#pony#HandlePonycFormat(buffer, lines) abort
|
||||
" Look for lines like the following.
|
||||
" /home/code/pony/classes/Wombat.pony:22:30: can't lookup private fields from outside the type
|
||||
|
||||
let l:pattern = '\v^([^:]+):(\d+):(\d+)?:? (.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:item = {
|
||||
\ 'filename': l:match[1],
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'col': str2nr(l:match[3]),
|
||||
\ 'type': 'E',
|
||||
\ 'text': s:RemoveUnicodeQuotes(l:match[4]),
|
||||
\}
|
||||
|
||||
call add(l:output, l:item)
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
|
@ -51,8 +51,8 @@ function! ale#handlers#rust#HandleRustErrors(buffer, lines) abort
|
|||
call add(l:output, {
|
||||
\ 'lnum': l:span.line_start,
|
||||
\ 'end_lnum': l:span.line_end,
|
||||
\ 'col': l:span.byte_start,
|
||||
\ 'end_col': l:span.byte_end,
|
||||
\ 'col': l:span.column_start,
|
||||
\ 'end_col': l:span.column_end,
|
||||
\ 'text': empty(l:span.label) ? l:error.message : printf('%s: %s', l:error.message, l:span.label),
|
||||
\ 'type': toupper(l:error.level[0]),
|
||||
\})
|
||||
|
|
|
@ -36,7 +36,7 @@ function! ale#job#JoinNeovimOutput(job, last_line, data, mode, callback) abort
|
|||
let l:lines[0] = a:last_line . l:lines[0]
|
||||
let l:new_last_line = a:data[-1]
|
||||
else
|
||||
let l:new_last_line = a:last_line . a:data[0]
|
||||
let l:new_last_line = a:last_line . get(a:data, 0, '')
|
||||
endif
|
||||
|
||||
for l:line in l:lines
|
||||
|
@ -165,23 +165,54 @@ function! ale#job#ValidateArguments(command, options) abort
|
|||
endif
|
||||
endfunction
|
||||
|
||||
function! ale#job#PrepareCommand(command) abort
|
||||
function! s:PrepareWrappedCommand(original_wrapper, command) abort
|
||||
let l:match = matchlist(a:command, '\v^(.*(\&\&|;)) *(.*)$')
|
||||
let l:prefix = ''
|
||||
let l:command = a:command
|
||||
|
||||
if !empty(l:match)
|
||||
let l:prefix = l:match[1] . ' '
|
||||
let l:command = l:match[3]
|
||||
endif
|
||||
|
||||
let l:format = a:original_wrapper
|
||||
|
||||
if l:format =~# '%@'
|
||||
let l:wrapped = substitute(l:format, '%@', ale#Escape(l:command), '')
|
||||
else
|
||||
if l:format !~# '%\*'
|
||||
let l:format .= ' %*'
|
||||
endif
|
||||
|
||||
let l:wrapped = substitute(l:format, '%\*', l:command, '')
|
||||
endif
|
||||
|
||||
return l:prefix . l:wrapped
|
||||
endfunction
|
||||
|
||||
function! ale#job#PrepareCommand(buffer, command) abort
|
||||
let l:wrapper = ale#Var(a:buffer, 'command_wrapper')
|
||||
|
||||
let l:command = !empty(l:wrapper)
|
||||
\ ? s:PrepareWrappedCommand(l:wrapper, a:command)
|
||||
\ : a:command
|
||||
|
||||
" The command will be executed in a subshell. This fixes a number of
|
||||
" issues, including reading the PATH variables correctly, %PATHEXT%
|
||||
" expansion on Windows, etc.
|
||||
"
|
||||
" NeoVim handles this issue automatically if the command is a String,
|
||||
" but we'll do this explicitly, so we use thes same exact command for both
|
||||
" but we'll do this explicitly, so we use the same exact command for both
|
||||
" versions.
|
||||
if ale#Has('win32')
|
||||
return 'cmd /c ' . a:command
|
||||
if has('win32')
|
||||
return 'cmd /s/c "' . l:command . '"'
|
||||
endif
|
||||
|
||||
if &shell =~? 'fish$'
|
||||
return ['/bin/sh', '-c', a:command]
|
||||
return ['/bin/sh', '-c', l:command]
|
||||
endif
|
||||
|
||||
return split(&shell) + split(&shellcmdflag) + [a:command]
|
||||
return split(&shell) + split(&shellcmdflag) + [l:command]
|
||||
endfunction
|
||||
|
||||
" Start a job with options which are agnostic to Vim and NeoVim.
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
call ale#Set('wrap_command_as_one_argument', 0)
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: Linter registration and lazy-loading
|
||||
" Retrieves linters as requested by the engine, loading them if needed.
|
||||
|
@ -432,6 +433,7 @@ function! ale#linter#StartLSP(buffer, linter, callback) abort
|
|||
endif
|
||||
|
||||
let l:command = ale#job#PrepareCommand(
|
||||
\ a:buffer,
|
||||
\ ale#linter#GetCommand(a:buffer, a:linter),
|
||||
\)
|
||||
let l:conn_id = ale#lsp#StartProgram(
|
||||
|
|
|
@ -97,12 +97,17 @@ function! s:SetListsImpl(timer_id, buffer, loclist) abort
|
|||
let l:reset_visual_selection = l:mode is? 'v' || l:mode is# "\<c-v>"
|
||||
let l:reset_character_selection = l:mode is? 's' || l:mode is# "\<c-s>"
|
||||
|
||||
" open windows vertically instead of default horizontally
|
||||
let l:open_type = ''
|
||||
if ale#Var(a:buffer, 'list_vertical') == 1
|
||||
let l:open_type = 'vert '
|
||||
endif
|
||||
if g:ale_set_quickfix
|
||||
if !ale#list#IsQuickfixOpen()
|
||||
silent! execute 'copen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
|
||||
silent! execute l:open_type . 'copen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
|
||||
endif
|
||||
elseif g:ale_set_loclist
|
||||
silent! execute 'lopen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
|
||||
silent! execute l:open_type . 'lopen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
|
||||
endif
|
||||
|
||||
" If focus changed, restore it (jump to the last window).
|
||||
|
|
|
@ -325,6 +325,20 @@ function! ale#lsp#ConnectToAddress(address, project_root, callback) abort
|
|||
return 1
|
||||
endfunction
|
||||
|
||||
" Stop all LSP connections, closing all jobs and channels, and removing any
|
||||
" queued messages.
|
||||
function! ale#lsp#StopAll() abort
|
||||
for l:conn in s:connections
|
||||
if has_key(l:conn, 'channel')
|
||||
call ch_close(l:conn.channel)
|
||||
else
|
||||
call ale#job#Stop(l:conn.id)
|
||||
endif
|
||||
endfor
|
||||
|
||||
let s:connections = []
|
||||
endfunction
|
||||
|
||||
function! s:SendMessageData(conn, data) abort
|
||||
if has_key(a:conn, 'executable')
|
||||
call ale#job#SendRaw(a:conn.id, a:data)
|
||||
|
|
25
autoload/ale/lsp/reset.vim
Normal file
25
autoload/ale/lsp/reset.vim
Normal file
|
@ -0,0 +1,25 @@
|
|||
" Stop all LSPs and remove all of the data for them.
|
||||
function! ale#lsp#reset#StopAllLSPs() abort
|
||||
call ale#lsp#StopAll()
|
||||
|
||||
if exists('*ale#definition#ClearLSPData')
|
||||
" Clear the mapping for connections, etc.
|
||||
call ale#definition#ClearLSPData()
|
||||
endif
|
||||
|
||||
if exists('*ale#engine#ClearLSPData')
|
||||
" Clear the mapping for connections, etc.
|
||||
call ale#engine#ClearLSPData()
|
||||
|
||||
" Remove the problems for all of the LSP linters in every buffer.
|
||||
for l:buffer_string in keys(g:ale_buffer_info)
|
||||
let l:buffer = str2nr(l:buffer_string)
|
||||
|
||||
for l:linter in ale#linter#Get(getbufvar(l:buffer, '&filetype'))
|
||||
if !empty(l:linter.lsp)
|
||||
call ale#engine#HandleLoclist(l:linter.name, l:buffer, [])
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
endif
|
||||
endfunction
|
|
@ -59,6 +59,14 @@ function! ale#lsp#response#ReadTSServerDiagnostics(response) abort
|
|||
let l:loclist_item.nr = l:diagnostic.code
|
||||
endif
|
||||
|
||||
if get(l:diagnostic, 'category') is# 'warning'
|
||||
let l:loclist_item.type = 'W'
|
||||
endif
|
||||
|
||||
if get(l:diagnostic, 'category') is# 'suggestion'
|
||||
let l:loclist_item.type = 'I'
|
||||
endif
|
||||
|
||||
call add(l:loclist, l:loclist_item)
|
||||
endfor
|
||||
|
||||
|
|
|
@ -95,6 +95,11 @@ endfunction
|
|||
" This function is deprecated, and should not be used. Use the airline plugin
|
||||
" instead, or write your own status function with ale#statusline#Count()
|
||||
function! ale#statusline#Status() abort
|
||||
if !get(g:, 'ale_deprecation_ale_statusline_status', 0)
|
||||
execute 'echom ''ale#statusline#Status() is deprecated, use ale#statusline#Count() to write your own function.'''
|
||||
let g:ale_deprecation_ale_statusline_status = 1
|
||||
endif
|
||||
|
||||
if !exists('g:ale_statusline_format')
|
||||
return 'OK'
|
||||
endif
|
||||
|
|
|
@ -236,6 +236,13 @@ function! ale#util#EscapePCRE(unsafe_string) abort
|
|||
return substitute(a:unsafe_string, '\([\-\[\]{}()*+?.^$|]\)', '\\\1', 'g')
|
||||
endfunction
|
||||
|
||||
" Escape a string so that it can be used as a literal string inside an evaled
|
||||
" vim command.
|
||||
function! ale#util#EscapeVim(unsafe_string) abort
|
||||
return "'" . substitute(a:unsafe_string, "'", "''", 'g') . "'"
|
||||
endfunction
|
||||
|
||||
|
||||
" Given a String or a List of String values, try and decode the string(s)
|
||||
" as a JSON value which can be decoded with json_decode. If the JSON string
|
||||
" is invalid, the default argument value will be returned instead.
|
||||
|
|
|
@ -143,6 +143,33 @@ g:ale_c_cppcheck_options *g:ale_c_cppcheck_options*
|
|||
This variable can be changed to modify flags given to cppcheck.
|
||||
|
||||
|
||||
===============================================================================
|
||||
flawfinder *ale-c-flawfinder*
|
||||
|
||||
g:ale_c_flawfinder_executable *g:ale_c_flawfinder_executable*
|
||||
*b:ale_c_flawfinder_executable*
|
||||
Type: |String|
|
||||
Default: `'flawfinder'`
|
||||
|
||||
This variable can be changed to use a different executable for flawfinder.
|
||||
|
||||
|
||||
g:ale_c_flawfinder_minlevel *g:ale_c_flawfinder_minlevel*
|
||||
*b:ale_c_flawfinder_minlevel*
|
||||
Type: |Number|
|
||||
Default: `1`
|
||||
|
||||
This variable can be changed to ignore risks under the given risk threshold.
|
||||
|
||||
|
||||
g:ale_c_flawfinder_options *g:ale-c-flawfinder*
|
||||
*b:ale-c-flawfinder*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be used to pass extra options into the flawfinder command.
|
||||
|
||||
|
||||
===============================================================================
|
||||
gcc *ale-c-gcc*
|
||||
|
||||
|
|
|
@ -153,6 +153,33 @@ g:ale_cpp_cpplint_options *g:ale_cpp_cpplint_options*
|
|||
This variable can be changed to modify flags given to cpplint.
|
||||
|
||||
|
||||
===============================================================================
|
||||
flawfinder *ale-cpp-flawfinder*
|
||||
|
||||
g:ale_cpp_flawfinder_executable *g:ale_cpp_flawfinder_executable*
|
||||
*b:ale_cpp_flawfinder_executable*
|
||||
Type: |String|
|
||||
Default: `'flawfinder'`
|
||||
|
||||
This variable can be changed to use a different executable for flawfinder.
|
||||
|
||||
|
||||
g:ale_cpp_flawfinder_minlevel *g:ale_cpp_flawfinder_minlevel*
|
||||
*b:ale_cpp_flawfinder_minlevel*
|
||||
Type: |Number|
|
||||
Default: `1`
|
||||
|
||||
This variable can be changed to ignore risks under the given risk threshold.
|
||||
|
||||
|
||||
g:ale_cpp_flawfinder_options *g:ale-cpp-flawfinder*
|
||||
*b:ale-cpp-flawfinder*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be used to pass extra options into the flawfinder command.
|
||||
|
||||
|
||||
===============================================================================
|
||||
gcc *ale-cpp-gcc*
|
||||
|
||||
|
|
|
@ -92,8 +92,9 @@ g:ale_cs_mcsc_assemblies *g:ale_cs_mcsc_assemblies*
|
|||
For example: >
|
||||
|
||||
" Compile C# programs with the Unity engine DLL file on Mac.
|
||||
let g:ale_cs_mcss_assemblies = [
|
||||
let g:ale_cs_mcsc_assemblies = [
|
||||
\ '/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll',
|
||||
\ 'path-to-unityproject/obj/Debug',
|
||||
\]
|
||||
<
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ ALE Dockerfile Integration *ale-dockerfile-options*
|
|||
===============================================================================
|
||||
hadolint *ale-dockerfile-hadolint*
|
||||
|
||||
hadolint can be found at: https://github.com/lukasmartinelli/hadolint
|
||||
hadolint can be found at: https://github.com/hadolint/hadolint
|
||||
|
||||
|
||||
g:ale_dockerfile_hadolint_use_docker *g:ale_dockerfile_hadolint_use_docker*
|
||||
|
@ -25,12 +25,12 @@ g:ale_dockerfile_hadolint_use_docker *g:ale_dockerfile_hadolint_use_docker*
|
|||
g:ale_dockerfile_hadolint_image *g:ale_dockerfile_hadolint_image*
|
||||
*b:ale_dockerfile_hadolint_image*
|
||||
Type: |String|
|
||||
Default: `'lukasmartinelli/hadolint'`
|
||||
Default: `'hadolint/hadolint'`
|
||||
|
||||
This variable controls the docker image used to run hadolint. The default
|
||||
is hadolint's author's build, and can be found at:
|
||||
|
||||
https://hub.docker.com/r/lukasmartinelli/hadolint/
|
||||
https://hub.docker.com/r/hadolint/hadolint/
|
||||
|
||||
|
||||
===============================================================================
|
||||
|
|
|
@ -13,5 +13,20 @@ g:ale_elixir_mix_options *g:ale_elixir_mix_options*
|
|||
|
||||
This variable can be changed to specify the mix executable.
|
||||
|
||||
===============================================================================
|
||||
dialyxir *ale-elixir-dialyxir*
|
||||
|
||||
Dialyzer, a DIscrepancy AnaLYZer for ERlang programs.
|
||||
http://erlang.org/doc/man/dialyzer.html
|
||||
|
||||
It can be used with elixir through dialyxir
|
||||
https://github.com/jeremyjh/dialyxir
|
||||
|
||||
Options for dialyzer are not configurable by ale, but they are instead
|
||||
configured on your project's `mix.exs`.
|
||||
|
||||
See https://github.com/jeremyjh/dialyxir#with-explaining-stuff for more
|
||||
information.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
===============================================================================
|
||||
ALE Eruby Integration *ale-eruby-options*
|
||||
|
||||
There are two linters for `eruby` files:
|
||||
There are three linters for `eruby` files:
|
||||
|
||||
- `erb`
|
||||
- `erubis`
|
||||
- `erubi`
|
||||
|
||||
If you don't know which one your project uses, it's probably `erb`.
|
||||
To selectively enable one or the other, see |g:ale_linters|.
|
||||
|
||||
(Note that ALE already disables linters if the executable for that linter is
|
||||
not found; thus, there's probably no need to disable one of these if you're
|
||||
using the other one.)
|
||||
`erb` is in the Ruby standard library and is mostly universal. `erubis` is the
|
||||
default parser in Rails between 3.0 and 5.1. `erubi` is the default in Rails
|
||||
5.1 and later. To selectively enable a subset, see |g:ale_linters|.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
|
14
doc/ale-fish.txt
Normal file
14
doc/ale-fish.txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
===============================================================================
|
||||
ALE Fish Integration *ale-fish-options*
|
||||
|
||||
Lints fish files using `fish -n`.
|
||||
|
||||
Note that `fish -n` is not foolproof: it sometimes gives false positives or
|
||||
errors that are difficult to parse without more context. This integration skips
|
||||
displaying errors if an error message is not found.
|
||||
|
||||
If ALE is not showing any errors but your file does not run as expected, run
|
||||
`fish -n <file.fish>` from the command line.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
6
doc/ale-fountain.txt
Normal file
6
doc/ale-fountain.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
===============================================================================
|
||||
ALE Fountain Integration *ale-fountain-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
42
doc/ale-gitcommit.txt
Normal file
42
doc/ale-gitcommit.txt
Normal file
|
@ -0,0 +1,42 @@
|
|||
===============================================================================
|
||||
ALE Git Commit Integration *ale-gitcommit-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
gitlint *ale-gitcommit-gitlint*
|
||||
|
||||
g:ale_gitcommit_gitlint_executable *g:ale_gitcommit_gitlint_executable*
|
||||
*b:ale_gitcommit_gitlint_executable*
|
||||
Type: |String|
|
||||
Default: `'gitlint'`
|
||||
|
||||
This variable can be changed to modify the executable used for gitlint.
|
||||
|
||||
|
||||
g:ale_gitcommit_gitlint_options *g:ale_gitcommit_gitlint_options*
|
||||
*b:ale_gitcommit_gitlint_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be changed to add command-line arguments to the gitlint
|
||||
invocation.
|
||||
|
||||
For example, to dinamically set the gitlint configuration file path, you
|
||||
may want to set >
|
||||
|
||||
let g:ale_gitcommit_gitlint_options = '-C /home/user/.config/gitlint.ini'
|
||||
<
|
||||
|
||||
g:ale_gitcommit_gitlint_use_global *g:ale_gitcommit_gitlint_use_global*
|
||||
*b:ale_gitcommit_gitlint_use_global*
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
This variable controls whether or not ALE will search for gitlint in a
|
||||
virtualenv directory first. If this variable is set to `1`, then ALE will
|
||||
always use |g:ale_gitcommit_gitlint_executable| for the executable path.
|
||||
|
||||
Both variables can be set with `b:` buffer variables instead.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
|
@ -20,6 +20,19 @@ the benefit of running a number of linters, more than ALE would by default,
|
|||
while ensuring it doesn't run any linters known to be slow or resource
|
||||
intensive.
|
||||
|
||||
|
||||
===============================================================================
|
||||
gobuild *ale-go-gobuild*
|
||||
|
||||
g:ale_go_gobuild_options *g:ale_go_gobuild_options*
|
||||
*b:ale_go_gobuild_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be set to pass additional options to the gobuild linter.
|
||||
They are injected directly after "go test".
|
||||
|
||||
|
||||
===============================================================================
|
||||
gofmt *ale-go-gofmt*
|
||||
|
||||
|
@ -30,6 +43,7 @@ g:ale_go_gofmt_options *g:ale_go_gofmt_options*
|
|||
|
||||
This variable can be set to pass additional options to the gofmt fixer.
|
||||
|
||||
|
||||
===============================================================================
|
||||
gometalinter *ale-go-gometalinter*
|
||||
|
||||
|
@ -59,5 +73,35 @@ g:ale_go_gometalinter_options *g:ale_go_gometalinter_options*
|
|||
number of linters known to be slow or consume a lot of resources.
|
||||
|
||||
|
||||
g:ale_go_gometalinter_package *g:ale_go_gometalinter_package*
|
||||
*b:ale_go_gometalinter_package*
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
When set to `1`, the whole Go package will be checked instead of only the
|
||||
current file.
|
||||
|
||||
|
||||
===============================================================================
|
||||
staticcheck *ale-go-staticcheck*
|
||||
|
||||
g:ale_go_staticcheck_options *g:ale_go_staticcheck_options*
|
||||
*b:ale_go_staticcheck_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be set to pass additional options to the staticcheck
|
||||
linter.
|
||||
|
||||
|
||||
g:ale_go_staticcheck_package *g:ale_go_staticcheck_package*
|
||||
*b:ale_go_staticcheck_package*
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
When set to `1`, the whole Go package will be checked instead of only the
|
||||
current file.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
|
|
@ -13,5 +13,10 @@ You will need the GraphQL ESLint plugin installed for this to work.
|
|||
===============================================================================
|
||||
gqlint *ale-graphql-gqlint*
|
||||
|
||||
===============================================================================
|
||||
prettier *ale-graphql-prettier*
|
||||
|
||||
See |ale-javascript-prettier| for information about the available options.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
|
|
@ -12,6 +12,16 @@ g:ale_haskell_brittany_executable *g:ale_haskell_brittany_executable*
|
|||
|
||||
This variable can be changed to use a different executable for brittany.
|
||||
|
||||
===============================================================================
|
||||
ghc *ale-haskell-ghc*
|
||||
|
||||
g:ale_haskell_ghc_options *g:ale_haskell_ghc_options*
|
||||
*b:ale_haskell_ghc_options*
|
||||
Type: |String|
|
||||
Default: `'-fno-code -v0'`
|
||||
|
||||
This variable can be changed to modify flags given to ghc.
|
||||
|
||||
===============================================================================
|
||||
hdevtools *ale-haskell-hdevtools*
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ g:ale_html_htmlhint_executable *g:ale_html_htmlhint_executable*
|
|||
g:ale_html_htmlhint_options *g:ale_html_htmlhint_options*
|
||||
*b:ale_html_htmlhint_options*
|
||||
Type: |String|
|
||||
Default: `'--format=unix'`
|
||||
Default: `''`
|
||||
|
||||
This variable can be changed to modify flags given to HTMLHint.
|
||||
|
||||
|
@ -32,6 +32,21 @@ g:ale_html_htmlhint_use_global *g:ale_html_htmlhint_use_global*
|
|||
===============================================================================
|
||||
tidy *ale-html-tidy*
|
||||
|
||||
`tidy` is a console application which corrects and cleans up HTML and XML
|
||||
documents by fixing markup errors and upgrading legacy code to modern
|
||||
standards.
|
||||
|
||||
Note:
|
||||
`/usr/bin/tidy` on macOS (installed by default) is too old. It was released
|
||||
on 31 Oct 2006. It does not consider modern HTML specs (HTML5) and shows
|
||||
outdated warnings. So |ale| ignores `/usr/bin/tidy` on macOS.
|
||||
|
||||
To use `tidy` on macOS, please install the latest version with Homebrew:
|
||||
>
|
||||
$ brew install tidy-html5
|
||||
<
|
||||
`/usr/local/bin/tidy` is installed.
|
||||
|
||||
g:ale_html_tidy_executable *g:ale_html_tidy_executable*
|
||||
*b:ale_html_tidy_executable*
|
||||
Type: |String|
|
||||
|
|
|
@ -2,12 +2,78 @@
|
|||
ALE JSON Integration *ale-json-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
fixjson *ale-json-fixjson*
|
||||
|
||||
fixjson is a JSON file fixer/formatter for humans using (relaxed) JSON5.
|
||||
It provides:
|
||||
|
||||
- Pretty-prints JSON input
|
||||
- Fixes various failures while humans writing JSON
|
||||
- Fixes trailing commas objects or arrays
|
||||
- Fixes missing commas for elements of objects or arrays
|
||||
- Adds quotes to keys in objects
|
||||
- Newlines in strings
|
||||
- Hex numbers
|
||||
- Fixes single quotes to double quotes
|
||||
|
||||
You can install it using npm:
|
||||
>
|
||||
$ npm install -g fixjson
|
||||
<
|
||||
ALE provides fixjson integration as a fixer. See |ale-fix|.
|
||||
|
||||
g:ale_json_fixjson_executable *g:ale_json_fixjson_executable*
|
||||
*b:ale_json_fixjson_executable*
|
||||
|
||||
Type: |String|
|
||||
Default: `'fixjson'`
|
||||
|
||||
The executable that will be run for fixjson.
|
||||
|
||||
g:ale_json_fixjson_options *g:ale_json_fixjson_options*
|
||||
*b:ale_json_fixjson_options*
|
||||
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can add extra options to the command executed for running
|
||||
fixjson.
|
||||
|
||||
g:ale_json_fixjson_use_global *g:ale_json_fixjson_use_global*
|
||||
*b:ale_json_fixjson_use_global*
|
||||
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
|
||||
===============================================================================
|
||||
jsonlint *ale-json-jsonlint*
|
||||
|
||||
There are no options available.
|
||||
|
||||
|
||||
===============================================================================
|
||||
jq *ale-json-jq*
|
||||
|
||||
g:ale_json_jq_executable *g:ale_json_jq_executable*
|
||||
*b:ale_json_jq_executable*
|
||||
Type: |String|
|
||||
Default: `'jq'`
|
||||
|
||||
This option can be changed to change the path for `jq`.
|
||||
|
||||
|
||||
g:ale_json_jq_options *g:ale_json_jq_options*
|
||||
*b:ale_json_jq_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This option can be changed to pass extra options to `jq`.
|
||||
|
||||
|
||||
===============================================================================
|
||||
prettier *ale-json-prettier*
|
||||
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
===============================================================================
|
||||
ALE Lua Integration *ale-lua-options*
|
||||
|
||||
===============================================================================
|
||||
luac *ale-lua-luac*
|
||||
|
||||
g:ale_lua_luac_executable *g:ale_lua_luac_executable*
|
||||
*b:ale_lua_luac_executable*
|
||||
Type: |String|
|
||||
Default: `'luac'`
|
||||
|
||||
This variable can be changed to change the path to luac.
|
||||
|
||||
===============================================================================
|
||||
luacheck *ale-lua-luacheck*
|
||||
|
|
|
@ -2,6 +2,31 @@
|
|||
ALE Markdown Integration *ale-markdown-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
mdl *ale-markdown-mdl*
|
||||
|
||||
g:ale_markdown_mdl_executable *g:ale_markdown_mdl_executable*
|
||||
*b:ale_markdown_mdl_executable*
|
||||
Type: |String|
|
||||
Default: `'mdl'`
|
||||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
|
||||
g:ale_markdown_mdl_options *g:ale_markdown_mdl_options*
|
||||
*b:ale_markdown_mdl_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be set to pass additional options to mdl.
|
||||
|
||||
|
||||
===============================================================================
|
||||
prettier *ale-markdown-prettier*
|
||||
|
||||
See |ale-javascript-prettier| for information about the available options.
|
||||
|
||||
|
||||
===============================================================================
|
||||
write-good *ale-markdown-write-good*
|
||||
|
||||
|
|
|
@ -3,6 +3,9 @@ ALE Perl Integration *ale-perl-options*
|
|||
|
||||
ALE offers a few ways to check Perl code. Checking code with `perl` is
|
||||
disabled by default, as `perl` code cannot be checked without executing it.
|
||||
Specifically, we use the `-c` flag to see if `perl` code compiles. This does
|
||||
not execute all of the code in a file, but it does run `BEGIN` and `CHECK`
|
||||
blocks. See `perl --help` and https://stackoverflow.com/a/12908487/406224
|
||||
|
||||
See |g:ale_linters|.
|
||||
|
||||
|
|
|
@ -166,5 +166,22 @@ g:ale_php_phpstan_configuration *g:ale_php_phpstan_configuration*
|
|||
This variable sets path to phpstan configuration file.
|
||||
|
||||
|
||||
===============================================================================
|
||||
php-cs-fixer *ale-php-php-cs-fixer*
|
||||
|
||||
g:ale_php_cs_fixer_executable *g:ale_php_cs_fixer_executable*
|
||||
*b:ale_php_cs_fixer_executable*
|
||||
Type: |String|
|
||||
Default: `'php-cs-fixer'`
|
||||
|
||||
This variable sets executable used for php-cs-fixer.
|
||||
|
||||
g:ale_php_cs_fixer_use_global *g:ale_php_cs_fixer_use_global*
|
||||
*b:ale_php_cs_fixer_use_global*
|
||||
Type: |Boolean|
|
||||
Default: `0`
|
||||
|
||||
This variable force globally installed fixer.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
|
12
doc/ale-po.txt
Normal file
12
doc/ale-po.txt
Normal file
|
@ -0,0 +1,12 @@
|
|||
===============================================================================
|
||||
ALE PO Integration *ale-po-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
write-good *ale-po-write-good*
|
||||
|
||||
See |ale-write-good-options|
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
25
doc/ale-pony.txt
Normal file
25
doc/ale-pony.txt
Normal file
|
@ -0,0 +1,25 @@
|
|||
===============================================================================
|
||||
ALE Pony Integration *ale-pony-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
ponyc *ale-pony-ponyc*
|
||||
|
||||
g:ale_pony_ponyc_executable *g:ale_pony_ponyc_executable*
|
||||
*b:ale_pony_ponyc_executable*
|
||||
Type: |String|
|
||||
Default: `'ponyc'`
|
||||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
|
||||
g:ale_pony_ponyc_options *g:ale_pony_ponyc_options*
|
||||
*b:ale_pony_ponyc_options*
|
||||
Type: |String|
|
||||
Default: `'--pass paint'`
|
||||
|
||||
This variable can be set to pass options to ponyc.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
|
@ -20,5 +20,14 @@ protoc-gen-lint *ale-proto-protoc-gen-lint*
|
|||
The linter is a plugin for the `protoc` binary. As long as the binary resides
|
||||
in the system path, `protoc` will find it.
|
||||
|
||||
g:ale_proto_protoc_gen_lint_options *g:ale_proto_protoc_gen_lint_options*
|
||||
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be changed to modify flags given to protoc. Note that the
|
||||
directory of the linted file is always passed as an include path with '-I'
|
||||
before any user-supplied options.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
|
|
@ -104,6 +104,16 @@ g:ale_python_mypy_executable *g:ale_python_mypy_executable*
|
|||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
g:ale_python_mypy_ignore_invalid_syntax
|
||||
*g:ale_python_mypy_ignore_invalid_syntax*
|
||||
*b:ale_python_mypy_ignore_invalid_syntax*
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
When set to `1`, syntax error messages for mypy will be ignored. This option
|
||||
can be used when running other Python linters which check for syntax errors,
|
||||
as mypy can take a while to finish executing.
|
||||
|
||||
|
||||
g:ale_python_mypy_options *g:ale_python_mypy_options*
|
||||
*b:ale_python_mypy_options*
|
||||
|
@ -125,16 +135,16 @@ g:ale_python_mypy_use_global *g:ale_python_mypy_use_global*
|
|||
===============================================================================
|
||||
prospector *ale-python-prospector*
|
||||
|
||||
g:ale_python_prospector_executable *g:ale_python_prospector_executable*
|
||||
*b:ale_python_prospector_executable*
|
||||
g:ale_python_prospector_executable *g:ale_python_prospector_executable*
|
||||
*b:ale_python_prospector_executable*
|
||||
Type: |String|
|
||||
Default: `'prospector'`
|
||||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
|
||||
g:ale_python_prospector_options *g:ale_python_prospector_options*
|
||||
*b:ale_python_prospector_options*
|
||||
g:ale_python_prospector_options *g:ale_python_prospector_options*
|
||||
*b:ale_python_prospector_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
|
@ -154,8 +164,8 @@ g:ale_python_prospector_options *g:ale_python_prospector_option
|
|||
`python3 -m pip install --user prospector`).
|
||||
|
||||
|
||||
g:ale_python_prospector_use_global *g:ale_python_prospector_use_global*
|
||||
*b:ale_python_prospector_use_global*
|
||||
g:ale_python_prospector_use_global *g:ale_python_prospector_use_global*
|
||||
*b:ale_python_prospector_use_global*
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
|
|
|
@ -16,5 +16,14 @@ g:ale_r_lintr_options *g:ale_r_lintr_options*
|
|||
options. Consult the lintr documentation for more information.
|
||||
|
||||
|
||||
g:ale_r_lintr_lint_package *g:ale_r_lintr_lint_package*
|
||||
*b:ale_r_lintr_lint_package*
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
When set to `1`, the file will be checked with `lintr::lint_package` instead
|
||||
of `lintr::lint`. This prevents erroneous namespace warnings when linting
|
||||
package files.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
|
|
@ -59,6 +59,36 @@ g:ale_rust_cargo_check_all_targets *g:ale_rust_cargo_check_all_targets*
|
|||
is used. See |g:ale_rust_cargo_use_check|,
|
||||
|
||||
|
||||
g:ale_rust_cargo_default_feature_behavior
|
||||
*g:ale_rust_cargo_default_feature_behavior*
|
||||
*b:ale_rust_cargo_default_feature_behavior*
|
||||
Type: |String|
|
||||
Default: `default`
|
||||
|
||||
When set to `none`, ALE will set the `--no-default-features` option when
|
||||
invoking `cargo`. Only the features specified in
|
||||
|g:ale_rust_cargo_include_features| will be included when performing the
|
||||
lint check.
|
||||
|
||||
When set to `default`, ALE will instruct `cargo` to build all default
|
||||
features specified in the project's `Cargo.toml` file, in addition to
|
||||
including any additional features defined in
|
||||
|g:ale_rust_cargo_include_features|.
|
||||
|
||||
When set to `all`, ALE will set the `--all-features` option when
|
||||
invoking `cargo`, which will include all features defined in the project's
|
||||
`Cargo.toml` file when performing the lint check.
|
||||
|
||||
|
||||
g:ale_rust_cargo_include_features *g:ale_rust_cargo_include_features*
|
||||
*b:ale_rust_cargo_include_features*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
When defined, ALE will set the `--features` option when invoking `cargo` to
|
||||
perform the lint check. See |g:ale_rust_cargo_default_feature_behavior|.
|
||||
|
||||
|
||||
===============================================================================
|
||||
rls *ale-rust-rls*
|
||||
|
||||
|
|
11
doc/ale-vue.txt
Normal file
11
doc/ale-vue.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
===============================================================================
|
||||
ALE Vue Integration *ale-vue-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
prettier *ale-vue-prettier*
|
||||
|
||||
See |ale-javascript-prettier| for information about the available options.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
151
doc/ale.txt
151
doc/ale.txt
|
@ -28,6 +28,7 @@ CONTENTS *ale-contents*
|
|||
clang-format........................|ale-c-clangformat|
|
||||
clangtidy...........................|ale-c-clangtidy|
|
||||
cppcheck............................|ale-c-cppcheck|
|
||||
flawfinder..........................|ale-c-flawfinder|
|
||||
gcc.................................|ale-c-gcc|
|
||||
chef..................................|ale-chef-options|
|
||||
foodcritic..........................|ale-chef-foodcritic|
|
||||
|
@ -42,6 +43,7 @@ CONTENTS *ale-contents*
|
|||
clangtidy...........................|ale-cpp-clangtidy|
|
||||
cppcheck............................|ale-cpp-cppcheck|
|
||||
cpplint.............................|ale-cpp-cpplint|
|
||||
flawfinder..........................|ale-cpp-flawfinder|
|
||||
gcc.................................|ale-cpp-gcc|
|
||||
c#....................................|ale-cs-options|
|
||||
mcs.................................|ale-cs-mcs|
|
||||
|
@ -57,6 +59,7 @@ CONTENTS *ale-contents*
|
|||
hadolint............................|ale-dockerfile-hadolint|
|
||||
elixir................................|ale-elixir-options|
|
||||
mix.................................|ale-elixir-mix|
|
||||
dialyxir............................|ale-elixir-dialyxir|
|
||||
elm...................................|ale-elm-options|
|
||||
elm-format..........................|ale-elm-elm-format|
|
||||
elm-make............................|ale-elm-elm-make|
|
||||
|
@ -64,23 +67,31 @@ CONTENTS *ale-contents*
|
|||
erlc................................|ale-erlang-erlc|
|
||||
syntaxerl...........................|ale-erlang-syntaxerl|
|
||||
eruby.................................|ale-eruby-options|
|
||||
fish..................................|ale-fish-options|
|
||||
fortran...............................|ale-fortran-options|
|
||||
gcc.................................|ale-fortran-gcc|
|
||||
fountain..............................|ale-fountain-options|
|
||||
fusionscript..........................|ale-fuse-options|
|
||||
fusion-lint.........................|ale-fuse-fusionlint|
|
||||
git commit............................|ale-gitcommit-options|
|
||||
gitlint.............................|ale-gitcommit-gitlint|
|
||||
glsl..................................|ale-glsl-options|
|
||||
glslang.............................|ale-glsl-glslang|
|
||||
glslls..............................|ale-glsl-glslls|
|
||||
go....................................|ale-go-options|
|
||||
gobuild.............................|ale-go-gobuild|
|
||||
gofmt...............................|ale-go-gofmt|
|
||||
gometalinter........................|ale-go-gometalinter|
|
||||
staticcheck.........................|ale-go-staticcheck|
|
||||
graphql...............................|ale-graphql-options|
|
||||
eslint..............................|ale-graphql-eslint|
|
||||
gqlint..............................|ale-graphql-gqlint|
|
||||
prettier............................|ale-graphql-prettier|
|
||||
handlebars............................|ale-handlebars-options|
|
||||
ember-template-lint.................|ale-handlebars-embertemplatelint|
|
||||
haskell...............................|ale-haskell-options|
|
||||
brittany............................|ale-haskell-brittany|
|
||||
ghc.................................|ale-haskell-ghc|
|
||||
hdevtools...........................|ale-haskell-hdevtools|
|
||||
hfmt................................|ale-haskell-hfmt|
|
||||
stack-build.........................|ale-haskell-stack-build|
|
||||
|
@ -106,7 +117,9 @@ CONTENTS *ale-contents*
|
|||
standard............................|ale-javascript-standard|
|
||||
xo..................................|ale-javascript-xo|
|
||||
json..................................|ale-json-options|
|
||||
fixjson.............................|ale-json-fixjson|
|
||||
jsonlint............................|ale-json-jsonlint|
|
||||
jq..................................|ale-json-jq|
|
||||
prettier............................|ale-json-prettier|
|
||||
kotlin................................|ale-kotlin-options|
|
||||
kotlinc.............................|ale-kotlin-kotlinc|
|
||||
|
@ -120,8 +133,11 @@ CONTENTS *ale-contents*
|
|||
llvm..................................|ale-llvm-options|
|
||||
llc.................................|ale-llvm-llc|
|
||||
lua...................................|ale-lua-options|
|
||||
luac................................|ale-lua-luac|
|
||||
luacheck............................|ale-lua-luacheck|
|
||||
markdown..............................|ale-markdown-options|
|
||||
mdl.................................|ale-markdown-mdl|
|
||||
prettier............................|ale-markdown-prettier|
|
||||
write-good..........................|ale-markdown-write-good|
|
||||
nroff.................................|ale-nroff-options|
|
||||
write-good..........................|ale-nroff-write-good|
|
||||
|
@ -144,8 +160,13 @@ CONTENTS *ale-contents*
|
|||
phpcs...............................|ale-php-phpcs|
|
||||
phpmd...............................|ale-php-phpmd|
|
||||
phpstan.............................|ale-php-phpstan|
|
||||
php-cs-fixer........................|ale-php-php-cs-fixer|
|
||||
po....................................|ale-po-options|
|
||||
write-good..........................|ale-po-write-good|
|
||||
pod...................................|ale-pod-options|
|
||||
write-good..........................|ale-pod-write-good|
|
||||
pony..................................|ale-pony-options|
|
||||
ponyc...............................|ale-pony-ponyc|
|
||||
proto.................................|ale-proto-options|
|
||||
protoc-gen-lint.....................|ale-proto-protoc-gen-lint|
|
||||
pug...................................|ale-pug-options|
|
||||
|
@ -226,6 +247,8 @@ CONTENTS *ale-contents*
|
|||
vint................................|ale-vim-vint|
|
||||
vim help..............................|ale-vim-help-options|
|
||||
write-good..........................|ale-vim-help-write-good|
|
||||
vue...................................|ale-vue-options|
|
||||
prettier............................|ale-vue-prettier|
|
||||
xhtml.................................|ale-xhtml-options|
|
||||
write-good..........................|ale-xhtml-write-good|
|
||||
xml...................................|ale-xml-options|
|
||||
|
@ -279,8 +302,8 @@ Notes:
|
|||
* Awk: `gawk`
|
||||
* Bash: `shell` (-n flag), `shellcheck`, `shfmt`
|
||||
* Bourne Shell: `shell` (-n flag), `shellcheck`, `shfmt`
|
||||
* C: `cppcheck`, `cpplint`!!, `gcc`, `clang`, `clangtidy`!!, `clang-format`
|
||||
* C++ (filetype cpp): `clang`, `clangcheck`!!, `clangtidy`!!, `clang-format`, `cppcheck`, `cpplint`!!, `gcc`
|
||||
* C: `cppcheck`, `cpplint`!!, `clang`, `clangtidy`!!, `clang-format`, `flawfinder`, `gcc`
|
||||
* C++ (filetype cpp): `clang`, `clangcheck`!!, `clangtidy`!!, `clang-format`, `cppcheck`, `cpplint`!!, `flawfinder`, `gcc`
|
||||
* CUDA: `nvcc`!!
|
||||
* C#: `mcs`, `mcsc`!!
|
||||
* Chef: `foodcritic`
|
||||
|
@ -294,15 +317,18 @@ Notes:
|
|||
* Dafny: `dafny`!!
|
||||
* Dart: `dartanalyzer`!!, `language_server`
|
||||
* Dockerfile: `hadolint`
|
||||
* Elixir: `credo`, `dogma`!!
|
||||
* Elixir: `credo`, `dialyxir`, `dogma`!!
|
||||
* Elm: `elm-format, elm-make`
|
||||
* Erb: `erb`, `erubis`
|
||||
* Erb: `erb`, `erubi`, `erubis`
|
||||
* Erlang: `erlc`, `SyntaxErl`
|
||||
* Fish: `fish` (-n flag)
|
||||
* Fortran: `gcc`
|
||||
* Fountain: `proselint`
|
||||
* FusionScript: `fusion-lint`
|
||||
* Git Commit Messages: `gitlint`
|
||||
* GLSL: glslang, `glslls`
|
||||
* Go: `gofmt`, `goimports`, `go vet`, `golint`, `gometalinter`!!, `go build`!!, `gosimple`!!, `staticcheck`!!
|
||||
* GraphQL: `eslint`, `gqlint`
|
||||
* Go: `gofmt`, `goimports`, `go vet`!!, `golint`, `gotype`, `gometalinter`!!, `go build`!!, `gosimple`!!, `staticcheck`!!
|
||||
* GraphQL: `eslint`, `gqlint`, `prettier`
|
||||
* Haml: `haml-lint`
|
||||
* Handlebars: `ember-template-lint`
|
||||
* Haskell: `brittany`, `ghc`, `stack-ghc`, `stack-build`!!, `ghc-mod`, `stack-ghc-mod`, `hlint`, `hdevtools`, `hfmt`
|
||||
|
@ -310,15 +336,15 @@ Notes:
|
|||
* Idris: `idris`
|
||||
* Java: `checkstyle`, `javac`, `google-java-format`
|
||||
* JavaScript: `eslint`, `flow`, `jscs`, `jshint`, `prettier`, `prettier-eslint`, `prettier-standard`, `standard`, `xo`
|
||||
* JSON: `jsonlint`, `prettier`
|
||||
* JSON: `fixjson`, `jsonlint`, `jq`, `prettier`
|
||||
* Kotlin: `kotlinc`, `ktlint`
|
||||
* LaTeX (tex): `alex`!!, `chktex`, `lacheck`, `proselint`, `redpen`, `vale`, `write-good`
|
||||
* Less: `lessc`, `prettier`, `stylelint`
|
||||
* LLVM: `llc`
|
||||
* Lua: `luacheck`
|
||||
* Lua: `luac`, `luacheck`
|
||||
* Mail: `alex`!!, `proselint`, `vale`
|
||||
* Make: `checkmake`
|
||||
* Markdown: `alex`!!, `mdl`, `proselint`, `redpen`, `remark-lint`, `vale`, `write-good`
|
||||
* Markdown: `alex`!!, `mdl`, `prettier`, `proselint`, `redpen`, `remark-lint`, `vale`, `write-good`
|
||||
* MATLAB: `mlint`
|
||||
* Nim: `nim check`!!
|
||||
* nix: `nix-instantiate`
|
||||
|
@ -327,8 +353,10 @@ Notes:
|
|||
* Objective-C++: `clang`
|
||||
* OCaml: `merlin` (see |ale-ocaml-merlin|), `ols`
|
||||
* Perl: `perl -c`, `perl-critic`
|
||||
* PHP: `hack`, `hackfmt`, `langserver`, `phan`, `php -l`, `phpcs`, `phpmd`, `phpstan`, `phpcbf`
|
||||
* PHP: `hack`, `hackfmt`, `langserver`, `phan`, `php -l`, `phpcs`, `phpmd`, `phpstan`, `phpcbf`, `php-cs-fixer`
|
||||
* PO: `alex`!!, `msgfmt`, `proselint`, `write-good`
|
||||
* Pod: `alex`!!, `proselint`, `write-good`
|
||||
* Pony: `ponyc`
|
||||
* proto: `protoc-gen-lint`
|
||||
* Pug: `pug-lint`
|
||||
* Puppet: `puppet`, `puppet-lint`
|
||||
|
@ -358,6 +386,7 @@ Notes:
|
|||
* Verilog: `iverilog`, `verilator`
|
||||
* Vim: `vint`
|
||||
* Vim help^: `alex`!!, `proselint`, `write-good`
|
||||
* Vue: `prettier`
|
||||
* XHTML: `alex`!!, `proselint`, `write-good`
|
||||
* XML: `xmllint`
|
||||
* YAML: `swaglint`, `yamllint`
|
||||
|
@ -643,6 +672,39 @@ g:ale_change_sign_column_color *g:ale_change_sign_column_color*
|
|||
windows.
|
||||
|
||||
|
||||
g:ale_command_wrapper *g:ale_command_wrapper*
|
||||
*b:ale_command_wrapper*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
An option for wrapping all commands that ALE runs, for linters, fixers,
|
||||
and LSP commands. This option can be set globally, or for specific buffers.
|
||||
|
||||
This option can be used to apply nice to all commands. For example: >
|
||||
|
||||
" Prefix all commands with nice.
|
||||
let g:ale_command_wrapper = 'nice -n5'
|
||||
<
|
||||
Use the |ALEInfo| command to view the commands that are run. All of the
|
||||
arguments for commands will be put on the end of the wrapped command by
|
||||
default. A `%*` marker can be used to spread the arguments in the wrapped
|
||||
command. >
|
||||
|
||||
" Has the same effect as the above.
|
||||
let g:ale_command_wrapper = 'nice -n5 %*'
|
||||
<
|
||||
|
||||
For passing all of the arguments for a command as one argument to a wrapper,
|
||||
`%@` can be used instead. >
|
||||
|
||||
" Will result in say: /bin/bash -c 'other-wrapper -c "some command" -x'
|
||||
let g:ale_command_wrapper = 'other-wrapper -c %@ -x'
|
||||
<
|
||||
For commands including `&&` or `;`, only the last command in the list will
|
||||
be passed to the wrapper. `&&` is most commonly used in ALE to change the
|
||||
working directory before running a command.
|
||||
|
||||
|
||||
g:ale_completion_delay *g:ale_completion_delay*
|
||||
|
||||
Type: |Number|
|
||||
|
@ -863,10 +925,10 @@ g:ale_keep_list_window_open *g:ale_keep_list_window_open*
|
|||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
When set to `1`, this option will keep the loclist or quickfix windows
|
||||
event after all warnings/errors have been removed for files. By default
|
||||
the loclist or quicfix windows will be closed automatically when there
|
||||
are no warnings or errors.
|
||||
When set to `1`, this option will keep the loclist or quickfix windows event
|
||||
after all warnings/errors have been removed for files. By default the
|
||||
loclist or quickfix windows will be closed automatically when there are no
|
||||
warnings or errors.
|
||||
|
||||
See |g:ale_open_list|
|
||||
|
||||
|
@ -1091,6 +1153,16 @@ g:ale_linters_explicit *g:ale_linters_explicit*
|
|||
as possible, unless otherwise specified.
|
||||
|
||||
|
||||
g:ale_list_vertical *g:ale_list_vertical*
|
||||
*b:ale_list_vertical*
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
When set to `1`, this will cause ALE to open any windows (loclist or
|
||||
quickfix) vertically instead of horizontally (|vert| |lopen|) or (|vert|
|
||||
|copen|)
|
||||
|
||||
|
||||
g:ale_loclist_msg_format *g:ale_loclist_msg_format*
|
||||
b:ale_loclist_msg_format *b:ale_loclist_msg_format*
|
||||
|
||||
|
@ -1157,10 +1229,21 @@ g:ale_open_list *g:ale_open_list*
|
|||
|
||||
The window will be kept open until all warnings or errors are cleared,
|
||||
including those not set by ALE, unless |g:ale_keep_list_window_open| is set
|
||||
to `1`, in which case the window will be kept open until closed manually.
|
||||
to `1`, in which case the window will be kept open when no problems are
|
||||
found.
|
||||
|
||||
The window size can be configured with |g:ale_list_window_size|.
|
||||
|
||||
Windows can be opened vertically with |g:ale_list_vertical|.
|
||||
|
||||
If you want to close the loclist window automatically when the buffer is
|
||||
closed, you can set up the following |autocmd| command: >
|
||||
|
||||
augroup CloseLoclistWindowGroup
|
||||
autocmd!
|
||||
autocmd QuitPre * if empty(&buftype) | lclose | endif
|
||||
augroup END
|
||||
<
|
||||
|
||||
g:ale_pattern_options *g:ale_pattern_options*
|
||||
|
||||
|
@ -1182,8 +1265,8 @@ g:ale_pattern_options *g:ale_pattern_options*
|
|||
See |b:ale_linters| and |b:ale_fixers| for information for those options.
|
||||
|
||||
Filenames are matched with |match()|, and patterns depend on the |magic|
|
||||
setting, unless prefixed with the special escape sequences like `'\v'`,
|
||||
etc.The patterns can match any part of a filename. The absolute path of the
|
||||
setting, unless prefixed with the special escape sequences like `'\v'`, etc.
|
||||
The patterns can match any part of a filename. The absolute path of the
|
||||
filename will be used for matching, taken from `expand('%:p')`.
|
||||
|
||||
The options for every match for the filename will be applied, with the
|
||||
|
@ -1261,6 +1344,11 @@ g:ale_set_quickfix *g:ale_set_quickfix*
|
|||
Problems from every buffer ALE has checked will be included in the quickfix
|
||||
list, which can be checked with |:copen|. Problems will be de-duplicated.
|
||||
|
||||
This feature should not be used in combination with tools for searching for
|
||||
matches and commands like |:cfdo|, as ALE will replace the quickfix list
|
||||
pretty frequently. If you wish to use such tools, you should populate the
|
||||
loclist instead.
|
||||
|
||||
|
||||
g:ale_set_signs *g:ale_set_signs*
|
||||
|
||||
|
@ -1783,6 +1871,15 @@ ALEResetBuffer *ALEResetBuffer*
|
|||
|ALEDisableBuffer|.
|
||||
|
||||
|
||||
ALEStopAllLSPs *ALEStopAllLSPs*
|
||||
|
||||
`ALEStopAllLSPs` will close and stop all channels and jobs for all LSP-like
|
||||
clients, including tsserver, remove all of the data stored for them, and
|
||||
delete all of the problems found for them, updating every linted buffer.
|
||||
|
||||
This command can be used when LSP clients mess up and need to be restarted.
|
||||
|
||||
|
||||
===============================================================================
|
||||
9. API *ale-api*
|
||||
|
||||
|
@ -1835,6 +1932,13 @@ ale#engine#GetLoclist(buffer) *ale#engine#GetLoclist()*
|
|||
be copied before applying |map()| or |filter()|.
|
||||
|
||||
|
||||
ale#engine#IsCheckingBuffer(buffer) *ale#engine#IsCheckingBuffer()*
|
||||
|
||||
Given a buffer number, returns `1` when ALE is busy checking that buffer.
|
||||
|
||||
This function can be used for status lines, tab names, etc.
|
||||
|
||||
|
||||
ale#engine#ManageFile(buffer, filename) *ale#engine#ManageFile()*
|
||||
|
||||
Given a buffer number for a buffer currently running some linting tasks
|
||||
|
@ -2185,6 +2289,19 @@ ale#statusline#Count(buffer) *ale#statusline#Count()*
|
|||
`total` -> The total number of problems.
|
||||
|
||||
|
||||
b:ale_linted *b:ale_linted*
|
||||
|
||||
`b:ale_linted` is set to the number of times a buffer has been checked by
|
||||
ALE after all linters for one lint cycle have finished checking a buffer.
|
||||
This variable may not be defined until ALE first checks a buffer, so it
|
||||
should be accessed with |get()| or |getbufvar()|. For example: >
|
||||
|
||||
" Print a message indicating how many times ALE has checked this buffer.
|
||||
echo 'ALE has checked this buffer ' . get(b:, 'ale_linted') . ' time(s).'
|
||||
" Print 'checked' using getbufvar() if a buffer has been checked.
|
||||
echo getbufvar(bufnr(''), 'ale_linted', 0) > 0 ? 'checked' : 'not checked'
|
||||
<
|
||||
|
||||
ALELintPre *ALELintPre-autocmd*
|
||||
ALELintPost *ALELintPost-autocmd*
|
||||
|
||||
|
|
|
@ -32,6 +32,11 @@ if !s:has_features
|
|||
finish
|
||||
endif
|
||||
|
||||
if has('nvim') && !has('nvim-0.2.0') && !get(g:, 'ale_use_deprecated_neovim')
|
||||
execute 'echom ''ALE support for NeoVim versions below 0.2.0 is deprecated.'''
|
||||
execute 'echom ''Use `let g:ale_use_deprecated_neovim = 1` to silence this warning for now.'''
|
||||
endif
|
||||
|
||||
" This flag can be set to 0 to disable emitting conflict warnings.
|
||||
let g:ale_emit_conflict_warnings = get(g:, 'ale_emit_conflict_warnings', 1)
|
||||
|
||||
|
@ -118,6 +123,9 @@ let g:ale_open_list = get(g:, 'ale_open_list', 0)
|
|||
" This flag dictates if ale keeps open loclist even if there is no error in loclist
|
||||
let g:ale_keep_list_window_open = get(g:, 'ale_keep_list_window_open', 0)
|
||||
|
||||
" This flag dictates that quickfix windows should be opened vertically
|
||||
let g:ale_list_vertical = get(g:, 'ale_list_vertical', 0)
|
||||
|
||||
" The window size to set for the quickfix and loclist windows
|
||||
call ale#Set('list_window_size', 10)
|
||||
|
||||
|
@ -209,6 +217,9 @@ call ale#Set('completion_enabled', 0)
|
|||
call ale#Set('completion_delay', 100)
|
||||
call ale#Set('completion_max_suggestions', 50)
|
||||
|
||||
" A setting for wrapping commands.
|
||||
call ale#Set('command_wrapper', '')
|
||||
|
||||
if g:ale_set_balloons
|
||||
call ale#balloon#Enable()
|
||||
endif
|
||||
|
@ -238,6 +249,8 @@ command! -bar ALEToggleBuffer :call ale#toggle#ToggleBuffer(bufnr(''))
|
|||
command! -bar ALEEnableBuffer :call ale#toggle#EnableBuffer(bufnr(''))
|
||||
command! -bar ALEDisableBuffer :call ale#toggle#DisableBuffer(bufnr(''))
|
||||
command! -bar ALEResetBuffer :call ale#toggle#ResetBuffer(bufnr(''))
|
||||
" A command to stop all LSP-like clients, including tsserver.
|
||||
command! -bar ALEStopAllLSPs :call ale#lsp#reset#StopAllLSPs()
|
||||
|
||||
" A command for linting manually.
|
||||
command! -bar ALELint :call ale#Queue(0, 'lint_file')
|
||||
|
@ -292,9 +305,19 @@ augroup END
|
|||
" Backwards Compatibility
|
||||
|
||||
function! ALELint(delay) abort
|
||||
if !get(g:, 'ale_deprecation_ale_lint', 0)
|
||||
execute 'echom ''ALELint() is deprecated, use ale#Queue() instead.'''
|
||||
let g:ale_deprecation_ale_lint = 1
|
||||
endif
|
||||
|
||||
call ale#Queue(a:delay)
|
||||
endfunction
|
||||
|
||||
function! ALEGetStatusLine() abort
|
||||
if !get(g:, 'ale_deprecation_ale_get_status_line', 0)
|
||||
execute 'echom ''ALEGetStatusLine() is deprecated.'''
|
||||
let g:ale_deprecation_ale_get_status_line = 1
|
||||
endif
|
||||
|
||||
return ale#statusline#Status()
|
||||
endfunction
|
||||
|
|
0
test/command_callback/htmlhint_paths/node_modules/.bin/htmlhint
generated
vendored
Executable file
0
test/command_callback/htmlhint_paths/node_modules/.bin/htmlhint
generated
vendored
Executable file
0
test/command_callback/php_paths/project-with-php-cs-fixer/vendor/bin/php-cs-fixer
vendored
Normal file
0
test/command_callback/php_paths/project-with-php-cs-fixer/vendor/bin/php-cs-fixer
vendored
Normal file
0
test/command_callback/python_paths/with_virtualenv/env/Scripts/gitlint.exe
vendored
Executable file
0
test/command_callback/python_paths/with_virtualenv/env/Scripts/gitlint.exe
vendored
Executable file
0
test/command_callback/python_paths/with_virtualenv/env/bin/gitlint
vendored
Executable file
0
test/command_callback/python_paths/with_virtualenv/env/bin/gitlint
vendored
Executable file
|
@ -0,0 +1,51 @@
|
|||
Before:
|
||||
Save g:ale_c_flawfinder_executable
|
||||
Save g:ale_c_flawfinder_options
|
||||
Save g:ale_c_flawfinder_minlevel
|
||||
|
||||
unlet! g:ale_c_flawfinder_executable
|
||||
unlet! b:ale_c_flawfinder_executable
|
||||
unlet! g:ale_c_flawfinder_options
|
||||
unlet! b:ale_c_flawfinder_options
|
||||
unlet! g:ale_c_flawfinder_minlevel
|
||||
unlet! b:ale_c_flawfinder_minlevel
|
||||
|
||||
runtime ale_linters/c/flawfinder.vim
|
||||
|
||||
After:
|
||||
unlet! b:ale_c_flawfinder_executable
|
||||
unlet! b:ale_c_flawfinder_options
|
||||
unlet! b:ale_c_flawfinder_minlevel
|
||||
|
||||
Restore
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The flawfinder command should be correct):
|
||||
AssertEqual
|
||||
\ ale#Escape('flawfinder')
|
||||
\ . ' -CDQS --minlevel=1 %t',
|
||||
\ ale_linters#c#flawfinder#GetCommand(bufnr(''))
|
||||
|
||||
Execute(The minlevel of flawfinder should be configurable):
|
||||
let b:ale_c_flawfinder_minlevel = 8
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape('flawfinder')
|
||||
\ . ' -CDQS --minlevel=8 %t',
|
||||
\ ale_linters#c#flawfinder#GetCommand(bufnr(''))
|
||||
|
||||
Execute(Additional flawfinder options should be configurable):
|
||||
let b:ale_c_flawfinder_options = ' --foobar'
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape('flawfinder')
|
||||
\ . ' -CDQS --foobar --minlevel=1 %t',
|
||||
\ ale_linters#c#flawfinder#GetCommand(bufnr(''))
|
||||
|
||||
Execute(The flawfinder exectable should be configurable):
|
||||
let b:ale_c_flawfinder_executable = 'foo/bar'
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape('foo/bar')
|
||||
\ . ' -CDQS --minlevel=1 %t',
|
||||
\ ale_linters#c#flawfinder#GetCommand(bufnr(''))
|
|
@ -1,9 +1,13 @@
|
|||
Before:
|
||||
Save g:ale_rust_cargo_use_check
|
||||
Save g:ale_rust_cargo_check_all_targets
|
||||
Save g:ale_rust_cargo_default_feature_behavior
|
||||
Save g:ale_rust_cargo_include_features
|
||||
|
||||
unlet! g:ale_rust_cargo_use_check
|
||||
unlet! g:ale_cargo_check_all_targets
|
||||
unlet! g:ale_rust_cargo_default_feature_behavior
|
||||
unlet! g:ale_rust_cargo_include_features
|
||||
|
||||
runtime ale_linters/rust/cargo.vim
|
||||
call ale#test#SetDirectory('/testplugin/test/command_callback')
|
||||
|
@ -114,3 +118,47 @@ Execute(--all-targets should be used when g:ale_rust_cargo_check_all_targets is
|
|||
\ ale_linters#rust#cargo#GetCommand(bufnr(''), [])
|
||||
|
||||
AssertEqual '', ale_linters#rust#cargo#VersionCheck(bufnr(''))
|
||||
|
||||
Execute(--no-default-features should be used when g:ale_rust_cargo_default_feature_behavior is none):
|
||||
let g:ale_rust_cargo_default_feature_behavior = 'none'
|
||||
|
||||
AssertEqual
|
||||
\ 'cargo check' . g:suffix . ' --no-default-features',
|
||||
\ ale_linters#rust#cargo#GetCommand(bufnr(''), [
|
||||
\ 'cargo 0.22.0 (3423351a5 2017-10-06)',
|
||||
\ ])
|
||||
|
||||
Execute(g:ale_rust_cargo_include_features added when g:ale_rust_cargo_default_feature_behavior is none):
|
||||
let g:ale_rust_cargo_default_feature_behavior = 'none'
|
||||
let g:ale_rust_cargo_include_features = 'foo bar'
|
||||
|
||||
AssertEqual
|
||||
\ 'cargo check' . g:suffix . ' --no-default-features --features ' .
|
||||
\ (fnamemodify(&shell, ':t') is? 'cmd.exe' ? '"foo bar"' : "'foo bar'"),
|
||||
\ ale_linters#rust#cargo#GetCommand(bufnr(''), [
|
||||
\ 'cargo 0.22.0 (3423351a5 2017-10-06)',
|
||||
\ ])
|
||||
|
||||
Execute(g:ale_rust_cargo_include_features added and escaped):
|
||||
let g:ale_rust_cargo_default_feature_behavior = 'default'
|
||||
let g:ale_rust_cargo_include_features = "foo bar baz"
|
||||
|
||||
AssertEqual
|
||||
\ 'cargo check' . g:suffix . ' --features ' .
|
||||
\ (fnamemodify(&shell, ':t') is? 'cmd.exe' ? '"foo bar baz"' : "'foo bar baz'"),
|
||||
\ ale_linters#rust#cargo#GetCommand(bufnr(''), [
|
||||
\ 'cargo 0.22.0 (3423351a5 2017-10-06)',
|
||||
\ ])
|
||||
|
||||
Execute(--all-features should be used when g:ale_rust_cargo_default_feature_behavior is all):
|
||||
let g:ale_rust_cargo_default_feature_behavior = 'all'
|
||||
|
||||
" When all features are enabled we should ignore extra features to add
|
||||
" since it won't do anything
|
||||
let g:ale_rust_cargo_include_features = 'foo bar'
|
||||
|
||||
AssertEqual
|
||||
\ 'cargo check' . g:suffix . ' --all-features',
|
||||
\ ale_linters#rust#cargo#GetCommand(bufnr(''), [
|
||||
\ 'cargo 0.22.0 (3423351a5 2017-10-06)',
|
||||
\ ])
|
||||
|
|
|
@ -28,7 +28,7 @@ Execute(The executable should be used in the command):
|
|||
AssertEqual
|
||||
\ ale#Escape('clang-check')
|
||||
\ . ' -analyze %s'
|
||||
\ . ' -extra-arg -Xanalyzer -extra-arg -analyzer-output=text',
|
||||
\ . ' -extra-arg -Xclang -extra-arg -analyzer-output=text',
|
||||
\ ale_linters#cpp#clangcheck#GetCommand(bufnr(''))
|
||||
|
||||
let b:ale_cpp_clangcheck_executable = 'foobar'
|
||||
|
@ -38,7 +38,7 @@ Execute(The executable should be used in the command):
|
|||
AssertEqual
|
||||
\ ale#Escape('foobar')
|
||||
\ . ' -analyze %s'
|
||||
\ . ' -extra-arg -Xanalyzer -extra-arg -analyzer-output=text',
|
||||
\ . ' -extra-arg -Xclang -extra-arg -analyzer-output=text',
|
||||
\ ale_linters#cpp#clangcheck#GetCommand(bufnr(''))
|
||||
|
||||
Execute(The options should be configurable):
|
||||
|
@ -46,8 +46,9 @@ Execute(The options should be configurable):
|
|||
|
||||
AssertEqual
|
||||
\ ale#Escape('clang-check')
|
||||
\ . ' -analyze %s --something'
|
||||
\ . ' -extra-arg -Xanalyzer -extra-arg -analyzer-output=text',
|
||||
\ . ' -analyze %s'
|
||||
\ . ' -extra-arg -Xclang -extra-arg -analyzer-output=text'
|
||||
\ . ' --something',
|
||||
\ ale_linters#cpp#clangcheck#GetCommand(bufnr(''))
|
||||
|
||||
Execute(The build directory should be used when set):
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
Before:
|
||||
Save g:ale_cpp_flawfinder_executable
|
||||
Save g:ale_cpp_flawfinder_options
|
||||
Save g:ale_cpp_flawfinder_minlevel
|
||||
|
||||
unlet! g:ale_cpp_flawfinder_executable
|
||||
unlet! b:ale_cpp_flawfinder_executable
|
||||
unlet! g:ale_cpp_flawfinder_options
|
||||
unlet! b:ale_cpp_flawfinder_options
|
||||
unlet! g:ale_cpp_flawfinder_minlevel
|
||||
unlet! b:ale_cpp_flawfinder_minlevel
|
||||
|
||||
runtime ale_linters/cpp/flawfinder.vim
|
||||
|
||||
After:
|
||||
unlet! b:ale_cpp_flawfinder_executable
|
||||
unlet! b:ale_cpp_flawfinder_options
|
||||
unlet! b:ale_cpp_flawfinder_minlevel
|
||||
|
||||
Restore
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The flawfinder command should be correct):
|
||||
AssertEqual
|
||||
\ ale#Escape('flawfinder')
|
||||
\ . ' -CDQS --minlevel=1 %t',
|
||||
\ ale_linters#cpp#flawfinder#GetCommand(bufnr(''))
|
||||
|
||||
Execute(The minlevel of flawfinder should be configurable):
|
||||
let b:ale_cpp_flawfinder_minlevel = 8
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape('flawfinder')
|
||||
\ . ' -CDQS --minlevel=8 %t',
|
||||
\ ale_linters#cpp#flawfinder#GetCommand(bufnr(''))
|
||||
|
||||
Execute(Additional flawfinder options should be configurable):
|
||||
let b:ale_cpp_flawfinder_options = ' --foobar'
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape('flawfinder')
|
||||
\ . ' -CDQS --foobar --minlevel=1 %t',
|
||||
\ ale_linters#cpp#flawfinder#GetCommand(bufnr(''))
|
||||
|
||||
Execute(The flawfinder exectable should be configurable):
|
||||
let b:ale_cpp_flawfinder_executable = 'foo/bar'
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape('foo/bar')
|
||||
\ . ' -CDQS --minlevel=1 %t',
|
||||
\ ale_linters#cpp#flawfinder#GetCommand(bufnr(''))
|
31
test/command_callback/test_erubi_command_callback.vader
Normal file
31
test/command_callback/test_erubi_command_callback.vader
Normal file
|
@ -0,0 +1,31 @@
|
|||
Before:
|
||||
runtime ale_linters/eruby/erubi.vim
|
||||
call ale#test#SetDirectory('/testplugin/test/command_callback')
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
call ale#test#RestoreDirectory()
|
||||
|
||||
Execute(Executable should not contain any filter code by default):
|
||||
call ale#test#SetFilename('../ruby_fixtures/not_a_rails_app/file.rb')
|
||||
|
||||
AssertEqual
|
||||
\ 'ruby -r erubi/capture_end -e ' . ale#Escape('puts Erubi::CaptureEndEngine.new($stdin.read).src') . '< %t | ruby -c',
|
||||
\ ale_linters#eruby#erubi#GetCommand(bufnr(''), [])
|
||||
|
||||
Execute(Executable should filter invalid eRuby when inside a Rails project):
|
||||
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/app/views/my_great_view.html.erb')
|
||||
|
||||
AssertEqual
|
||||
\ 'ruby -r erubi/capture_end -e ' . ale#Escape('puts Erubi::CaptureEndEngine.new($stdin.read.gsub(%{<%=},%{<%}), nil, %{-}).src') . '< %t | ruby -c',
|
||||
\ ale_linters#eruby#erubi#GetCommand(bufnr(''), [])
|
||||
|
||||
Execute(Command should be blank if the first command in the chain return output):
|
||||
let output_lines = [
|
||||
\ "/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- erubi/capture_end (LoadError)",
|
||||
\ " from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'",
|
||||
\]
|
||||
|
||||
AssertEqual
|
||||
\ '',
|
||||
\ ale_linters#eruby#erubi#GetCommand(bufnr(''), output_lines)
|
84
test/command_callback/test_gitlint_command_callback.vader
Normal file
84
test/command_callback/test_gitlint_command_callback.vader
Normal file
|
@ -0,0 +1,84 @@
|
|||
Before:
|
||||
Save g:ale_gitcommit_gitlint_executable
|
||||
Save g:ale_gitcommit_gitlint_options
|
||||
Save g:ale_gitcommit_gitlint_use_global
|
||||
|
||||
unlet! g:ale_gitcommit_gitlint_executable
|
||||
unlet! g:ale_gitcommit_gitlint_options
|
||||
unlet! g:ale_gitcommit_gitlint_use_global
|
||||
|
||||
runtime ale_linters/gitcommit/gitlint.vim
|
||||
call ale#test#SetDirectory('/testplugin/test/command_callback')
|
||||
|
||||
let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
|
||||
let b:command_tail = ' lint'
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
||||
call ale#test#RestoreDirectory()
|
||||
call ale#linter#Reset()
|
||||
|
||||
unlet! b:bin_dir
|
||||
unlet! b:executable
|
||||
|
||||
Execute(The gitlint callbacks should return the correct default values):
|
||||
AssertEqual
|
||||
\ 'gitlint',
|
||||
\ ale_linters#gitcommit#gitlint#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ ale#Escape('gitlint') . b:command_tail,
|
||||
\ ale_linters#gitcommit#gitlint#GetCommand(bufnr(''))
|
||||
|
||||
Execute(The gitlint executable should be configurable, and escaped properly):
|
||||
let g:ale_gitcommit_gitlint_executable = 'executable with spaces'
|
||||
|
||||
AssertEqual
|
||||
\ 'executable with spaces',
|
||||
\ ale_linters#gitcommit#gitlint#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ ale#Escape('executable with spaces') . b:command_tail,
|
||||
\ ale_linters#gitcommit#gitlint#GetCommand(bufnr(''))
|
||||
|
||||
Execute(The gitlint command callback should let you set options):
|
||||
let g:ale_gitcommit_gitlint_options = '--some-option'
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape('gitlint') . ' --some-option' . b:command_tail,
|
||||
\ ale_linters#gitcommit#gitlint#GetCommand(bufnr(''))
|
||||
|
||||
Execute(The gitlint callbacks shouldn't detect virtualenv directories where they don't exist):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/no_virtualenv/subdir/foo/COMMIT_EDITMSG')
|
||||
|
||||
AssertEqual
|
||||
\ 'gitlint',
|
||||
\ ale_linters#gitcommit#gitlint#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ ale#Escape('gitlint') . b:command_tail,
|
||||
\ ale_linters#gitcommit#gitlint#GetCommand(bufnr(''))
|
||||
|
||||
Execute(The gitlint callbacks should detect virtualenv directories):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/COMMIT_EDITMSG')
|
||||
|
||||
let b:executable = ale#path#Simplify(
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/gitlint'
|
||||
\)
|
||||
|
||||
AssertEqual
|
||||
\ b:executable,
|
||||
\ ale_linters#gitcommit#gitlint#GetExecutable(bufnr(''))
|
||||
|
||||
AssertEqual
|
||||
\ ale#Escape(b:executable) . b:command_tail,
|
||||
\ ale_linters#gitcommit#gitlint#GetCommand(bufnr(''))
|
||||
|
||||
Execute(You should able able to use the global gitlint instead):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/COMMIT_EDITMSG')
|
||||
let g:ale_gitcommit_gitlint_use_global = 1
|
||||
|
||||
AssertEqual
|
||||
\ 'gitlint',
|
||||
\ ale_linters#gitcommit#gitlint#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ ale#Escape('gitlint') . b:command_tail,
|
||||
\ ale_linters#gitcommit#gitlint#GetCommand(bufnr(''))
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue