mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 05:04:28 +08:00
Compare commits
173 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c3bd8a84f | ||
|
|
d1224a05c4 | ||
|
|
0e4a7a7187 | ||
|
|
36a3932ce8 | ||
|
|
67b71653f5 | ||
|
|
229da9b8ef | ||
|
|
7e4372bd1f | ||
|
|
f6fc1edcdc | ||
|
|
6e5a74285c | ||
|
|
164c711b3d | ||
|
|
107516c757 | ||
|
|
d14558da32 | ||
|
|
562862073f | ||
|
|
1d33d2cacf | ||
|
|
dbf530e87f | ||
|
|
ec5750f57b | ||
|
|
c525f49f09 | ||
|
|
722607b866 | ||
|
|
7a87520ba5 | ||
|
|
87217ae347 | ||
|
|
0678eb1f45 | ||
|
|
b769b67b2f | ||
|
|
ca2472a460 | ||
|
|
f0325d7322 | ||
|
|
c0279de661 | ||
|
|
763fcb8512 | ||
|
|
64c95d4881 | ||
|
|
57a93cbc04 | ||
|
|
6452c5e2f0 | ||
|
|
0cb3e36554 | ||
|
|
43e8f47e6e | ||
|
|
68b9399d4c | ||
|
|
434f22e44a | ||
|
|
440502dc93 | ||
|
|
92612a9eab | ||
|
|
1b1e53ef61 | ||
|
|
c112ee9dff | ||
|
|
bdd8d2399f | ||
|
|
b08fdd16b8 | ||
|
|
302f69e933 | ||
|
|
92e6e4d1ba | ||
|
|
7e1a9a9810 | ||
|
|
05d39bc1a9 | ||
|
|
b586eba4a4 | ||
|
|
6320ce6674 | ||
|
|
9258c73680 | ||
|
|
1995afa855 | ||
|
|
0a0535546f | ||
|
|
b7363bef7d | ||
|
|
32091fb8ad | ||
|
|
c572cfd2d2 | ||
|
|
2a575ca551 | ||
|
|
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 |
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
|
||||
|
||||
60
README.md
60
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)
|
||||
|
||||
|
||||

|
||||
@@ -48,6 +48,7 @@ formatting tools, and some Language Server Protocol and `tsserver` features.
|
||||
13. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
||||
14. [How can I configure my C or C++ project?](#faq-c-configuration)
|
||||
15. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
|
||||
16. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
|
||||
|
||||
<a name="supported-languages"></a>
|
||||
|
||||
@@ -79,8 +80,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 +94,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 +114,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) !!, [markdownlint](https://github.com/DavidAnson/markdownlint) !!, [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) !!, [textlint](https://textlint.github.io/), [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,18 +131,21 @@ 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) |
|
||||
| QML | [qmllint](https://github.com/qt/qtdeclarative/tree/5.11/tools/qmllint) |
|
||||
| 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`) |
|
||||
| Ruby | [brakeman](http://brakemanscanner.org/) !!, [rails_best_practices](https://github.com/flyerhzm/rails_best_practices) !!, [reek](https://github.com/troessner/reek), [rubocop](https://github.com/bbatsov/rubocop), [ruby](https://www.ruby-lang.org) |
|
||||
| Ruby | [brakeman](http://brakemanscanner.org/) !!, [rails_best_practices](https://github.com/flyerhzm/rails_best_practices) !!, [reek](https://github.com/troessner/reek), [rubocop](https://github.com/bbatsov/rubocop), [ruby](https://www.ruby-lang.org), [rufo](https://github.com/ruby-formatter/rufo) |
|
||||
| Rust | cargo !! (see `:help ale-integration-rust` for configuration instructions), [rls](https://github.com/rust-lang-nursery/rls), [rustc](https://www.rust-lang.org/), [rustfmt](https://github.com/rust-lang-nursery/rustfmt) |
|
||||
| SASS | [sass-lint](https://www.npmjs.com/package/sass-lint), [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| SCSS | [prettier](https://github.com/prettier/prettier), [sass-lint](https://www.npmjs.com/package/sass-lint), [scss-lint](https://github.com/brigade/scss-lint), [stylelint](https://github.com/stylelint/stylelint) |
|
||||
@@ -152,12 +159,13 @@ formatting.
|
||||
| Tcl | [nagelfar](http://nagelfar.sourceforge.net) !! |
|
||||
| Terraform | [tflint](https://github.com/wata727/tflint) |
|
||||
| Texinfo | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good)|
|
||||
| Text^ | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good), [redpen](http://redpen.cc/) |
|
||||
| Text^ | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [textlint](https://textlint.github.io/), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
||||
| Thrift | [thrift](http://thrift.apache.org/) |
|
||||
| TypeScript | [eslint](http://eslint.org/), [prettier](https://github.com/prettier/prettier), [tslint](https://github.com/palantir/tslint), tsserver, typecheck |
|
||||
| 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/) |
|
||||
@@ -496,15 +504,17 @@ Will give you:
|
||||
### 5.viii. How can I execute some code when ALE starts or stops linting?
|
||||
|
||||
ALE runs its own [autocmd](http://vimdoc.sourceforge.net/htmldoc/autocmd.html)
|
||||
events whenever has a linter is started and has been successfully executed and
|
||||
processed. These events can be used to call arbitrary functions before and after
|
||||
ALE stops linting.
|
||||
events when a lint or fix cycle are started and stopped. These events can be
|
||||
used to call arbitrary functions before and after ALE stops linting.
|
||||
|
||||
```vim
|
||||
augroup YourGroup
|
||||
autocmd!
|
||||
autocmd User ALELintPre call YourFunction()
|
||||
autocmd User ALELintPost call YourFunction()
|
||||
|
||||
autocmd User ALEFixPre call YourFunction()
|
||||
autocmd User ALEFixPost call YourFunction()
|
||||
augroup END
|
||||
```
|
||||
|
||||
@@ -571,6 +581,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?
|
||||
@@ -689,3 +702,14 @@ let g:ale_pattern_options_enabled = 1
|
||||
```
|
||||
|
||||
Buffer-local variables for settings always override the global settings.
|
||||
|
||||
<a name="faq-list-window-height"></a>
|
||||
|
||||
### 5.xvi. How can I configure the height of the list in which ALE displays errors?
|
||||
|
||||
To set a default height for the error list, use the `g:ale_list_window_size` variable.
|
||||
|
||||
```vim
|
||||
" Show 5 lines of errors (default: 10)
|
||||
let g:ale_list_window_size = 5
|
||||
```
|
||||
|
||||
@@ -12,7 +12,11 @@ function! ale_linters#awk#gawk#GetExecutable(buffer) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#awk#gawk#GetCommand(buffer) abort
|
||||
" note the --source 'BEGIN ...' is to prevent
|
||||
" gawk from attempting to execute the body of the script
|
||||
" it is linting.
|
||||
return ale_linters#awk#gawk#GetExecutable(a:buffer)
|
||||
\ . " --source 'BEGIN { exit } END { exit 1 }'"
|
||||
\ . ' ' . ale#Var(a:buffer, 'awk_gawk_options')
|
||||
\ . ' ' . '-f %t --lint /dev/null'
|
||||
endfunction
|
||||
@@ -21,6 +25,6 @@ call ale#linter#Define('awk', {
|
||||
\ 'name': 'gawk',
|
||||
\ 'executable_callback': 'ale_linters#awk#gawk#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#awk#gawk#GetCommand',
|
||||
\ 'callback': 'ale#handlers#cpplint#HandleCppLintFormat',
|
||||
\ 'callback': 'ale#handlers#gawk#HandleGawkFormat',
|
||||
\ 'output_stream': 'both'
|
||||
\})
|
||||
|
||||
31
ale_linters/c/flawfinder.vim
Normal file
31
ale_linters/c/flawfinder.vim
Normal file
@@ -0,0 +1,31 @@
|
||||
" 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)
|
||||
call ale#Set('c_flawfinder_error_severity', 6)
|
||||
|
||||
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#flawfinder#HandleFlawfinderFormat',
|
||||
\})
|
||||
31
ale_linters/cpp/flawfinder.vim
Normal file
31
ale_linters/cpp/flawfinder.vim
Normal file
@@ -0,0 +1,31 @@
|
||||
" 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)
|
||||
call ale#Set('c_flawfinder_error_severity', 6)
|
||||
|
||||
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#flawfinder#HandleFlawfinderFormat',
|
||||
\})
|
||||
@@ -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',
|
||||
\})
|
||||
67
ale_linters/fish/fish.vim
Normal file
67
ale_linters/fish/fish.vim
Normal file
@@ -0,0 +1,67 @@
|
||||
" 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
|
||||
" ^
|
||||
"
|
||||
" OR, patterns such as:
|
||||
"
|
||||
" Unsupported use of '||'. In fish, please use 'COMMAND; or COMMAND'.
|
||||
" /tmp/vLz620o/258/test.fish (line 2): if set -q SSH_CLIENT || set -q SSH_TTY
|
||||
" ^
|
||||
"
|
||||
" fish -n can return errors in either format.
|
||||
let l:pattern = '^\(.* (line \(\d\+\)): \)\(.*\)$'
|
||||
let l:column_pattern = '^ *\^'
|
||||
let l:output = []
|
||||
let l:column_offset = 0
|
||||
let l:last_line_with_message = ''
|
||||
|
||||
for l:line in a:lines
|
||||
" Look for error lines first.
|
||||
let l:match = matchlist(l:line, l:pattern)
|
||||
|
||||
if !empty(l:match)
|
||||
if !empty(l:last_line_with_message)
|
||||
let l:text = l:last_line_with_message
|
||||
else
|
||||
let l:text = l:match[3]
|
||||
endif
|
||||
|
||||
let l:column_offset = len(l:match[1])
|
||||
|
||||
let l:last_line_with_message = ''
|
||||
call add(l:output, {
|
||||
\ 'col': 0,
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'text': l:text,
|
||||
\})
|
||||
else
|
||||
" Look for column markers like ' ^' second.
|
||||
" The column index will be set according to how long the line is.
|
||||
let l:column_match = matchstr(l:line, l:column_pattern)
|
||||
|
||||
if !empty(l:column_match) && !empty(l:output)
|
||||
let l:output[-1].col = len(l:column_match) - l:column_offset
|
||||
let l:last_line_with_message = ''
|
||||
else
|
||||
let l:last_line_with_message = l:line
|
||||
let l:column_offset = 0
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
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
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
" Author: Ben Reedy <https://github.com/breed808>
|
||||
" Description: gosimple for Go files
|
||||
|
||||
function! ale_linters#go#gosimple#GetCommand(buffer) abort
|
||||
return ale#path#BufferCdString(a:buffer) . ' gosimple .'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'gosimple',
|
||||
\ 'executable': 'gosimple',
|
||||
\ 'command': 'gosimple %s',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\ 'command_callback': 'ale_linters#go#gosimple#GetCommand',
|
||||
\ 'callback': 'ale#handlers#go#Handler',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
20
ale_linters/go/gotype.vim
Normal file
20
ale_linters/go/gotype.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" Author: Jelte Fennema <github-public@jeltef.nl>
|
||||
" Description: gotype for Go files
|
||||
|
||||
function! ale_linters#go#gotype#GetCommand(buffer) abort
|
||||
if expand('#' . a:buffer . ':p') =~# '_test\.go$'
|
||||
return
|
||||
endif
|
||||
|
||||
|
||||
return ale#path#BufferCdString(a:buffer) . ' gotype .'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'gotype',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'gotype',
|
||||
\ 'command_callback': 'ale_linters#go#gotype#GetCommand',
|
||||
\ 'callback': 'ale#handlers#go#Handler',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
@@ -1,10 +1,18 @@
|
||||
" 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
|
||||
|
||||
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#handlers#go#Handler',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
@@ -1,11 +1,33 @@
|
||||
" 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',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\ 'command_callback': 'ale_linters#go#staticcheck#GetCommand',
|
||||
\ 'callback': 'ale#handlers#go#Handler',
|
||||
\ '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',
|
||||
\})
|
||||
11
ale_linters/markdown/markdownlint.vim
Normal file
11
ale_linters/markdown/markdownlint.vim
Normal file
@@ -0,0 +1,11 @@
|
||||
" Author: Ty-Lucas Kelley <tylucaskelley@gmail.com>
|
||||
" Description: Adds support for markdownlint
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'markdownlint',
|
||||
\ 'executable': 'markdownlint',
|
||||
\ 'lint_file': 1,
|
||||
\ 'output_stream': 'both',
|
||||
\ 'command': 'markdownlint %s',
|
||||
\ 'callback': 'ale#handlers#markdownlint#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'
|
||||
\})
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
" Author rhysd https://rhysd.github.io/
|
||||
" Author rhysd https://rhysd.github.io/, Dirk Roorda (dirkroorda), Adrián González Rus (@adrigzr)
|
||||
" Description: remark-lint for Markdown files
|
||||
|
||||
function! ale_linters#markdown#remark_lint#Handle(buffer, lines) abort
|
||||
" matches: ' 1:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint'
|
||||
let l:pattern = '^ \+\(\d\+\):\(\d\+\) \(warning\|error\) \(.\+\)$'
|
||||
" matches: ' 18:71-19:1 error Missing new line after list item list-item-spacing remark-lint',
|
||||
let l:pattern = '^ \+\(\d\+\):\(\d\+\)\(-\(\d\+\):\(\d\+\)\)\? \(warning\|error\) \(.\+\)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
let l:item = {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'col': l:match[2] + 0,
|
||||
\ 'type': l:match[3] is# 'error' ? 'E' : 'W',
|
||||
\ 'text': l:match[4],
|
||||
\})
|
||||
\ 'type': l:match[6] is# 'error' ? 'E' : 'W',
|
||||
\ 'text': l:match[7],
|
||||
\}
|
||||
if l:match[3] isnot# ''
|
||||
let l:item.end_lnum = l:match[4] + 0
|
||||
let l:item.end_col = l:match[5] + 0
|
||||
endif
|
||||
call add(l:output, l:item)
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
|
||||
9
ale_linters/markdown/textlint.vim
Normal file
9
ale_linters/markdown/textlint.vim
Normal file
@@ -0,0 +1,9 @@
|
||||
" Author: tokida https://rouger.info, Yasuhiro Kiyota <yasuhiroki.duck@gmail.com>
|
||||
" Description: textlint, a proofreading tool (https://textlint.github.io/)
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'textlint',
|
||||
\ 'executable_callback': 'ale#handlers#textlint#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#textlint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#textlint#HandleTextlintOutput',
|
||||
\})
|
||||
@@ -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 --output-file=- %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
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ function! ale_linters#python#pylint#Handle(buffer, lines) abort
|
||||
" Matches patterns like the following:
|
||||
"
|
||||
" test.py:4:4: W0101 (unreachable) Unreachable code
|
||||
let l:pattern = '\v^[^:]+:(\d+):(\d+): ([[:alnum:]]+) \(([^(]*)\) (.*)$'
|
||||
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+): ([[:alnum:]]+) \(([^(]*)\) (.*)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
|
||||
29
ale_linters/qml/qmllint.vim
Normal file
29
ale_linters/qml/qmllint.vim
Normal file
@@ -0,0 +1,29 @@
|
||||
" Author: pylipp (www.github.com/pylipp)
|
||||
" Description: qmllint for QML files
|
||||
|
||||
" Find lines like
|
||||
" /home/foo_user42/code-base/qml/Screen.qml:11 : Expected token `}'
|
||||
function! ale_linters#qml#qmllint#Handle(buffer, lines) abort
|
||||
let l:pattern = '\v^[/_-a-zA-z0-9\. ]+:(\d+) : (.*)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:item = {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'col': 0,
|
||||
\ 'text': l:match[2],
|
||||
\ 'type': 'E',
|
||||
\}
|
||||
call add(l:output, l:item)
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('qml', {
|
||||
\ 'name': 'qmllint',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'qmllint',
|
||||
\ 'command': 'qmllint %t',
|
||||
\ 'callback': 'ale_linters#qml#qmllint#Handle',
|
||||
\})
|
||||
@@ -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', {
|
||||
|
||||
9
ale_linters/text/textlint.vim
Normal file
9
ale_linters/text/textlint.vim
Normal file
@@ -0,0 +1,9 @@
|
||||
" Author: Yasuhiro Kiyota <yasuhiroki.duck@gmail.com>
|
||||
" Description: textlint, a proofreading tool (https://textlint.github.io/)
|
||||
|
||||
call ale#linter#Define('text', {
|
||||
\ 'name': 'textlint',
|
||||
\ 'executable_callback': 'ale#handlers#textlint#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#textlint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#textlint#HandleTextlintOutput',
|
||||
\})
|
||||
@@ -70,7 +70,7 @@ function! ale_linters#typescript#tslint#GetCommand(buffer) abort
|
||||
\ : ''
|
||||
|
||||
return ale#path#BufferCdString(a:buffer)
|
||||
\ . ale_linters#typescript#tslint#GetExecutable(a:buffer)
|
||||
\ . ale#Escape(ale_linters#typescript#tslint#GetExecutable(a:buffer))
|
||||
\ . ' --format json'
|
||||
\ . l:tslint_config_option
|
||||
\ . l:tslint_rules_option
|
||||
|
||||
@@ -33,6 +33,10 @@ endfunction
|
||||
|
||||
" Return 1 if a file is too large for ALE to handle.
|
||||
function! ale#FileTooLarge() abort
|
||||
if !exists('g:ale_maximum_file_size')
|
||||
return 0
|
||||
endif
|
||||
|
||||
let l:max = ale#Var(bufnr(''), 'maximum_file_size')
|
||||
|
||||
return l:max > 0 ? (line2byte(line('$') + 1) > l:max) : 0
|
||||
@@ -46,13 +50,18 @@ function! ale#ShouldDoNothing(buffer) abort
|
||||
" The checks are split into separate if statements to make it possible to
|
||||
" profile each check individually with Vim's profiling tools.
|
||||
|
||||
" Do nothing if ALE is disabled.
|
||||
if !getbufvar(a:buffer, 'ale_enabled', get(g:, 'ale_enabled', 0))
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Don't perform any checks when newer NeoVim versions are exiting.
|
||||
if get(v:, 'exiting', v:null) isnot v:null
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Do nothing for blacklisted files
|
||||
if index(g:ale_filetype_blacklist, getbufvar(a:buffer, '&filetype')) >= 0
|
||||
if index(get(g:, 'ale_filetype_blacklist', []), getbufvar(a:buffer, '&filetype')) >= 0
|
||||
return 1
|
||||
endif
|
||||
|
||||
@@ -72,11 +81,6 @@ function! ale#ShouldDoNothing(buffer) abort
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Do nothing if ALE is disabled.
|
||||
if !ale#Var(a:buffer, 'enabled')
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Do nothing if the file is too large.
|
||||
if ale#FileTooLarge()
|
||||
return 1
|
||||
|
||||
@@ -2,6 +2,13 @@
|
||||
" Description: balloonexpr support for ALE.
|
||||
|
||||
function! ale#balloon#MessageForPos(bufnr, lnum, col) abort
|
||||
" Don't show balloons if they are disabled, or linting is disabled.
|
||||
if !ale#Var(a:bufnr, 'set_balloons')
|
||||
\|| !g:ale_enabled
|
||||
\|| !getbufvar(a:bufnr, 'ale_enabled', 1)
|
||||
return ''
|
||||
endif
|
||||
|
||||
let l:loclist = get(g:ale_buffer_info, a:bufnr, {'loclist': []}).loclist
|
||||
let l:index = ale#util#BinarySearch(l:loclist, a:bufnr, a:lnum, a:col)
|
||||
|
||||
@@ -13,7 +20,7 @@ function! ale#balloon#Expr() abort
|
||||
endfunction
|
||||
|
||||
function! ale#balloon#Disable() abort
|
||||
set noballooneval
|
||||
set noballooneval balloonexpr=
|
||||
endfunction
|
||||
|
||||
function! ale#balloon#Enable() 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.
|
||||
@@ -349,9 +366,6 @@ function! s:RemapItemTypes(type_map, loclist) abort
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" Save the temporary directory so we can figure out if files are in it.
|
||||
let s:temp_dir = fnamemodify(tempname(), ':h')
|
||||
|
||||
function! ale#engine#FixLocList(buffer, linter_name, loclist) abort
|
||||
let l:bufnr_map = {}
|
||||
let l:new_loclist = []
|
||||
@@ -512,7 +526,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 +717,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)
|
||||
|
||||
@@ -54,6 +54,8 @@ function! ale#fix#ApplyQueuedFixes() abort
|
||||
let l:should_lint = l:data.changes_made
|
||||
endif
|
||||
|
||||
silent doautocmd <nomodeline> User ALEFixPost
|
||||
|
||||
" If ALE linting is enabled, check for problems with the file again after
|
||||
" fixing problems.
|
||||
if g:ale_enabled
|
||||
@@ -222,7 +224,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 +394,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 +435,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',
|
||||
@@ -457,6 +465,8 @@ function! ale#fix#Fix(...) abort
|
||||
call ale#fix#RemoveManagedFiles(l:buffer)
|
||||
call ale#fix#InitBufferData(l:buffer, l:fixing_flag)
|
||||
|
||||
silent doautocmd <nomodeline> User ALEFixPre
|
||||
|
||||
call s:RunFixer({
|
||||
\ 'buffer': l:buffer,
|
||||
\ 'input': g:ale_fix_buffer_data[l:buffer].lines_before,
|
||||
|
||||
@@ -23,6 +23,12 @@ let s:default_registry = {
|
||||
\ 'description': 'Apply prettier-standard to a file.',
|
||||
\ 'aliases': ['prettier-standard'],
|
||||
\ },
|
||||
\ 'elm-format': {
|
||||
\ 'function': 'ale#fixers#elm_format#Fix',
|
||||
\ 'suggested_filetypes': ['elm'],
|
||||
\ 'description': 'Apply elm-format to a file.',
|
||||
\ 'aliases': ['format'],
|
||||
\ },
|
||||
\ 'eslint': {
|
||||
\ 'function': 'ale#fixers#eslint#Fix',
|
||||
\ 'suggested_filetypes': ['javascript', 'typescript'],
|
||||
@@ -33,11 +39,6 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['elixir'],
|
||||
\ 'description': 'Apply mix format to a file.',
|
||||
\ },
|
||||
\ 'format': {
|
||||
\ 'function': 'ale#fixers#format#Fix',
|
||||
\ 'suggested_filetypes': ['elm'],
|
||||
\ 'description': 'Apply elm-format to a file.',
|
||||
\ },
|
||||
\ 'isort': {
|
||||
\ 'function': 'ale#fixers#isort#Fix',
|
||||
\ 'suggested_filetypes': ['python'],
|
||||
@@ -45,7 +46,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': {
|
||||
@@ -84,6 +85,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['ruby'],
|
||||
\ 'description': 'Fix ruby files with rubocop --auto-correct.',
|
||||
\ },
|
||||
\ 'rufo': {
|
||||
\ 'function': 'ale#fixers#rufo#Fix',
|
||||
\ 'suggested_filetypes': ['ruby'],
|
||||
\ 'description': 'Fix ruby files with rufo',
|
||||
\ },
|
||||
\ 'standard': {
|
||||
\ 'function': 'ale#fixers#standard#Fix',
|
||||
\ 'suggested_filetypes': ['javascript'],
|
||||
@@ -104,6 +110,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 +170,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.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
" Author: eborden <evan@evan-borden.com>
|
||||
" Author: eborden <evan@evan-borden.com>, ifyouseewendy <ifyouseewendy@gmail.com>, aspidiets <emarshall85@gmail.com>
|
||||
" Description: Integration of brittany with ALE.
|
||||
|
||||
call ale#Set('haskell_brittany_executable', 'brittany')
|
||||
@@ -8,6 +8,7 @@ function! ale#fixers#brittany#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' --write-mode inplace'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
@@ -5,17 +5,17 @@ call ale#Set('elm_format_executable', 'elm-format')
|
||||
call ale#Set('elm_format_use_global', 0)
|
||||
call ale#Set('elm_format_options', '--yes')
|
||||
|
||||
function! ale#fixers#format#GetExecutable(buffer) abort
|
||||
function! ale#fixers#elm_format#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'elm_format', [
|
||||
\ 'node_modules/.bin/elm-format',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#format#Fix(buffer) abort
|
||||
function! ale#fixers#elm_format#Fix(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'elm_format_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(ale#fixers#format#GetExecutable(a:buffer))
|
||||
\ 'command': ale#Escape(ale#fixers#elm_format#GetExecutable(a:buffer))
|
||||
\ . ' %t'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\ 'read_temporary_file': 1,
|
||||
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
|
||||
@@ -1,16 +1,25 @@
|
||||
" Author: carakan <carakan@gmail.com>
|
||||
" Author: carakan <carakan@gmail.com>, Fernando Mendes <fernando@mendes.codes>
|
||||
" Description: Fixing files with elixir formatter 'mix format'.
|
||||
|
||||
call ale#Set('elixir_mix_executable', 'mix')
|
||||
call ale#Set('elixir_mix_format_options', '')
|
||||
|
||||
function! ale#fixers#mix_format#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'elixir_mix_executable')
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#mix_format#GetCommand(buffer) abort
|
||||
let l:executable = ale#Escape(ale#fixers#mix_format#GetExecutable(a:buffer))
|
||||
let l:options = ale#Var(a:buffer, 'elixir_mix_format_options')
|
||||
|
||||
return l:executable . ' format'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#mix_format#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(ale#fixers#mix_format#GetExecutable(a:buffer))
|
||||
\ . ' format %t',
|
||||
\ 'command': ale#fixers#mix_format#GetCommand(a:buffer),
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
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
|
||||
|
||||
|
||||
|
||||
20
autoload/ale/fixers/rufo.vim
Normal file
20
autoload/ale/fixers/rufo.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" Author: Fohte (Hayato Kawai) https://github.com/fohte
|
||||
" Description: Integration of Rufo with ALE.
|
||||
|
||||
call ale#Set('ruby_rufo_executable', 'rufo')
|
||||
|
||||
function! ale#fixers#rufo#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_rufo_executable')
|
||||
let l:exec_args = l:executable =~? 'bundle$'
|
||||
\ ? ' exec rufo'
|
||||
\ : ''
|
||||
|
||||
return ale#Escape(l:executable) . l:exec_args . ' %t'
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#rufo#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#fixers#rufo#GetCommand(a:buffer),
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
47
autoload/ale/handlers/flawfinder.vim
Normal file
47
autoload/ale/handlers/flawfinder.vim
Normal file
@@ -0,0 +1,47 @@
|
||||
" Author: Christian Gibbons <cgibbons@gmu.edu>
|
||||
" Description: This file defines a handler function that should work for the
|
||||
" flawfinder format with the -CDQS flags.
|
||||
|
||||
" Swiped this function from the GCC handler. Not sure if needed, but doesn't
|
||||
" hurt to have it.
|
||||
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#flawfinder#HandleFlawfinderFormat(buffer, lines) abort
|
||||
" Look for lines like the following.
|
||||
"
|
||||
" <stdin>:12:4: [2] (buffer) char:Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length.
|
||||
" <stdin>:31:4: [1] (buffer) strncpy:Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120).
|
||||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+)?:? ( \[[0-5]\] [^:]+):(.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
" Use severity level to determine if it should be considered a warning
|
||||
" or error.
|
||||
let l:severity = str2nr(matchstr(split(l:match[4])[0], '[0-5]'))
|
||||
|
||||
let l:item = {
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'col': str2nr(l:match[3]),
|
||||
\ 'type': (l:severity < ale#Var(a:buffer, 'c_flawfinder_error_severity'))
|
||||
\ ? 'W' : 'E',
|
||||
\ 'text': s:RemoveUnicodeQuotes(join(split(l:match[4])[1:]) . ': ' . l:match[5]),
|
||||
\}
|
||||
|
||||
" If the filename is something like <stdin>, <nofile> or -, then
|
||||
" this is an error for the file we checked.
|
||||
if l:match[1] isnot# '-' && l:match[1][0] isnot# '<'
|
||||
let l:item['filename'] = l:match[1]
|
||||
endif
|
||||
|
||||
call add(l:output, l:item)
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
25
autoload/ale/handlers/gawk.vim
Normal file
25
autoload/ale/handlers/gawk.vim
Normal file
@@ -0,0 +1,25 @@
|
||||
" Author: Anthony DeDominic <adedomin@gmail.com>
|
||||
" Description: Handle output from gawk's --lint option
|
||||
|
||||
function! ale#handlers#gawk#HandleGawkFormat(buffer, lines) abort
|
||||
" Look for lines like the following:
|
||||
" gawk: /tmp/v0fddXz/1/something.awk:1: ^ invalid char ''' in expression
|
||||
let l:pattern = '^.\{-}:\(\d\+\):\s\+\(warning:\|\^\)\s*\(.*\)'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:ecode = 'E'
|
||||
if l:match[2] is? 'warning:'
|
||||
let l:ecode = 'W'
|
||||
endif
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'col': 0,
|
||||
\ 'text': l:match[3],
|
||||
\ 'code': 0,
|
||||
\ 'type': l:ecode,
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
25
autoload/ale/handlers/go.vim
Normal file
25
autoload/ale/handlers/go.vim
Normal file
@@ -0,0 +1,25 @@
|
||||
" Author: neersighted <bjorn@neersighted.com>
|
||||
" Description: go vet for Go files
|
||||
"
|
||||
" Author: John Eikenberry <jae@zhar.net>
|
||||
" Description: updated to work with go1.10
|
||||
"
|
||||
" Author: Ben Paxton <ben@gn32.uk>
|
||||
" Description: moved to generic Golang file from govet
|
||||
|
||||
function! ale#handlers#go#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
|
||||
17
autoload/ale/handlers/markdownlint.vim
Normal file
17
autoload/ale/handlers/markdownlint.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
" Author: Ty-Lucas Kelley <tylucaskelley@gmail.com>
|
||||
" Description: Adds support for markdownlint
|
||||
|
||||
function! ale#handlers#markdownlint#Handle(buffer, lines) abort
|
||||
let l:pattern=': \(\d*\): \(MD\d\{3}\)\(\/\)\([A-Za-z0-9-]\+\)\(.*\)$'
|
||||
let l:output=[]
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'text': '(' . l:match[2] . l:match[3] . l:match[4] . ')' . l:match[5],
|
||||
\ 'type': 'W',
|
||||
\ })
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
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
|
||||
@@ -25,6 +25,30 @@ function! ale#handlers#redpen#HandleRedpenOutput(buffer, lines) abort
|
||||
let l:item.lnum = l:err.lineNum
|
||||
let l:item.col = l:err.sentenceStartColumnNum + 1
|
||||
endif
|
||||
|
||||
" Adjust column number for multibyte string
|
||||
let l:line = getline(l:item.lnum)
|
||||
if l:line is# ''
|
||||
let l:line = l:err.sentence
|
||||
endif
|
||||
let l:line = split(l:line, '\zs')
|
||||
|
||||
if l:item.col >= 2
|
||||
let l:col = 0
|
||||
for l:strlen in map(l:line[0:(l:item.col - 2)], 'strlen(v:val)')
|
||||
let l:col = l:col + l:strlen
|
||||
endfor
|
||||
let l:item.col = l:col + 1
|
||||
endif
|
||||
|
||||
if has_key(l:item, 'end_col')
|
||||
let l:col = 0
|
||||
for l:strlen in map(l:line[0:(l:item.end_col - 1)], 'strlen(v:val)')
|
||||
let l:col = l:col + l:strlen
|
||||
endfor
|
||||
let l:item.end_col = l:col
|
||||
endif
|
||||
|
||||
call add(l:output, l:item)
|
||||
endfor
|
||||
return l:output
|
||||
|
||||
39
autoload/ale/handlers/textlint.vim
Normal file
39
autoload/ale/handlers/textlint.vim
Normal file
@@ -0,0 +1,39 @@
|
||||
" Author: tokida https://rouger.info, Yasuhiro Kiyota <yasuhiroki.duck@gmail.com>
|
||||
" Description: textlint, a proofreading tool (https://textlint.github.io/)
|
||||
|
||||
call ale#Set('textlint_executable', 'textlint')
|
||||
call ale#Set('textlint_use_global', 0)
|
||||
call ale#Set('textlint_options', '')
|
||||
|
||||
function! ale#handlers#textlint#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'textlint', [
|
||||
\ 'node_modules/.bin/textlint',
|
||||
\ 'node_modules/textlint/bin/textlint.js',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#textlint#GetCommand(buffer) abort
|
||||
let l:executable = ale#handlers#textlint#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'textlint_options')
|
||||
|
||||
return ale#node#Executable(a:buffer, l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' -f json --stdin --stdin-filename %s'
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#textlint#HandleTextlintOutput(buffer, lines) abort
|
||||
let l:res = get(ale#util#FuzzyJSONDecode(a:lines, []), 0, {'messages': []})
|
||||
let l:output = []
|
||||
|
||||
for l:err in l:res.messages
|
||||
call add(l:output, {
|
||||
\ 'text': l:err.message,
|
||||
\ 'type': 'W',
|
||||
\ 'code': l:err.ruleId,
|
||||
\ 'lnum': l:err.line,
|
||||
\ 'col' : l:err.column
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
@@ -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 /s/c "' . a:command . '"'
|
||||
if has('win32')
|
||||
return 'cmd /s/c "' . l:command . '"'
|
||||
endif
|
||||
|
||||
if &shell =~? 'fish$'
|
||||
return ['/bin/sh', '-c', a:command]
|
||||
if &shell =~? 'fish$\|pwsh$'
|
||||
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
|
||||
|
||||
|
||||
@@ -84,12 +84,12 @@ function! ale#path#IsAbsolute(filename) abort
|
||||
return a:filename[:0] is# '/' || a:filename[1:2] is# ':\'
|
||||
endfunction
|
||||
|
||||
let s:temp_dir = fnamemodify(tempname(), ':h')
|
||||
let s:temp_dir = ale#path#Simplify(fnamemodify(tempname(), ':h'))
|
||||
|
||||
" Given a filename, return 1 if the file represents some temporary file
|
||||
" created by Vim.
|
||||
function! ale#path#IsTempName(filename) abort
|
||||
return a:filename[:len(s:temp_dir) - 1] is# s:temp_dir
|
||||
return ale#path#Simplify(a:filename)[:len(s:temp_dir) - 1] is# s:temp_dir
|
||||
endfunction
|
||||
|
||||
" Given a base directory, which must not have a trailing slash, and a
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -84,10 +84,6 @@ function! s:EnablePreamble() abort
|
||||
|
||||
" Lint immediately, including running linters against the file.
|
||||
call ale#Queue(0, 'lint_file')
|
||||
|
||||
if g:ale_set_balloons
|
||||
call ale#balloon#Enable()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:DisablePostamble() abort
|
||||
@@ -95,10 +91,6 @@ function! s:DisablePostamble() abort
|
||||
if g:ale_set_highlights
|
||||
call ale#highlight#UpdateHighlights()
|
||||
endif
|
||||
|
||||
if g:ale_set_balloons
|
||||
call ale#balloon#Disable()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:CleanupEveryBuffer() abort
|
||||
@@ -121,9 +113,17 @@ function! ale#toggle#Toggle() abort
|
||||
|
||||
if g:ale_enabled
|
||||
call s:EnablePreamble()
|
||||
|
||||
if g:ale_set_balloons
|
||||
call ale#balloon#Enable()
|
||||
endif
|
||||
else
|
||||
call s:CleanupEveryBuffer()
|
||||
call s:DisablePostamble()
|
||||
|
||||
if has('balloon_eval')
|
||||
call ale#balloon#Disable()
|
||||
endif
|
||||
endif
|
||||
|
||||
call ale#toggle#InitAuGroups()
|
||||
|
||||
@@ -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,41 @@ 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.
|
||||
|
||||
g:ale_c_flawfinder_error_severity *g:ale_c_flawfinder_error_severity*
|
||||
*b:ale_c_flawfinder_error_severity*
|
||||
Type: |Number|
|
||||
Default: `6`
|
||||
|
||||
This variable can be changed to set the minimum severity to be treated as an
|
||||
error. This setting also applies to flawfinder for c++.
|
||||
|
||||
|
||||
===============================================================================
|
||||
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*
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ mcsc *ale-cs-mcsc*
|
||||
The paths to search for additional assembly files can be specified using the
|
||||
|g:ale_cs_mcsc_assembly_path| or |b:ale_cs_mcsc_assembly_path| variables.
|
||||
|
||||
NOTE: ALE will not any errors in files apart from syntax errors if any one
|
||||
of the source files contains a syntax error. Syntax errors must be fixed
|
||||
NOTE: ALE will not find any errors in files apart from syntax errors if any
|
||||
one of the source files contains a syntax error. Syntax errors must be fixed
|
||||
first before other errors will be shown.
|
||||
|
||||
|
||||
@@ -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,32 @@ g:ale_elixir_mix_options *g:ale_elixir_mix_options*
|
||||
|
||||
This variable can be changed to specify the mix executable.
|
||||
|
||||
===============================================================================
|
||||
mix_format *ale-elixir-mix-format*
|
||||
|
||||
g:ale_elixir_mix_format_options *g:ale_elixir_mix_format_options*
|
||||
*b:ale_elixir_mix_format_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
|
||||
This variable can be changed to specify the mix options passed to the
|
||||
mix_format fixer
|
||||
|
||||
===============================================================================
|
||||
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,37 @@
|
||||
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.
|
||||
|
||||
|
||||
===============================================================================
|
||||
textlint *ale-markdown-textlint*
|
||||
|
||||
See |ale-text-textlint|
|
||||
|
||||
|
||||
===============================================================================
|
||||
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:
|
||||
|
||||
@@ -86,5 +86,17 @@ g:ale_ruby_ruby_executable *g:ale_ruby_ruby_executable*
|
||||
This variable can be changed to use a different executable for ruby.
|
||||
|
||||
|
||||
===============================================================================
|
||||
rufo *ale-ruby-rufo*
|
||||
|
||||
g:ale_ruby_rufo_executable *g:ale_ruby_rufo_executable*
|
||||
*b:ale_ruby_rufo_executable*
|
||||
Type: String
|
||||
Default: `'rufo'`
|
||||
|
||||
Override the invoked rufo binary. This is useful for running rufo from
|
||||
binstubs or a bundle.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user