mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 05:04:28 +08:00
Compare commits
149 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a4456cf2a | ||
|
|
8a9b28daf9 | ||
|
|
6f2d868baf | ||
|
|
023ade872e | ||
|
|
5f5540c574 | ||
|
|
5ed99734bd | ||
|
|
03973c0d09 | ||
|
|
fa30d90221 | ||
|
|
d0e3302253 | ||
|
|
209cd54783 | ||
|
|
fefb8efff8 | ||
|
|
41178425ab | ||
|
|
73d8c3b80a | ||
|
|
65880fec78 | ||
|
|
217284360d | ||
|
|
e3c81911d6 | ||
|
|
9ef266d050 | ||
|
|
a728f074f7 | ||
|
|
94270402cb | ||
|
|
ccbdfcd76f | ||
|
|
de6cd961a8 | ||
|
|
6b3086237a | ||
|
|
cb8ad9fbd8 | ||
|
|
e6bd4373f9 | ||
|
|
649934230b | ||
|
|
5ff4e27e17 | ||
|
|
238201805d | ||
|
|
5f024eda09 | ||
|
|
04362c746d | ||
|
|
e722841fa3 | ||
|
|
2768bf15ba | ||
|
|
589c8dbd94 | ||
|
|
2ac9e454d6 | ||
|
|
3aa5e0f9dc | ||
|
|
c1fee3f23a | ||
|
|
9a389b564c | ||
|
|
3e8ae65278 | ||
|
|
ab5e44249d | ||
|
|
399a0d3c98 | ||
|
|
16d0c52d24 | ||
|
|
1e6b1d9be2 | ||
|
|
ac4bac8ea4 | ||
|
|
a7b8cb4fe3 | ||
|
|
daab1a08db | ||
|
|
f8e61ff907 | ||
|
|
eb38c4b3f1 | ||
|
|
c2cfe2326d | ||
|
|
8517e901ff | ||
|
|
79ffdde267 | ||
|
|
c52fffcd47 | ||
|
|
845e588b71 | ||
|
|
0012c78b02 | ||
|
|
4ed35f7247 | ||
|
|
c4cb1c7050 | ||
|
|
c57b031876 | ||
|
|
06132954b1 | ||
|
|
9f8c37e17c | ||
|
|
3418574770 | ||
|
|
d368f090ae | ||
|
|
95be2bf1ff | ||
|
|
d7d54d09da | ||
|
|
338c233710 | ||
|
|
9ade656661 | ||
|
|
44397dd6db | ||
|
|
2a861dfd40 | ||
|
|
d9579dbbe9 | ||
|
|
11339ca730 | ||
|
|
e3749c4a75 | ||
|
|
f6d18a0b10 | ||
|
|
7bf3a749d0 | ||
|
|
3e4db9ed5c | ||
|
|
0e71e8b465 | ||
|
|
846bfb47b2 | ||
|
|
81a8c77d20 | ||
|
|
9c849da8c4 | ||
|
|
9b4963847d | ||
|
|
6dc737cda1 | ||
|
|
899b61c5cc | ||
|
|
f937b98e27 | ||
|
|
baa44bb3a7 | ||
|
|
8980591937 | ||
|
|
8062d6207e | ||
|
|
6c10be8992 | ||
|
|
014c924630 | ||
|
|
04fbea6e80 | ||
|
|
0d37aaac7a | ||
|
|
ac6bc6d0ae | ||
|
|
ad986a8d82 | ||
|
|
e8bea510df | ||
|
|
61a5880747 | ||
|
|
324838adae | ||
|
|
27f1915745 | ||
|
|
dfa38ff0dd | ||
|
|
5453e0e1a4 | ||
|
|
7952ebe77e | ||
|
|
a01fab2ee6 | ||
|
|
37df1f8ceb | ||
|
|
aa54c10bae | ||
|
|
2a081e81db | ||
|
|
f235c4b3b9 | ||
|
|
8b707b4cdc | ||
|
|
b413e03b69 | ||
|
|
dbf051e62b | ||
|
|
f369aa65a2 | ||
|
|
fcd62342d5 | ||
|
|
6e1a5d4189 | ||
|
|
b2e2bbd042 | ||
|
|
d9e12cb047 | ||
|
|
d3ed1e52ba | ||
|
|
72f002de94 | ||
|
|
8141ced0d0 | ||
|
|
5df735555c | ||
|
|
a42999a639 | ||
|
|
976c048e6e | ||
|
|
870e75eb64 | ||
|
|
5155a35a80 | ||
|
|
a782e06223 | ||
|
|
6d6cd6663e | ||
|
|
021f59b3f4 | ||
|
|
d22b9bf1a6 | ||
|
|
ac0abc7c1f | ||
|
|
6ef31073dd | ||
|
|
0de3d24338 | ||
|
|
c9a6b04dc7 | ||
|
|
c1a2aa27f3 | ||
|
|
4999ad7e78 | ||
|
|
344e0fec97 | ||
|
|
6b20c906b3 | ||
|
|
eda3878a6c | ||
|
|
cb8643ce74 | ||
|
|
1e9b36cdbf | ||
|
|
0dd356aa52 | ||
|
|
d5b4f6f7e7 | ||
|
|
da692b2e2d | ||
|
|
f78db619d4 | ||
|
|
9ca133feb0 | ||
|
|
f002c2c9f0 | ||
|
|
fd42e8e935 | ||
|
|
d49daeb816 | ||
|
|
b8591e1034 | ||
|
|
6dc69b2144 | ||
|
|
14025c725f | ||
|
|
13a8f9c061 | ||
|
|
3251d95a91 | ||
|
|
42ae06a288 | ||
|
|
9ddf1b6a05 | ||
|
|
00a3859304 | ||
|
|
ca7fa31c61 | ||
|
|
cf174d3b9b |
2
CONTRIBUTING.md → .github/CONTRIBUTING.md
vendored
2
CONTRIBUTING.md → .github/CONTRIBUTING.md
vendored
@@ -3,7 +3,7 @@
|
||||
Have fun, and work on whatever floats your boat. Take It Easy :tm:.
|
||||
|
||||
For help with contributing to ALE, see `:help ale-development` in Vim, or view
|
||||
the help file online [here](/w0rp/ale/blob/master/doc/ale-development.txt).
|
||||
the help file online [here](/doc/ale-development.txt).
|
||||
|
||||
## Creating Issues
|
||||
|
||||
@@ -3,5 +3,10 @@ sudo: required
|
||||
services:
|
||||
- docker
|
||||
language: generic
|
||||
env:
|
||||
- OPTIONS=--vim-80-only
|
||||
- OPTIONS=--vim-81-only
|
||||
- OPTIONS=--neovim-only
|
||||
- OPTIONS=--linters-only
|
||||
script: |
|
||||
./run-tests -v
|
||||
./run-tests -v $OPTIONS
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
FROM tweekmonster/vim-testbed:latest
|
||||
|
||||
RUN install_vim -tag v8.0.0027 -build \
|
||||
-tag v8.1.0204 -build \
|
||||
-tag neovim:v0.2.0 -build \
|
||||
-tag neovim:v0.3.0 -build
|
||||
|
||||
|
||||
23
README.md
23
README.md
@@ -4,7 +4,8 @@
|
||||

|
||||
|
||||
ALE (Asynchronous Lint Engine) is a plugin for providing linting in NeoVim
|
||||
0.2.0+ and Vim 8 while you edit your text files.
|
||||
0.2.0+ and Vim 8 while you edit your text files, and acts as a Vim
|
||||
[Language Server Protocol](https://langserver.org/) client.
|
||||
|
||||

|
||||
|
||||
@@ -96,7 +97,7 @@ formatting.
|
||||
| Awk | [gawk](https://www.gnu.org/software/gawk/)|
|
||||
| Bash | [language-server](https://github.com/mads-hartmann/bash-language-server), 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), [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 | [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint), [clang](http://clang.llvm.org/), [clangd](https://clang.llvm.org/extra/clangd.html), [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html), [cquery](https://github.com/cquery-project/cquery), [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) !!, [cquery](https://github.com/cquery-project/cquery), [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|
|
||||
@@ -118,29 +119,30 @@ formatting.
|
||||
| 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/) |
|
||||
| Fortran | [gcc](https://gcc.gnu.org/), [language_server](https://github.com/hansec/fortran-language-server) |
|
||||
| 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), [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) |
|
||||
| Hack | [hack](http://hacklang.org/), [hackfmt](https://github.com/facebook/hhvm/tree/master/hphp/hack/hackfmt), [hhast](https://github.com/hhvm/hhast) (disabled by default; see `:help ale-integration-hack`) |
|
||||
| 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) |
|
||||
| Haskell | [brittany](https://github.com/lspitzner/brittany), [ghc](https://www.haskell.org/ghc/), [cabal-ghc](https://www.haskell.org/cabal/), [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), [hie](https://github.com/haskell/haskell-ide-engine) |
|
||||
| HTML | [alex](https://github.com/wooorm/alex) !!, [HTMLHint](http://htmlhint.com/), [proselint](http://proselint.com/), [tidy](http://www.html-tidy.org/), [write-good](https://github.com/btford/write-good) |
|
||||
| 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), [PMD](https://pmd.github.io/) |
|
||||
| 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-cli), [prettier-standard](https://github.com/sheerun/prettier-standard), [standard](http://standardjs.com/), [xo](https://github.com/sindresorhus/xo)
|
||||
| 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 |
|
||||
| Kotlin | [kotlinc](https://kotlinlang.org) !!, [ktlint](https://ktlint.github.io) !!, [languageserver](https://github.com/fwcd/KotlinLanguageServer) 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 | [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) !!, [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) |
|
||||
| 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) |
|
||||
| Mercury | [mmc](http://mercurylang.org) !! |
|
||||
| NASM | [nasm](https://www.nasm.us/) !! |
|
||||
@@ -151,14 +153,14 @@ 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), [perltidy](https://metacpan.org/pod/distribution/Perl-Tidy/bin/perltidy) |
|
||||
| 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/) |
|
||||
| PHP | [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), [black](https://github.com/ambv/black), [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), [pyre](https://github.com/facebook/pyre-check), [pylint](https://www.pylint.org/) !!, [yapf](https://github.com/google/yapf) |
|
||||
| Puppet | [languageserver](https://github.com/lingua-pupuli/puppet-editor-services), [puppet](https://puppet.com), [puppet-lint](https://puppet-lint.com) |
|
||||
| Python | [autopep8](https://github.com/hhatto/autopep8), [black](https://github.com/ambv/black), [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), [pyre](https://github.com/facebook/pyre-check), [pylint](https://www.pylint.org/) !!, [vulture](https://github.com/jendrikseipp/vulture) !!, [yapf](https://github.com/google/yapf) |
|
||||
| QML | [qmlfmt](https://github.com/jesperhh/qmlfmt), [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-reasonml-ols` for configuration instructions, [ols](https://github.com/freebroccolo/ocaml-language-server), [refmt](https://github.com/reasonml/reason-cli) |
|
||||
@@ -185,10 +187,11 @@ formatting.
|
||||
| Verilog | [iverilog](https://github.com/steveicarus/iverilog), [verilator](http://www.veripool.org/projects/verilator/wiki/Intro) |
|
||||
| Vim | [vint](https://github.com/Kuniwak/vint) |
|
||||
| Vim help^ | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
||||
| Vue | [prettier](https://github.com/prettier/prettier) |
|
||||
| Vue | [prettier](https://github.com/prettier/prettier), [vls](https://github.com/vuejs/vetur/tree/master/server) |
|
||||
| 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/) |
|
||||
| YANG | [yang-lsp](https://github.com/theia-ide/yang-lsp) |
|
||||
|
||||
<a name="usage"></a>
|
||||
|
||||
|
||||
@@ -31,6 +31,6 @@ call ale#linter#Define('apiblueprint', {
|
||||
\ 'name': 'drafter',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'drafter',
|
||||
\ 'command': 'drafter --use-line-num --validate %t',
|
||||
\ 'command': 'drafter --use-line-num --validate',
|
||||
\ 'callback': 'ale_linters#apiblueprint#drafter#HandleErrors',
|
||||
\})
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for AsciiDoc files
|
||||
|
||||
call ale#linter#Define('asciidoc', {
|
||||
\ 'name': 'write-good',
|
||||
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
||||
\ 'callback': 'ale#handlers#writegood#Handle',
|
||||
\})
|
||||
4
ale_linters/asciidoc/writegood.vim
Normal file
4
ale_linters/asciidoc/writegood.vim
Normal file
@@ -0,0 +1,4 @@
|
||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for AsciiDoc files
|
||||
|
||||
call ale#handlers#writegood#DefineLinter('asciidoc')
|
||||
@@ -4,13 +4,8 @@
|
||||
call ale#Set('asm_gcc_executable', 'gcc')
|
||||
call ale#Set('asm_gcc_options', '-Wall')
|
||||
|
||||
function! ale_linters#asm#gcc#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'asm_gcc_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#asm#gcc#GetCommand(buffer) abort
|
||||
return ale#Escape(ale_linters#asm#gcc#GetExecutable(a:buffer))
|
||||
\ . ' -x assembler -fsyntax-only '
|
||||
return '%e -x assembler -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
|
||||
endfunction
|
||||
@@ -33,7 +28,7 @@ endfunction
|
||||
call ale#linter#Define('asm', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#asm#gcc#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('asm_gcc_executable'),
|
||||
\ 'command_callback': 'ale_linters#asm#gcc#GetCommand',
|
||||
\ 'callback': 'ale_linters#asm#gcc#Handle',
|
||||
\})
|
||||
|
||||
@@ -1,29 +1,21 @@
|
||||
" Author: kmarc <korondi.mark@gmail.com>
|
||||
" Description: This file adds support for using GNU awk with sripts.
|
||||
|
||||
let g:ale_awk_gawk_executable =
|
||||
\ get(g:, 'ale_awk_gawk_executable', 'gawk')
|
||||
|
||||
let g:ale_awk_gawk_options =
|
||||
\ get(g:, 'ale_awk_gawk_options', '')
|
||||
|
||||
function! ale_linters#awk#gawk#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'awk_gawk_executable')
|
||||
endfunction
|
||||
call ale#Set('awk_gawk_executable', 'gawk')
|
||||
call ale#Set('awk_gawk_options', '')
|
||||
|
||||
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'
|
||||
return '%e --source ' . ale#Escape('BEGIN { exit } END { exit 1 }')
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'awk_gawk_options'))
|
||||
\ . ' -f %t --lint /dev/null'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('awk', {
|
||||
\ 'name': 'gawk',
|
||||
\ 'executable_callback': 'ale_linters#awk#gawk#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('awk_gawk_executable'),
|
||||
\ 'command_callback': 'ale_linters#awk#gawk#GetCommand',
|
||||
\ 'callback': 'ale#handlers#gawk#HandleGawkFormat',
|
||||
\ 'output_stream': 'both'
|
||||
|
||||
@@ -4,29 +4,24 @@
|
||||
call ale#Set('c_clang_executable', 'clang')
|
||||
call ale#Set('c_clang_options', '-std=c11 -Wall')
|
||||
|
||||
function! ale_linters#c#clang#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'c_clang_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#c#clang#GetCommand(buffer, output) abort
|
||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||
|
||||
" -iquote with the directory the file is in makes #include work for
|
||||
" headers in the same directory.
|
||||
return ale#Escape(ale_linters#c#clang#GetExecutable(a:buffer))
|
||||
\ . ' -S -x c -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
|
||||
\ . l:cflags
|
||||
\ . ale#Var(a:buffer, 'c_clang_options') . ' -'
|
||||
return '%e -S -x c -fsyntax-only'
|
||||
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . ale#Pad(l:cflags)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'c_clang_options')) . ' -'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'clang',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#c#clang#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('c_clang_executable'),
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
|
||||
\ {'callback': 'ale_linters#c#clang#GetCommand'}
|
||||
\ ],
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
|
||||
22
ale_linters/c/clangd.vim
Normal file
22
ale_linters/c/clangd.vim
Normal file
@@ -0,0 +1,22 @@
|
||||
" Author: Andrey Melentyev <andrey.melentyev@protonmail.com>
|
||||
" Description: Clangd language server
|
||||
|
||||
call ale#Set('c_clangd_executable', 'clangd')
|
||||
call ale#Set('c_clangd_options', '')
|
||||
|
||||
function! ale_linters#c#clangd#GetProjectRoot(buffer) abort
|
||||
let l:project_root = ale#path#FindNearestFile(a:buffer, 'compile_commands.json')
|
||||
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#c#clangd#GetCommand(buffer) abort
|
||||
return '%e' . ale#Pad(ale#Var(a:buffer, 'c_clangd_options'))
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'clangd',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('c_clangd_executable'),
|
||||
\ 'command_callback': 'ale_linters#c#clangd#GetCommand',
|
||||
\ 'project_root_callback': 'ale_linters#c#clangd#GetProjectRoot',
|
||||
\})
|
||||
@@ -16,10 +16,6 @@ call ale#Set('c_clangtidy_checks', ['*'])
|
||||
call ale#Set('c_clangtidy_options', '')
|
||||
call ale#Set('c_build_dir', '')
|
||||
|
||||
function! ale_linters#c#clangtidy#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'c_clangtidy_executable')
|
||||
endfunction
|
||||
|
||||
function! s:GetBuildDirectory(buffer) abort
|
||||
" Don't include build directory for header files, as compile_commands.json
|
||||
" files don't consider headers to be translation units, and provide no
|
||||
@@ -35,7 +31,7 @@ function! s:GetBuildDirectory(buffer) abort
|
||||
return l:build_dir
|
||||
endif
|
||||
|
||||
return ale#c#FindCompileCommands(a:buffer)
|
||||
return ale#path#Dirname(ale#c#FindCompileCommands(a:buffer))
|
||||
endfunction
|
||||
|
||||
function! ale_linters#c#clangtidy#GetCommand(buffer) abort
|
||||
@@ -47,7 +43,7 @@ function! ale_linters#c#clangtidy#GetCommand(buffer) abort
|
||||
\ ? ale#Var(a:buffer, 'c_clangtidy_options')
|
||||
\ : ''
|
||||
|
||||
return ale#Escape(ale_linters#c#clangtidy#GetExecutable(a:buffer))
|
||||
return '%e'
|
||||
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
|
||||
\ . ' %s'
|
||||
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||
@@ -57,7 +53,7 @@ endfunction
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'clangtidy',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable_callback': 'ale_linters#c#clangtidy#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('c_clangtidy_executable'),
|
||||
\ 'command_callback': 'ale_linters#c#clangtidy#GetCommand',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\ 'lint_file': 1,
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
call ale#Set('c_cppcheck_executable', 'cppcheck')
|
||||
call ale#Set('c_cppcheck_options', '--enable=style')
|
||||
|
||||
function! ale_linters#c#cppcheck#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'c_cppcheck_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#c#cppcheck#GetCommand(buffer) abort
|
||||
" Search upwards from the file for compile_commands.json.
|
||||
"
|
||||
@@ -23,8 +19,7 @@ function! ale_linters#c#cppcheck#GetCommand(buffer) abort
|
||||
\ : ''
|
||||
|
||||
return l:cd_command
|
||||
\ . ale#Escape(ale_linters#c#cppcheck#GetExecutable(a:buffer))
|
||||
\ . ' -q --language=c '
|
||||
\ . '%e -q --language=c '
|
||||
\ . l:compile_commands_option
|
||||
\ . ale#Var(a:buffer, 'c_cppcheck_options')
|
||||
\ . ' %t'
|
||||
@@ -33,7 +28,7 @@ endfunction
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'cppcheck',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'executable_callback': 'ale_linters#c#cppcheck#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('c_cppcheck_executable'),
|
||||
\ 'command_callback': 'ale_linters#c#cppcheck#GetCommand',
|
||||
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
||||
\})
|
||||
|
||||
23
ale_linters/c/cquery.vim
Normal file
23
ale_linters/c/cquery.vim
Normal file
@@ -0,0 +1,23 @@
|
||||
" Author: Ben Falconer <ben@falconers.me.uk>, jtalowell <jtalowell@protonmail.com>
|
||||
" Description: A language server for C
|
||||
|
||||
call ale#Set('c_cquery_executable', 'cquery')
|
||||
call ale#Set('c_cquery_cache_directory', expand('~/.cache/cquery'))
|
||||
|
||||
function! ale_linters#c#cquery#GetProjectRoot(buffer) abort
|
||||
let l:project_root = ale#path#FindNearestFile(a:buffer, 'compile_commands.json')
|
||||
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#c#cquery#GetInitializationOptions(buffer) abort
|
||||
return {'cacheDirectory': ale#Var(a:buffer, 'c_cquery_cache_directory')}
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'cquery',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('c_cquery_executable'),
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': 'ale_linters#c#cquery#GetProjectRoot',
|
||||
\ 'initialization_options_callback': 'ale_linters#c#cquery#GetInitializationOptions',
|
||||
\})
|
||||
@@ -6,18 +6,12 @@ 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')
|
||||
return '%e -CDQS'
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'c_flawfinder_options'))
|
||||
\ . l:minlevel
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
@@ -25,7 +19,7 @@ endfunction
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'flawfinder',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable_callback': 'ale_linters#c#flawfinder#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('c_flawfinder_executable'),
|
||||
\ 'command_callback': 'ale_linters#c#flawfinder#GetCommand',
|
||||
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
|
||||
\})
|
||||
|
||||
@@ -4,29 +4,24 @@
|
||||
call ale#Set('c_gcc_executable', 'gcc')
|
||||
call ale#Set('c_gcc_options', '-std=c11 -Wall')
|
||||
|
||||
function! ale_linters#c#gcc#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'c_gcc_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#c#gcc#GetCommand(buffer, output) abort
|
||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||
|
||||
" -iquote with the directory the file is in makes #include work for
|
||||
" headers in the same directory.
|
||||
return ale#Escape(ale_linters#c#gcc#GetExecutable(a:buffer))
|
||||
\ . ' -S -x c -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
|
||||
\ . l:cflags
|
||||
\ . ale#Var(a:buffer, 'c_gcc_options') . ' -'
|
||||
return '%e -S -x c -fsyntax-only'
|
||||
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . ale#Pad(l:cflags)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'c_gcc_options')) . ' -'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#c#gcc#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('c_gcc_executable'),
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
|
||||
\ {'callback': 'ale_linters#c#gcc#GetCommand'}
|
||||
\ ],
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
|
||||
@@ -6,17 +6,10 @@
|
||||
call ale#Set('chef_foodcritic_executable', 'foodcritic')
|
||||
call ale#Set('chef_foodcritic_options', '')
|
||||
|
||||
function! ale_linters#chef#foodcritic#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'chef_foodcritic_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#chef#foodcritic#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#chef#foodcritic#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'chef_foodcritic_options')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . escape(l:options, '~') : '')
|
||||
\ . ' %s'
|
||||
return '%e' . ale#Pad(escape(l:options, '~')) . ' %s'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#chef#foodcritic#Handle(buffer, lines) abort
|
||||
@@ -41,7 +34,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('chef', {
|
||||
\ 'name': 'foodcritic',
|
||||
\ 'executable_callback': 'ale_linters#chef#foodcritic#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('chef_foodcritic_executable'),
|
||||
\ 'command_callback': 'ale_linters#chef#foodcritic#GetCommand',
|
||||
\ 'callback': 'ale_linters#chef#foodcritic#Handle',
|
||||
\ 'lint_file': 1,
|
||||
|
||||
@@ -27,6 +27,6 @@ call ale#linter#Define('clojure', {
|
||||
\ 'name': 'joker',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'joker',
|
||||
\ 'command': 'joker --lint %t',
|
||||
\ 'command': 'joker --working-dir %s --lint %t',
|
||||
\ 'callback': 'ale_linters#clojure#joker#HandleJokerFormat',
|
||||
\})
|
||||
|
||||
@@ -4,29 +4,24 @@
|
||||
call ale#Set('cpp_clang_executable', 'clang++')
|
||||
call ale#Set('cpp_clang_options', '-std=c++14 -Wall')
|
||||
|
||||
function! ale_linters#cpp#clang#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'cpp_clang_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cpp#clang#GetCommand(buffer, output) abort
|
||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||
|
||||
" -iquote with the directory the file is in makes #include work for
|
||||
" headers in the same directory.
|
||||
return ale#Escape(ale_linters#cpp#clang#GetExecutable(a:buffer))
|
||||
\ . ' -S -x c++ -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
|
||||
\ . l:cflags
|
||||
\ . ale#Var(a:buffer, 'cpp_clang_options') . ' -'
|
||||
return '%e -S -x c++ -fsyntax-only'
|
||||
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . ale#Pad(l:cflags)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'cpp_clang_options')) . ' -'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'clang',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#cpp#clang#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_clang_executable'),
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
|
||||
\ {'callback': 'ale_linters#cpp#clang#GetCommand'},
|
||||
\ ],
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
|
||||
@@ -5,10 +5,6 @@ call ale#Set('cpp_clangcheck_executable', 'clang-check')
|
||||
call ale#Set('cpp_clangcheck_options', '')
|
||||
call ale#Set('c_build_dir', '')
|
||||
|
||||
function! ale_linters#cpp#clangcheck#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'cpp_clangcheck_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cpp#clangcheck#GetCommand(buffer) abort
|
||||
let l:user_options = ale#Var(a:buffer, 'cpp_clangcheck_options')
|
||||
|
||||
@@ -16,23 +12,22 @@ function! ale_linters#cpp#clangcheck#GetCommand(buffer) abort
|
||||
let l:build_dir = ale#Var(a:buffer, 'c_build_dir')
|
||||
|
||||
if empty(l:build_dir)
|
||||
let l:build_dir = ale#c#FindCompileCommands(a:buffer)
|
||||
let l:build_dir = ale#path#Dirname(ale#c#FindCompileCommands(a:buffer))
|
||||
endif
|
||||
|
||||
" The extra arguments in the command are used to prevent .plist files from
|
||||
" being generated. These are only added if no build directory can be
|
||||
" detected.
|
||||
return ale#Escape(ale_linters#cpp#clangcheck#GetExecutable(a:buffer))
|
||||
\ . ' -analyze %s'
|
||||
return '%e -analyze %s'
|
||||
\ . (empty(l:build_dir) ? ' -extra-arg -Xclang -extra-arg -analyzer-output=text' : '')
|
||||
\ . (!empty(l:user_options) ? ' ' . l:user_options : '')
|
||||
\ . ale#Pad(l:user_options)
|
||||
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'clangcheck',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#cpp#clangcheck#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_clangcheck_executable'),
|
||||
\ 'command_callback': 'ale_linters#cpp#clangcheck#GetCommand',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\ 'lint_file': 1,
|
||||
|
||||
@@ -10,10 +10,6 @@ call ale#Set('cpp_clangtidy_checks', ['*'])
|
||||
call ale#Set('cpp_clangtidy_options', '')
|
||||
call ale#Set('c_build_dir', '')
|
||||
|
||||
function! ale_linters#cpp#clangtidy#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'cpp_clangtidy_executable')
|
||||
endfunction
|
||||
|
||||
function! s:GetBuildDirectory(buffer) abort
|
||||
" Don't include build directory for header files, as compile_commands.json
|
||||
" files don't consider headers to be translation units, and provide no
|
||||
@@ -29,7 +25,7 @@ function! s:GetBuildDirectory(buffer) abort
|
||||
return l:build_dir
|
||||
endif
|
||||
|
||||
return ale#c#FindCompileCommands(a:buffer)
|
||||
return ale#path#Dirname(ale#c#FindCompileCommands(a:buffer))
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cpp#clangtidy#GetCommand(buffer) abort
|
||||
@@ -41,7 +37,7 @@ function! ale_linters#cpp#clangtidy#GetCommand(buffer) abort
|
||||
\ ? ale#Var(a:buffer, 'cpp_clangtidy_options')
|
||||
\ : ''
|
||||
|
||||
return ale#Escape(ale_linters#cpp#clangtidy#GetExecutable(a:buffer))
|
||||
return '%e'
|
||||
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
|
||||
\ . ' %s'
|
||||
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||
@@ -51,7 +47,7 @@ endfunction
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'clangtidy',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable_callback': 'ale_linters#cpp#clangtidy#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_clangtidy_executable'),
|
||||
\ 'command_callback': 'ale_linters#cpp#clangtidy#GetCommand',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\ 'lint_file': 1,
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
call ale#Set('cpp_cppcheck_executable', 'cppcheck')
|
||||
call ale#Set('cpp_cppcheck_options', '--enable=style')
|
||||
|
||||
function! ale_linters#cpp#cppcheck#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'cpp_cppcheck_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
|
||||
" Search upwards from the file for compile_commands.json.
|
||||
"
|
||||
@@ -23,8 +19,7 @@ function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
|
||||
\ : ''
|
||||
|
||||
return l:cd_command
|
||||
\ . ale#Escape(ale_linters#cpp#cppcheck#GetExecutable(a:buffer))
|
||||
\ . ' -q --language=c++ '
|
||||
\ . '%e -q --language=c++ '
|
||||
\ . l:compile_commands_option
|
||||
\ . ale#Var(a:buffer, 'cpp_cppcheck_options')
|
||||
\ . ' %t'
|
||||
@@ -33,7 +28,7 @@ endfunction
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'cppcheck',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'executable_callback': 'ale_linters#cpp#cppcheck#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_cppcheck_executable'),
|
||||
\ 'command_callback': 'ale_linters#cpp#cppcheck#GetCommand',
|
||||
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
||||
\})
|
||||
|
||||
@@ -4,22 +4,16 @@
|
||||
call ale#Set('cpp_cpplint_executable', 'cpplint')
|
||||
call ale#Set('cpp_cpplint_options', '')
|
||||
|
||||
function! ale_linters#cpp#cpplint#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'cpp_cpplint_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cpp#cpplint#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'cpp_cpplint_options')
|
||||
|
||||
return ale#Escape(ale_linters#cpp#cpplint#GetExecutable(a:buffer))
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %s'
|
||||
return '%e' . ale#Pad(l:options) . ' %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'cpplint',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#cpp#cpplint#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_cpplint_executable'),
|
||||
\ 'command_callback': 'ale_linters#cpp#cpplint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#cpplint#HandleCppLintFormat',
|
||||
\ 'lint_file': 1,
|
||||
|
||||
@@ -10,15 +10,6 @@ function! ale_linters#cpp#cquery#GetProjectRoot(buffer) abort
|
||||
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cpp#cquery#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'cpp_cquery_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cpp#cquery#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#cpp#cquery#GetExecutable(a:buffer)
|
||||
return ale#Escape(l:executable)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cpp#cquery#GetInitializationOptions(buffer) abort
|
||||
return {'cacheDirectory': ale#Var(a:buffer, 'cpp_cquery_cache_directory')}
|
||||
endfunction
|
||||
@@ -26,9 +17,8 @@ endfunction
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'cquery',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': 'ale_linters#cpp#cquery#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#cpp#cquery#GetCommand',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_cquery_executable'),
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': 'ale_linters#cpp#cquery#GetProjectRoot',
|
||||
\ 'initialization_options_callback': 'ale_linters#cpp#cquery#GetInitializationOptions',
|
||||
\ 'language': 'cpp',
|
||||
\})
|
||||
|
||||
@@ -6,17 +6,11 @@ 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'
|
||||
return '%e -CDQS'
|
||||
\ . ale#Var(a:buffer, 'cpp_flawfinder_options')
|
||||
\ . l:minlevel
|
||||
\ . ' %t'
|
||||
@@ -25,7 +19,7 @@ endfunction
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'flawfinder',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable_callback': 'ale_linters#cpp#flawfinder#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_flawfinder_executable'),
|
||||
\ 'command_callback': 'ale_linters#cpp#flawfinder#GetCommand',
|
||||
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
|
||||
\})
|
||||
|
||||
@@ -4,30 +4,25 @@
|
||||
call ale#Set('cpp_gcc_executable', 'gcc')
|
||||
call ale#Set('cpp_gcc_options', '-std=c++14 -Wall')
|
||||
|
||||
function! ale_linters#cpp#gcc#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'cpp_gcc_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cpp#gcc#GetCommand(buffer, output) abort
|
||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||
|
||||
" -iquote with the directory the file is in makes #include work for
|
||||
" headers in the same directory.
|
||||
return ale#Escape(ale_linters#cpp#gcc#GetExecutable(a:buffer))
|
||||
\ . ' -S -x c++ -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
|
||||
\ . l:cflags
|
||||
\ . ale#Var(a:buffer, 'cpp_gcc_options') . ' -'
|
||||
return '%e -S -x c++ -fsyntax-only'
|
||||
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . ale#Pad(l:cflags)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'cpp_gcc_options')) . ' -'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'aliases': ['g++'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#cpp#gcc#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_gcc_executable'),
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
|
||||
\ {'callback': 'ale_linters#cpp#gcc#GetCommand'},
|
||||
\ ],
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
let g:ale_cs_mcs_options = get(g:, 'ale_cs_mcs_options', '')
|
||||
|
||||
function! ale_linters#cs#mcs#GetCommand(buffer) abort
|
||||
return 'mcs -unsafe --parse ' . ale#Var(a:buffer, 'cs_mcs_options') . ' %t'
|
||||
let l:options = ale#Var(a:buffer, 'cs_mcs_options')
|
||||
|
||||
return 'mcs -unsafe --parse'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cs#mcs#Handle(buffer, lines) abort
|
||||
|
||||
@@ -29,16 +29,16 @@ function! ale_linters#cs#mcsc#GetCommand(buffer) abort
|
||||
\ : ''
|
||||
|
||||
" register temporary module target file with ale
|
||||
let l:out = tempname()
|
||||
call ale#engine#ManageFile(a:buffer, l:out)
|
||||
" register temporary module target file with ALE.
|
||||
let l:out = ale#engine#CreateFile(a:buffer)
|
||||
|
||||
" The code is compiled as a module and the output is redirected to a
|
||||
" temporary file.
|
||||
return ale#path#CdString(s:GetWorkingDirectory(a:buffer))
|
||||
\ . 'mcs -unsafe'
|
||||
\ . ' ' . ale#Var(a:buffer, 'cs_mcsc_options')
|
||||
\ . ' ' . l:lib_option
|
||||
\ . ' ' . l:r_option
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'cs_mcsc_options'))
|
||||
\ . ale#Pad(l:lib_option)
|
||||
\ . ale#Pad(l:r_option)
|
||||
\ . ' -out:' . l:out
|
||||
\ . ' -t:module'
|
||||
\ . ' -recurse:' . ale#Escape('*.cs')
|
||||
|
||||
@@ -4,21 +4,16 @@ call ale#Set('css_stylelint_executable', 'stylelint')
|
||||
call ale#Set('css_stylelint_options', '')
|
||||
call ale#Set('css_stylelint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#css#stylelint#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'css_stylelint', [
|
||||
\ 'node_modules/.bin/stylelint',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#css#stylelint#GetCommand(buffer) abort
|
||||
return ale_linters#css#stylelint#GetExecutable(a:buffer)
|
||||
\ . ' ' . ale#Var(a:buffer, 'css_stylelint_options')
|
||||
return '%e ' . ale#Pad(ale#Var(a:buffer, 'css_stylelint_options'))
|
||||
\ . ' --stdin-filename %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('css', {
|
||||
\ 'name': 'stylelint',
|
||||
\ 'executable_callback': 'ale_linters#css#stylelint#GetExecutable',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('css_stylelint', [
|
||||
\ 'node_modules/.bin/stylelint',
|
||||
\ ]),
|
||||
\ 'command_callback': 'ale_linters#css#stylelint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
|
||||
\})
|
||||
|
||||
@@ -4,20 +4,15 @@
|
||||
call ale#Set('cuda_nvcc_executable', 'nvcc')
|
||||
call ale#Set('cuda_nvcc_options', '-std=c++11')
|
||||
|
||||
function! ale_linters#cuda#nvcc#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'cuda_nvcc_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cuda#nvcc#GetCommand(buffer) abort
|
||||
" Unused: use ale#util#nul_file
|
||||
" let l:output_file = tempname() . '.ii'
|
||||
" let l:output_file = ale#util#Tempname() . '.ii'
|
||||
" call ale#engine#ManageFile(a:buffer, l:output_file)
|
||||
|
||||
return ale#Escape(ale_linters#cuda#nvcc#GetExecutable(a:buffer))
|
||||
\ . ' -cuda '
|
||||
\ . ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer))
|
||||
\ . ale#Var(a:buffer, 'cuda_nvcc_options') . ' %s'
|
||||
\ . ' -o ' . g:ale#util#nul_file
|
||||
return '%e -cuda'
|
||||
\ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'cuda_nvcc_options'))
|
||||
\ . ' %s -o ' . g:ale#util#nul_file
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cuda#nvcc#HandleNVCCFormat(buffer, lines) abort
|
||||
@@ -49,7 +44,7 @@ endfunction
|
||||
call ale#linter#Define('cuda', {
|
||||
\ 'name': 'nvcc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#cuda#nvcc#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('cuda_nvcc_executable'),
|
||||
\ 'command_callback': 'ale_linters#cuda#nvcc#GetCommand',
|
||||
\ 'callback': 'ale_linters#cuda#nvcc#HandleNVCCFormat',
|
||||
\ 'lint_file': 1,
|
||||
|
||||
@@ -3,15 +3,10 @@
|
||||
|
||||
call ale#Set('dart_dartanalyzer_executable', 'dartanalyzer')
|
||||
|
||||
function! ale_linters#dart#dartanalyzer#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'dart_dartanalyzer_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#dart#dartanalyzer#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#dart#dartanalyzer#GetExecutable(a:buffer)
|
||||
let l:path = ale#path#FindNearestFile(a:buffer, '.packages')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
return '%e'
|
||||
\ . (!empty(l:path) ? ' --packages ' . ale#Escape(l:path) : '')
|
||||
\ . ' %s'
|
||||
endfunction
|
||||
@@ -34,7 +29,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('dart', {
|
||||
\ 'name': 'dartanalyzer',
|
||||
\ 'executable_callback': 'ale_linters#dart#dartanalyzer#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('dart_dartanalyzer_executable'),
|
||||
\ 'command_callback': 'ale_linters#dart#dartanalyzer#GetCommand',
|
||||
\ 'callback': 'ale_linters#dart#dartanalyzer#Handle',
|
||||
\ 'lint_file': 1,
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
|
||||
call ale#Set('dart_language_server_executable', 'dart_language_server')
|
||||
|
||||
function! ale_linters#dart#language_server#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'dart_language_server_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#dart#language_server#GetProjectRoot(buffer) abort
|
||||
" Note: pub only looks for pubspec.yaml, there's no point in adding
|
||||
" support for pubspec.yml
|
||||
@@ -18,8 +14,7 @@ endfunction
|
||||
call ale#linter#Define('dart', {
|
||||
\ 'name': 'language_server',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': 'ale_linters#dart#language_server#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('dart_language_server_executable'),
|
||||
\ 'command_callback': 'ale_linters#dart#language_server#GetExecutable',
|
||||
\ 'language': 'dart',
|
||||
\ 'project_root_callback': 'ale_linters#dart#language_server#GetProjectRoot',
|
||||
\})
|
||||
|
||||
@@ -28,7 +28,7 @@ endfunction
|
||||
call ale#linter#Define('elixir', {
|
||||
\ 'name': 'dialyxir',
|
||||
\ 'executable': 'mix',
|
||||
\ 'command': 'mix dialyzer',
|
||||
\ 'command': 'mix help dialyzer && mix dialyzer',
|
||||
\ 'callback': 'ale_linters#elixir#dialyxir#Handle',
|
||||
\})
|
||||
|
||||
|
||||
@@ -4,12 +4,6 @@
|
||||
call ale#Set('elm_make_executable', 'elm')
|
||||
call ale#Set('elm_make_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#elm#make#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'elm_make', [
|
||||
\ 'node_modules/.bin/elm',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elm#make#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
let l:unparsed_lines = []
|
||||
@@ -128,14 +122,7 @@ function! ale_linters#elm#make#HandleElm018Line(line, output) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elm#make#FileIsBuffer(path) abort
|
||||
let l:is_windows = has('win32')
|
||||
let l:temp_dir = l:is_windows ? $TMP : $TMPDIR
|
||||
|
||||
if has('win32')
|
||||
return a:path[0:len(l:temp_dir) - 1] is? l:temp_dir
|
||||
else
|
||||
return a:path[0:len(l:temp_dir) - 1] is# l:temp_dir
|
||||
endif
|
||||
return ale#path#IsTempName(a:path)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elm#make#ParseMessage(message) abort
|
||||
@@ -143,7 +130,7 @@ function! ale_linters#elm#make#ParseMessage(message) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elm#make#ParseMessageItem(item) abort
|
||||
if type(a:item) == type('')
|
||||
if type(a:item) is v:t_string
|
||||
return a:item
|
||||
else
|
||||
return a:item.string
|
||||
@@ -154,7 +141,6 @@ endfunction
|
||||
" If it doesn't, then this will fail when imports are needed.
|
||||
function! ale_linters#elm#make#GetCommand(buffer) abort
|
||||
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm.json')
|
||||
let l:elm_exe = ale_linters#elm#make#GetExecutable(a:buffer)
|
||||
|
||||
if empty(l:elm_json)
|
||||
" Fallback to Elm 0.18
|
||||
@@ -172,17 +158,14 @@ function! ale_linters#elm#make#GetCommand(buffer) abort
|
||||
" a sort of flag to tell the compiler not to generate an output file,
|
||||
" which is why this is hard coded here.
|
||||
" Source: https://github.com/elm-lang/elm-compiler/blob/19d5a769b30ec0b2fc4475985abb4cd94cd1d6c3/builder/src/Generate/Output.hs#L253
|
||||
let l:elm_cmd = ale#Escape(l:elm_exe)
|
||||
\ . ' make'
|
||||
\ . ' --report=json'
|
||||
\ . ' --output=/dev/null'
|
||||
|
||||
return l:dir_set_cmd . ' ' . l:elm_cmd . ' %t'
|
||||
return l:dir_set_cmd . '%e make --report=json --output=/dev/null %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('elm', {
|
||||
\ 'name': 'make',
|
||||
\ 'executable_callback': 'ale_linters#elm#make#GetExecutable',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('elm_make', [
|
||||
\ 'node_modules/.bin/elm',
|
||||
\ ]),
|
||||
\ 'output_stream': 'both',
|
||||
\ 'command_callback': 'ale_linters#elm#make#GetCommand',
|
||||
\ 'callback': 'ale_linters#elm#make#Handle'
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
let g:ale_erlang_erlc_options = get(g:, 'ale_erlang_erlc_options', '')
|
||||
|
||||
function! ale_linters#erlang#erlc#GetCommand(buffer) abort
|
||||
let l:output_file = tempname()
|
||||
let l:output_file = ale#util#Tempname()
|
||||
call ale#engine#ManageFile(a:buffer, l:output_file)
|
||||
|
||||
return 'erlc -o ' . ale#Escape(l:output_file)
|
||||
|
||||
@@ -3,24 +3,12 @@
|
||||
|
||||
call ale#Set('erlang_syntaxerl_executable', 'syntaxerl')
|
||||
|
||||
|
||||
function! ale_linters#erlang#syntaxerl#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'erlang_syntaxerl_executable')
|
||||
endfunction
|
||||
|
||||
|
||||
function! ale_linters#erlang#syntaxerl#FeatureCheck(buffer) abort
|
||||
return s:GetEscapedExecutable(a:buffer) . ' -h'
|
||||
endfunction
|
||||
|
||||
|
||||
function! ale_linters#erlang#syntaxerl#GetCommand(buffer, output) abort
|
||||
let l:use_b_option = match(a:output, '\C\V-b, --base\>') > -1
|
||||
|
||||
return s:GetEscapedExecutable(a:buffer) . (l:use_b_option ? ' -b %s %t' : ' %t')
|
||||
return '%e' . (l:use_b_option ? ' -b %s %t' : ' %t')
|
||||
endfunction
|
||||
|
||||
|
||||
function! ale_linters#erlang#syntaxerl#Handle(buffer, lines) abort
|
||||
let l:pattern = '\v\C:(\d+):( warning:)? (.+)'
|
||||
let l:loclist = []
|
||||
@@ -36,17 +24,11 @@ function! ale_linters#erlang#syntaxerl#Handle(buffer, lines) abort
|
||||
return l:loclist
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:GetEscapedExecutable(buffer) abort
|
||||
return ale#Escape(ale_linters#erlang#syntaxerl#GetExecutable(a:buffer))
|
||||
endfunction
|
||||
|
||||
|
||||
call ale#linter#Define('erlang', {
|
||||
\ 'name': 'syntaxerl',
|
||||
\ 'executable_callback': 'ale_linters#erlang#syntaxerl#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('erlang_syntaxerl_executable'),
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale_linters#erlang#syntaxerl#FeatureCheck'},
|
||||
\ {'callback': {-> '%e -h'}},
|
||||
\ {'callback': 'ale_linters#erlang#syntaxerl#GetCommand'},
|
||||
\ ],
|
||||
\ 'callback': 'ale_linters#erlang#syntaxerl#Handle',
|
||||
|
||||
@@ -2,18 +2,10 @@
|
||||
" Description: gcc for Fortran files
|
||||
|
||||
" This option can be set to 0 to use -ffixed-form
|
||||
if !exists('g:ale_fortran_gcc_use_free_form')
|
||||
let g:ale_fortran_gcc_use_free_form = 1
|
||||
endif
|
||||
|
||||
if !exists('g:ale_fortran_gcc_executable')
|
||||
let g:ale_fortran_gcc_executable = 'gcc'
|
||||
endif
|
||||
|
||||
call ale#Set('fortran_gcc_use_free_form', 1)
|
||||
call ale#Set('fortran_gcc_executable', 'gcc')
|
||||
" Set this option to change the GCC options for warnings for Fortran.
|
||||
if !exists('g:ale_fortran_gcc_options')
|
||||
let g:ale_fortran_gcc_options = '-Wall'
|
||||
endif
|
||||
call ale#Set('fortran_gcc_options', '-Wall')
|
||||
|
||||
function! ale_linters#fortran#gcc#Handle(buffer, lines) abort
|
||||
" We have to match a starting line and a later ending line together,
|
||||
@@ -61,26 +53,20 @@ function! ale_linters#fortran#gcc#Handle(buffer, lines) abort
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
function! ale_linters#fortran#gcc#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'fortran_gcc_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#fortran#gcc#GetCommand(buffer) abort
|
||||
let l:layout_option = ale#Var(a:buffer, 'fortran_gcc_use_free_form')
|
||||
\ ? '-ffree-form'
|
||||
\ : '-ffixed-form'
|
||||
|
||||
return ale_linters#fortran#gcc#GetExecutable(a:buffer)
|
||||
\ . ' -S -x f95 -fsyntax-only '
|
||||
\ . l:layout_option . ' '
|
||||
\ . ale#Var(a:buffer, 'fortran_gcc_options') . ' '
|
||||
\ . '-'
|
||||
return '%e -S -x f95 -fsyntax-only ' . l:layout_option
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'fortran_gcc_options'))
|
||||
\ . ' -'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('fortran', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#fortran#gcc#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('fortran_gcc_executable'),
|
||||
\ 'command_callback': 'ale_linters#fortran#gcc#GetCommand',
|
||||
\ 'callback': 'ale_linters#fortran#gcc#Handle',
|
||||
\})
|
||||
|
||||
19
ale_linters/fortran/language_server.vim
Normal file
19
ale_linters/fortran/language_server.vim
Normal file
@@ -0,0 +1,19 @@
|
||||
" Author: unpairedbracket ben.spiers22@gmail.com
|
||||
" Description: A language server for fortran
|
||||
|
||||
call ale#Set('fortran_language_server_executable', 'fortls')
|
||||
call ale#Set('fortran_language_server_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#fortran#language_server#GetProjectRoot(buffer) abort
|
||||
let l:fortls_file = ale#path#FindNearestFile(a:buffer, '.fortls')
|
||||
|
||||
return !empty(l:fortls_file) ? fnamemodify(l:fortls_file, ':h') : ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('fortran', {
|
||||
\ 'name': 'language_server',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('fortran_language_server_executable'),
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': 'ale_linters#fortran#language_server#GetProjectRoot',
|
||||
\})
|
||||
@@ -1,19 +1,11 @@
|
||||
" Author: RyanSquared <vandor2012@gmail.com>
|
||||
" Description: `fusion-lint` linter for FusionScript files
|
||||
|
||||
let g:ale_fuse_fusionlint_executable =
|
||||
\ get(g:, 'ale_fuse_fusionlint_executable', 'fusion-lint')
|
||||
|
||||
let g:ale_fuse_fusionlint_options =
|
||||
\ get(g:, 'ale_fuse_fusionlint_options', '')
|
||||
|
||||
function! ale_linters#fuse#fusionlint#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'fuse_fusionlint_executable')
|
||||
endfunction
|
||||
call ale#Set('fuse_fusionlint_executable', 'fusion-lint')
|
||||
call ale#Set('fuse_fusionlint_options', '')
|
||||
|
||||
function! ale_linters#fuse#fusionlint#GetCommand(buffer) abort
|
||||
return ale#Escape(ale_linters#fuse#fusionlint#GetExecutable(a:buffer))
|
||||
\ . ' ' . ale#Var(a:buffer, 'fuse_fusionlint_options')
|
||||
return '%e' . ale#Pad(ale#Var(a:buffer, 'fuse_fusionlint_options'))
|
||||
\ . ' --filename %s -i'
|
||||
endfunction
|
||||
|
||||
@@ -35,7 +27,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('fuse', {
|
||||
\ 'name': 'fusionlint',
|
||||
\ 'executable_callback': 'ale_linters#fuse#fusionlint#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('fuse_fusionlint_executable'),
|
||||
\ 'command_callback': 'ale_linters#fuse#fusionlint#GetCommand',
|
||||
\ 'callback': 'ale_linters#fuse#fusionlint#Handle',
|
||||
\})
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
" 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', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
call ale#Set('gitcommit_gitlint_executable', 'gitlint')
|
||||
call ale#Set('gitcommit_gitlint_options', '')
|
||||
call ale#Set('gitcommit_gitlint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#gitcommit#gitlint#GetExecutable(buffer) abort
|
||||
return ale#python#FindExecutable(a:buffer, 'gitcommit_gitlint', ['gitlint'])
|
||||
@@ -13,12 +11,9 @@ 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
|
||||
|
||||
return '%e' . ale#Pad(l:options) . ' lint'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
|
||||
" Matches patterns line the following:
|
||||
@@ -45,7 +40,6 @@ function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
|
||||
call ale#linter#Define('gitcommit', {
|
||||
\ 'name': 'gitlint',
|
||||
\ 'output_stream': 'stderr',
|
||||
@@ -53,4 +47,3 @@ call ale#linter#Define('gitcommit', {
|
||||
\ 'command_callback': 'ale_linters#gitcommit#gitlint#GetCommand',
|
||||
\ 'callback': 'ale_linters#gitcommit#gitlint#Handle',
|
||||
\})
|
||||
|
||||
|
||||
@@ -4,19 +4,13 @@
|
||||
" TODO: Once https://github.com/KhronosGroup/glslang/pull/1047 is accepted,
|
||||
" we can use stdin.
|
||||
|
||||
let g:ale_glsl_glslang_executable =
|
||||
\ get(g:, 'ale_glsl_glslang_executable', 'glslangValidator')
|
||||
|
||||
let g:ale_glsl_glslang_options = get(g:, 'ale_glsl_glslang_options', '')
|
||||
|
||||
function! ale_linters#glsl#glslang#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'glsl_glslang_executable')
|
||||
endfunction
|
||||
call ale#Set('glsl_glslang_executable', 'glslangValidator')
|
||||
call ale#Set('glsl_glslang_options', '')
|
||||
|
||||
function! ale_linters#glsl#glslang#GetCommand(buffer) abort
|
||||
return ale_linters#glsl#glslang#GetExecutable(a:buffer)
|
||||
\ . ' ' . ale#Var(a:buffer, 'glsl_glslang_options')
|
||||
\ . ' ' . '-C %t'
|
||||
return '%e'
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'glsl_glslang_options'))
|
||||
\ . ' -C %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#glsl#glslang#Handle(buffer, lines) abort
|
||||
@@ -40,7 +34,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('glsl', {
|
||||
\ 'name': 'glslang',
|
||||
\ 'executable_callback': 'ale_linters#glsl#glslang#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('glsl_glslang_executable'),
|
||||
\ 'command_callback': 'ale_linters#glsl#glslang#GetCommand',
|
||||
\ 'callback': 'ale_linters#glsl#glslang#Handle',
|
||||
\})
|
||||
|
||||
@@ -4,18 +4,15 @@
|
||||
call ale#Set('glsl_glslls_executable', 'glslls')
|
||||
call ale#Set('glsl_glslls_logfile', '')
|
||||
|
||||
function! ale_linters#glsl#glslls#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'glsl_glslls_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#glsl#glslls#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#glsl#glslls#GetExecutable(a:buffer)
|
||||
let l:logfile = ale#Var(a:buffer, 'glsl_glslls_logfile')
|
||||
let l:logfile_args = ''
|
||||
|
||||
if l:logfile isnot# ''
|
||||
let l:logfile_args = ' --verbose -l ' . l:logfile
|
||||
endif
|
||||
return ale#Escape(l:executable) . l:logfile_args . ' --stdin'
|
||||
|
||||
return '%e' . l:logfile_args . ' --stdin'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#glsl#glslls#GetProjectRoot(buffer) abort
|
||||
@@ -27,8 +24,7 @@ endfunction
|
||||
call ale#linter#Define('glsl', {
|
||||
\ 'name': 'glslls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': 'ale_linters#glsl#glslls#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('glsl_glslls_executable'),
|
||||
\ 'command_callback': 'ale_linters#glsl#glslls#GetCommand',
|
||||
\ 'language': 'glsl',
|
||||
\ 'project_root_callback': 'ale_linters#glsl#glslls#GetProjectRoot',
|
||||
\})
|
||||
|
||||
@@ -70,7 +70,8 @@ function! ale_linters#go#gobuild#Handler(buffer, lines) abort
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'go build',
|
||||
\ 'name': 'gobuild',
|
||||
\ 'aliases': ['go build'],
|
||||
\ 'executable': 'go',
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale_linters#go#gobuild#GoEnv', 'output_stream': 'stdout'},
|
||||
|
||||
@@ -5,12 +5,7 @@ call ale#Set('go_gometalinter_options', '')
|
||||
call ale#Set('go_gometalinter_executable', 'gometalinter')
|
||||
call ale#Set('go_gometalinter_lint_package', 0)
|
||||
|
||||
function! ale_linters#go#gometalinter#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'go_gometalinter_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#go#gometalinter#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#go#gometalinter#GetExecutable(a:buffer)
|
||||
let l:filename = expand('#' . a:buffer . ':t')
|
||||
let l:options = ale#Var(a:buffer, 'go_gometalinter_options')
|
||||
let l:lint_package = ale#Var(a:buffer, 'go_gometalinter_lint_package')
|
||||
@@ -19,12 +14,12 @@ function! ale_linters#go#gometalinter#GetCommand(buffer) abort
|
||||
" be calculated to absolute paths in the Handler
|
||||
if l:lint_package
|
||||
return ale#path#BufferCdString(a:buffer)
|
||||
\ . ale#Escape(l:executable)
|
||||
\ . '%e'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||
endif
|
||||
|
||||
return ale#path#BufferCdString(a:buffer)
|
||||
\ . ale#Escape(l:executable)
|
||||
\ . '%e'
|
||||
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(l:filename))
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||
endfunction
|
||||
@@ -55,7 +50,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'gometalinter',
|
||||
\ 'executable_callback': 'ale_linters#go#gometalinter#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('go_gometalinter_executable'),
|
||||
\ 'command_callback': 'ale_linters#go#gometalinter#GetCommand',
|
||||
\ 'callback': 'ale_linters#go#gometalinter#Handler',
|
||||
\ 'lint_file': 1,
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
|
||||
function! ale_linters#go#gotype#GetCommand(buffer) abort
|
||||
if expand('#' . a:buffer . ':p') =~# '_test\.go$'
|
||||
return
|
||||
return ''
|
||||
endif
|
||||
|
||||
|
||||
return ale#path#BufferCdString(a:buffer) . ' gotype .'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ function! ale_linters#go#govet#GetCommand(buffer) abort
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'go vet',
|
||||
\ 'name': 'govet',
|
||||
\ 'aliases': ['go vet'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'go',
|
||||
\ 'command_callback': 'ale_linters#go#govet#GetCommand',
|
||||
|
||||
22
ale_linters/hack/hack.vim
Normal file
22
ale_linters/hack/hack.vim
Normal file
@@ -0,0 +1,22 @@
|
||||
" Author: Fred Emmott <fe@fb.com>
|
||||
" Description: Hack support via `hack lsp`
|
||||
|
||||
call ale#Set('hack_hack_executable', 'hh_client')
|
||||
|
||||
function! ale_linters#hack#hack#GetProjectRoot(buffer) abort
|
||||
let l:hhconfig = ale#path#FindNearestFile(a:buffer, '.hhconfig')
|
||||
|
||||
return !empty(l:hhconfig) ? fnamemodify(l:hhconfig, ':h') : ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#hack#hack#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'hack_hack_executable')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('hack', {
|
||||
\ 'name': 'hack',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': 'ale_linters#hack#hack#GetExecutable',
|
||||
\ 'command': '%e lsp --from vim-ale',
|
||||
\ 'project_root_callback': 'ale_linters#hack#hack#GetProjectRoot',
|
||||
\})
|
||||
40
ale_linters/hack/hhast.vim
Normal file
40
ale_linters/hack/hhast.vim
Normal file
@@ -0,0 +1,40 @@
|
||||
" Author: Fred Emmott <fe@fb.com>
|
||||
" Description: Hack support via `hhast lsp`
|
||||
|
||||
call ale#Set('hack_hhast_executable', 'vendor/bin/hhast-lint')
|
||||
|
||||
function! ale_linters#hack#hhast#GetProjectRoot(buffer) abort
|
||||
" Find the hack root, then figure out if it's also an HHAST root.
|
||||
" Don't try to use lint configurations from vendor/foo/bar/hhast-lint.json
|
||||
let l:hhconfig = ale#path#FindNearestFile(a:buffer, '.hhconfig')
|
||||
|
||||
if empty(l:hhconfig)
|
||||
return ''
|
||||
endif
|
||||
|
||||
let l:root = fnamemodify(l:hhconfig, ':h')
|
||||
let l:hhast_config = findfile('hhast-lint.json', l:root)
|
||||
|
||||
return !empty(l:hhast_config) ? l:root : ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#hack#hhast#GetExecutable(buffer) abort
|
||||
let l:root = ale_linters#hack#hhast#GetProjectRoot(a:buffer)
|
||||
let l:relative = ale#Var(a:buffer, 'hack_hhast_executable')
|
||||
let l:absolute = findfile(l:relative, l:root)
|
||||
|
||||
return !empty(l:absolute) ? l:absolute : ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#hack#hhast#GetInitializationOptions(buffer) abort
|
||||
return {'lintMode': 'open-files'}
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('hack', {
|
||||
\ 'name': 'hhast',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': 'ale_linters#hack#hhast#GetExecutable',
|
||||
\ 'command': '%e --mode lsp --from vim-ale',
|
||||
\ 'project_root_callback': 'ale_linters#hack#hhast#GetProjectRoot',
|
||||
\ 'initialization_options_callback': 'ale_linters#hack#hhast#GetInitializationOptions',
|
||||
\})
|
||||
@@ -4,17 +4,6 @@
|
||||
call ale#Set('handlebars_embertemplatelint_executable', 'ember-template-lint')
|
||||
call ale#Set('handlebars_embertemplatelint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#handlebars#embertemplatelint#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'handlebars_embertemplatelint', [
|
||||
\ 'node_modules/.bin/ember-template-lint',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer) abort
|
||||
return ale_linters#handlebars#embertemplatelint#GetExecutable(a:buffer)
|
||||
\ . ' --json %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})
|
||||
@@ -42,7 +31,9 @@ endfunction
|
||||
|
||||
call ale#linter#Define('handlebars', {
|
||||
\ 'name': 'ember-template-lint',
|
||||
\ 'executable_callback': 'ale_linters#handlebars#embertemplatelint#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#handlebars#embertemplatelint#GetCommand',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('handlebars_embertemplatelint', [
|
||||
\ 'node_modules/.bin/ember-template-lint',
|
||||
\ ]),
|
||||
\ 'command': '%e --json %t',
|
||||
\ 'callback': 'ale_linters#handlebars#embertemplatelint#Handle',
|
||||
\})
|
||||
|
||||
19
ale_linters/haskell/cabal_ghc.vim
Normal file
19
ale_linters/haskell/cabal_ghc.vim
Normal file
@@ -0,0 +1,19 @@
|
||||
" Author: Eric Wolf <ericwolf42@gmail.com>
|
||||
" Description: ghc for Haskell files called with cabal exec
|
||||
|
||||
call ale#Set('haskell_cabal_ghc_options', '-fno-code -v0')
|
||||
|
||||
function! ale_linters#haskell#cabal_ghc#GetCommand(buffer) abort
|
||||
return 'cabal exec -- ghc '
|
||||
\ . ale#Var(a:buffer, 'haskell_cabal_ghc_options')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'cabal_ghc',
|
||||
\ 'aliases': ['cabal-ghc'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'cabal',
|
||||
\ 'command_callback': 'ale_linters#haskell#cabal_ghc#GetCommand',
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
@@ -2,14 +2,16 @@
|
||||
" Description: ghc-mod for Haskell files
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'ghc-mod',
|
||||
\ 'name': 'ghc_mod',
|
||||
\ 'aliases': ['ghc-mod'],
|
||||
\ 'executable': 'ghc-mod',
|
||||
\ 'command': 'ghc-mod --map-file %s=%t check %s',
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'stack-ghc-mod',
|
||||
\ 'name': 'stack_ghc_mod',
|
||||
\ 'aliases': ['stack-ghc-mod'],
|
||||
\ 'executable': 'stack',
|
||||
\ 'command': 'stack exec ghc-mod -- --map-file %s=%t check %s',
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
|
||||
@@ -4,19 +4,14 @@
|
||||
call ale#Set('haskell_hdevtools_executable', 'hdevtools')
|
||||
call ale#Set('haskell_hdevtools_options', get(g:, 'hdevtools_options', '-g -Wall'))
|
||||
|
||||
function! ale_linters#haskell#hdevtools#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'haskell_hdevtools_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#haskell#hdevtools#GetCommand(buffer) abort
|
||||
return ale#Escape(ale_linters#haskell#hdevtools#GetExecutable(a:buffer))
|
||||
\ . ' check ' . ale#Var(a:buffer, 'haskell_hdevtools_options')
|
||||
return '%e check' . ale#Pad(ale#Var(a:buffer, 'haskell_hdevtools_options'))
|
||||
\ . ' -p %s %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'hdevtools',
|
||||
\ 'executable_callback': 'ale_linters#haskell#hdevtools#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('haskell_hdevtools_executable'),
|
||||
\ 'command_callback': 'ale_linters#haskell#hdevtools#GetCommand',
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
|
||||
44
ale_linters/haskell/hie.vim
Normal file
44
ale_linters/haskell/hie.vim
Normal file
@@ -0,0 +1,44 @@
|
||||
" Author: Luxed <devildead13@gmail.com>
|
||||
" Description: A language server for Haskell
|
||||
|
||||
call ale#Set('haskell_hie_executable', 'hie')
|
||||
|
||||
function! ale_linters#haskell#hie#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'haskell_hie_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#haskell#hie#GetProjectRoot(buffer) abort
|
||||
" Search for the stack file first
|
||||
let l:project_file = ale#path#FindNearestFile(a:buffer, 'stack.yaml')
|
||||
|
||||
" If it's empty, search for the cabal file
|
||||
if empty(l:project_file)
|
||||
let l:cabal_file = fnamemodify(bufname(a:buffer), ':p:h')
|
||||
let l:paths = ''
|
||||
|
||||
while empty(matchstr(l:cabal_file, '^\(\/\|\(\w:\\\)\)$'))
|
||||
let l:cabal_file = fnamemodify(l:cabal_file, ':h')
|
||||
let l:paths = l:paths . l:cabal_file . ','
|
||||
endwhile
|
||||
|
||||
let l:project_file = globpath(l:paths, '*.cabal')
|
||||
endif
|
||||
|
||||
" Either extract the project directory or take the current working
|
||||
" directory
|
||||
if !empty(l:project_file)
|
||||
let l:project_file = fnamemodify(l:project_file, ':h')
|
||||
else
|
||||
let l:project_file = expand('#' . a:buffer . ':p:h')
|
||||
endif
|
||||
|
||||
return l:project_file
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'hie',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'command': '%e --lsp',
|
||||
\ 'executable_callback': 'ale_linters#haskell#hie#GetExecutable',
|
||||
\ 'project_root_callback': 'ale_linters#haskell#hie#GetProjectRoot',
|
||||
\})
|
||||
@@ -13,7 +13,8 @@ function! ale_linters#haskell#stack_build#GetCommand(buffer) abort
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'stack-build',
|
||||
\ 'name': 'stack_build',
|
||||
\ 'aliases': ['stack-build'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'stack',
|
||||
\ 'command_callback': 'ale_linters#haskell#stack_build#GetCommand',
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
" Description: ghc for Haskell files, using Stack
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'stack-ghc',
|
||||
\ 'name': 'stack_ghc',
|
||||
\ 'aliases': ['stack-ghc'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'stack',
|
||||
\ 'command': 'stack ghc -- -fno-code -v0 %t',
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for vim Help files
|
||||
|
||||
call ale#linter#Define('help', {
|
||||
\ 'name': 'write-good',
|
||||
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
||||
\ 'callback': 'ale#handlers#writegood#Handle',
|
||||
\})
|
||||
4
ale_linters/help/writegood.vim
Normal file
4
ale_linters/help/writegood.vim
Normal file
@@ -0,0 +1,4 @@
|
||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for vim Help files
|
||||
|
||||
call ale#handlers#writegood#DefineLinter('help')
|
||||
@@ -5,12 +5,6 @@ call ale#Set('html_htmlhint_options', '')
|
||||
call ale#Set('html_htmlhint_executable', 'htmlhint')
|
||||
call ale#Set('html_htmlhint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#html#htmlhint#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'html_htmlhint', [
|
||||
\ 'node_modules/.bin/htmlhint',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#html#htmlhint#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'html_htmlhint_options')
|
||||
let l:config = l:options !~# '--config'
|
||||
@@ -25,14 +19,14 @@ function! ale_linters#html#htmlhint#GetCommand(buffer) abort
|
||||
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'
|
||||
return '%e' . ale#Pad(l:options) . ' --format=unix %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('html', {
|
||||
\ 'name': 'htmlhint',
|
||||
\ 'executable_callback': 'ale_linters#html#htmlhint#GetExecutable',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('html_htmlhint', [
|
||||
\ 'node_modules/.bin/htmlhint',
|
||||
\ ]),
|
||||
\ 'command_callback': 'ale_linters#html#htmlhint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||
\})
|
||||
|
||||
@@ -37,10 +37,6 @@ function! ale_linters#html#tidy#GetCommand(buffer) abort
|
||||
\)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#html#tidy#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'html_tidy_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#html#tidy#Handle(buffer, lines) abort
|
||||
" Matches patterns lines like the following:
|
||||
" line 7 column 5 - Warning: missing </title> before </head>
|
||||
@@ -67,7 +63,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('html', {
|
||||
\ 'name': 'tidy',
|
||||
\ 'executable_callback': 'ale_linters#html#tidy#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('html_tidy_executable'),
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'command_callback': 'ale_linters#html#tidy#GetCommand',
|
||||
\ 'callback': 'ale_linters#html#tidy#Handle',
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for nroff files
|
||||
|
||||
call ale#linter#Define('html', {
|
||||
\ 'name': 'write-good',
|
||||
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
||||
\ 'callback': 'ale#handlers#writegood#Handle',
|
||||
\})
|
||||
4
ale_linters/html/writegood.vim
Normal file
4
ale_linters/html/writegood.vim
Normal file
@@ -0,0 +1,4 @@
|
||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for html files
|
||||
|
||||
call ale#handlers#writegood#DefineLinter('html')
|
||||
@@ -4,16 +4,10 @@
|
||||
call ale#Set('idris_idris_executable', 'idris')
|
||||
call ale#Set('idris_idris_options', '--total --warnpartial --warnreach --warnipkg')
|
||||
|
||||
function! ale_linters#idris#idris#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'idris_idris_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#idris#idris#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'idris_idris_options')
|
||||
|
||||
return ale#Escape(ale_linters#idris#idris#GetExecutable(a:buffer))
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --check %s'
|
||||
return '%e' . ale#Pad(l:options) . ' --check %s'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#idris#idris#Handle(buffer, lines) abort
|
||||
@@ -80,8 +74,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('idris', {
|
||||
\ 'name': 'idris',
|
||||
\ 'executable_callback': 'ale_linters#idris#idris#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('idris_idris_executable'),
|
||||
\ 'command_callback': 'ale_linters#idris#idris#GetCommand',
|
||||
\ 'callback': 'ale_linters#idris#idris#Handle',
|
||||
\})
|
||||
|
||||
|
||||
@@ -36,10 +36,6 @@ function! s:BuildClassPathOption(buffer, import_paths) abort
|
||||
\ : ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#java#javac#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'java_javac_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#java#javac#GetCommand(buffer, import_paths) abort
|
||||
let l:cp_option = s:BuildClassPathOption(a:buffer, a:import_paths)
|
||||
let l:sp_option = ''
|
||||
@@ -77,17 +73,15 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths) abort
|
||||
|
||||
" Create .class files in a temporary directory, which we will delete later.
|
||||
let l:class_file_directory = ale#engine#CreateDirectory(a:buffer)
|
||||
let l:executable = ale_linters#java#javac#GetExecutable(a:buffer)
|
||||
|
||||
" Always run javac from the directory the file is in, so we can resolve
|
||||
" relative paths correctly.
|
||||
return ale#path#BufferCdString(a:buffer)
|
||||
\ . ale#Escape(l:executable)
|
||||
\ . ' -Xlint'
|
||||
\ . ' ' . l:cp_option
|
||||
\ . ' ' . l:sp_option
|
||||
\ . '%e -Xlint'
|
||||
\ . ale#Pad(l:cp_option)
|
||||
\ . ale#Pad(l:sp_option)
|
||||
\ . ' -d ' . ale#Escape(l:class_file_directory)
|
||||
\ . ' ' . ale#Var(a:buffer, 'java_javac_options')
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'java_javac_options'))
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
@@ -126,7 +120,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('java', {
|
||||
\ 'name': 'javac',
|
||||
\ 'executable_callback': 'ale_linters#java#javac#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('java_javac_executable'),
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale_linters#java#javac#GetImportPaths', 'output_stream': 'stdout'},
|
||||
\ {'callback': 'ale_linters#java#javac#GetCommand', 'output_stream': 'stderr'},
|
||||
|
||||
28
ale_linters/javascript/flow_ls.vim
Normal file
28
ale_linters/javascript/flow_ls.vim
Normal file
@@ -0,0 +1,28 @@
|
||||
" Author: t_t <jamestthompson3@gmail.com>
|
||||
" Description: Integrate ALE with flow-language-server.
|
||||
|
||||
call ale#Set('javascript_flow_ls_executable', 'flow')
|
||||
call ale#Set('javascript_flow_ls_use_global',
|
||||
\ get(g:, 'ale_use_global_executables', 0)
|
||||
\)
|
||||
|
||||
function! ale_linters#javascript#flow_ls#FindProjectRoot(buffer) abort
|
||||
let l:flow_config = ale#path#FindNearestFile(a:buffer, '.flowconfig')
|
||||
|
||||
if !empty(l:flow_config)
|
||||
return fnamemodify(l:flow_config, ':h')
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'flow-language-server',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('javascript_flow_ls', [
|
||||
\ 'node_modules/.bin/flow',
|
||||
\ ]),
|
||||
\ 'command': '%e lsp --from ale-lsp',
|
||||
\ 'project_root_callback': 'ale_linters#javascript#flow_ls#FindProjectRoot',
|
||||
\ 'language': 'javascript',
|
||||
\})
|
||||
@@ -4,12 +4,6 @@
|
||||
call ale#Set('javascript_jscs_executable', 'jscs')
|
||||
call ale#Set('javascript_jscs_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#javascript#jscs#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'javascript_jscs', [
|
||||
\ 'node_modules/.bin/jscs',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#javascript#jscs#GetCommand(buffer) abort
|
||||
" Search for a local JShint config locaation, and default to a global one.
|
||||
let l:jscs_config = ale#path#ResolveLocalPath(
|
||||
@@ -18,8 +12,7 @@ function! ale_linters#javascript#jscs#GetCommand(buffer) abort
|
||||
\ get(g:, 'ale_jscs_config_loc', '')
|
||||
\)
|
||||
|
||||
let l:command = ale#Escape(ale_linters#javascript#jscs#GetExecutable(a:buffer))
|
||||
let l:command .= ' --reporter inline --no-colors'
|
||||
let l:command = '%e --reporter inline --no-colors'
|
||||
|
||||
if !empty(l:jscs_config)
|
||||
let l:command .= ' --config ' . ale#Escape(l:jscs_config)
|
||||
@@ -60,8 +53,9 @@ endfunction
|
||||
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'jscs',
|
||||
\ 'executable_callback': 'ale_linters#javascript#jscs#GetExecutable',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('javascript_jscs', [
|
||||
\ 'node_modules/.bin/jscs',
|
||||
\ ]),
|
||||
\ 'command_callback': 'ale_linters#javascript#jscs#GetCommand',
|
||||
\ 'callback': 'ale_linters#javascript#jscs#Handle',
|
||||
\})
|
||||
|
||||
|
||||
@@ -4,12 +4,6 @@
|
||||
call ale#Set('javascript_jshint_executable', 'jshint')
|
||||
call ale#Set('javascript_jshint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#javascript#jshint#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'javascript_jshint', [
|
||||
\ 'node_modules/.bin/jshint',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#javascript#jshint#GetCommand(buffer) abort
|
||||
" Search for a local JShint config locaation, and default to a global one.
|
||||
let l:jshint_config = ale#path#ResolveLocalPath(
|
||||
@@ -18,8 +12,7 @@ function! ale_linters#javascript#jshint#GetCommand(buffer) abort
|
||||
\ get(g:, 'ale_jshint_config_loc', '')
|
||||
\)
|
||||
|
||||
let l:command = ale#Escape(ale_linters#javascript#jshint#GetExecutable(a:buffer))
|
||||
let l:command .= ' --reporter unix --extract auto'
|
||||
let l:command = '%e --reporter unix --extract auto'
|
||||
|
||||
if !empty(l:jshint_config)
|
||||
let l:command .= ' --config ' . ale#Escape(l:jshint_config)
|
||||
@@ -32,7 +25,9 @@ endfunction
|
||||
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'jshint',
|
||||
\ 'executable_callback': 'ale_linters#javascript#jshint#GetExecutable',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('javascript_jshint', [
|
||||
\ 'node_modules/.bin/jshint',
|
||||
\ ]),
|
||||
\ 'command_callback': 'ale_linters#javascript#jshint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||
\})
|
||||
|
||||
@@ -5,22 +5,13 @@ call ale#Set('javascript_tsserver_executable', 'tsserver')
|
||||
call ale#Set('javascript_tsserver_config_path', '')
|
||||
call ale#Set('javascript_tsserver_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
" These functions need to be defined just to comply with the API for LSP.
|
||||
function! ale_linters#javascript#tsserver#GetProjectRoot(buffer) abort
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#javascript#tsserver#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'javascript_tsserver', [
|
||||
\ 'node_modules/.bin/tsserver',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'tsserver',
|
||||
\ 'lsp': 'tsserver',
|
||||
\ 'executable_callback': 'ale_linters#javascript#tsserver#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#javascript#tsserver#GetExecutable',
|
||||
\ 'project_root_callback': 'ale_linters#javascript#tsserver#GetProjectRoot',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('javascript_tsserver', [
|
||||
\ 'node_modules/.bin/tsserver',
|
||||
\ ]),
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': {-> ''},
|
||||
\ 'language': '',
|
||||
\})
|
||||
|
||||
29
ale_linters/kotlin/languageserver.vim
Normal file
29
ale_linters/kotlin/languageserver.vim
Normal file
@@ -0,0 +1,29 @@
|
||||
" Author: MTDL9 <https://github.com/MTDL9>
|
||||
" Description: Support for the Kotlin language server https://github.com/fwcd/KotlinLanguageServer
|
||||
|
||||
call ale#Set('kotlin_languageserver_executable', 'kotlin-language-server')
|
||||
|
||||
function! ale_linters#kotlin#languageserver#GetProjectRoot(buffer) abort
|
||||
let l:gradle_root = ale#gradle#FindProjectRoot(a:buffer)
|
||||
|
||||
if !empty(l:gradle_root)
|
||||
return l:gradle_root
|
||||
endif
|
||||
|
||||
let l:maven_pom_file = ale#path#FindNearestFile(a:buffer, 'pom.xml')
|
||||
|
||||
if !empty(l:maven_pom_file)
|
||||
return fnamemodify(l:maven_pom_file, ':h')
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('kotlin', {
|
||||
\ 'name': 'languageserver',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('kotlin_languageserver_executable'),
|
||||
\ 'command_callback': '%e',
|
||||
\ 'language': 'kotlin',
|
||||
\ 'project_root_callback': 'ale_linters#kotlin#languageserver#GetProjectRoot',
|
||||
\})
|
||||
@@ -5,21 +5,10 @@ call ale#Set('less_lessc_executable', 'lessc')
|
||||
call ale#Set('less_lessc_options', '')
|
||||
call ale#Set('less_lessc_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#less#lessc#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'less_lessc', [
|
||||
\ 'node_modules/.bin/lessc',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#less#lessc#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#less#lessc#GetExecutable(a:buffer)
|
||||
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||
let l:options = ale#Var(a:buffer, 'less_lessc_options')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . ' --no-color --lint'
|
||||
\ . ' --include-path=' . ale#Escape(l:dir)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
return '%e --no-color --lint'
|
||||
\ . ' --include-path=' . ale#Escape(expand('#' . a:buffer . ':p:h'))
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'less_lessc_options'))
|
||||
\ . ' -'
|
||||
endfunction
|
||||
|
||||
@@ -49,7 +38,9 @@ endfunction
|
||||
|
||||
call ale#linter#Define('less', {
|
||||
\ 'name': 'lessc',
|
||||
\ 'executable_callback': 'ale_linters#less#lessc#GetExecutable',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('less_lessc', [
|
||||
\ 'node_modules/.bin/lessc',
|
||||
\ ]),
|
||||
\ 'command_callback': 'ale_linters#less#lessc#GetCommand',
|
||||
\ 'callback': 'ale_linters#less#lessc#Handle',
|
||||
\ 'output_stream': 'stderr',
|
||||
|
||||
@@ -4,24 +4,17 @@ call ale#Set('less_stylelint_executable', 'stylelint')
|
||||
call ale#Set('less_stylelint_options', '')
|
||||
call ale#Set('less_stylelint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#less#stylelint#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'less_stylelint', [
|
||||
\ 'node_modules/.bin/stylelint',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#less#stylelint#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#less#stylelint#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'less_stylelint_options')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --stdin-filename %s'
|
||||
return '%e' . ale#Pad(l:options) . ' --stdin-filename %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('less', {
|
||||
\ 'name': 'stylelint',
|
||||
\ 'executable_callback': 'ale_linters#less#stylelint#GetExecutable',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('less_stylelint', [
|
||||
\ 'node_modules/.bin/stylelint',
|
||||
\ ]),
|
||||
\ 'command_callback': 'ale_linters#less#stylelint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
|
||||
\})
|
||||
|
||||
@@ -3,22 +3,11 @@
|
||||
|
||||
call ale#Set('llvm_llc_executable', 'llc')
|
||||
|
||||
function! ale_linters#llvm#llc#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'llvm_llc_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#llvm#llc#GetCommand(buffer) abort
|
||||
return ale#Escape(ale_linters#llvm#llc#GetExecutable(a:buffer))
|
||||
\ . ' -filetype=null -o='
|
||||
\ . ale#Escape(g:ale#util#nul_file)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#llvm#llc#HandleErrors(buffer, lines) abort
|
||||
" Handle '{path}: {file}:{line}:{col}: error: {message}' format
|
||||
let l:pattern = '\v^[a-zA-Z]?:?[^:]+: [^:]+:(\d+):(\d+): (.+)$'
|
||||
let l:matches = ale#util#GetMatches(a:lines, l:pattern)
|
||||
|
||||
return map(l:matches, "{
|
||||
return map(ale#util#GetMatches(a:lines, l:pattern), "{
|
||||
\ 'lnum': str2nr(v:val[1]),
|
||||
\ 'col': str2nr(v:val[2]),
|
||||
\ 'text': v:val[3],
|
||||
@@ -28,8 +17,8 @@ endfunction
|
||||
|
||||
call ale#linter#Define('llvm', {
|
||||
\ 'name': 'llc',
|
||||
\ 'executable_callback': 'ale_linters#llvm#llc#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('llvm_llc_executable'),
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'command_callback': 'ale_linters#llvm#llc#GetCommand',
|
||||
\ 'command_callback': {-> '%e -filetype=null -o=' . g:ale#util#nul_file},
|
||||
\ 'callback': 'ale_linters#llvm#llc#HandleErrors',
|
||||
\})
|
||||
|
||||
@@ -3,15 +3,6 @@
|
||||
|
||||
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:
|
||||
"
|
||||
@@ -33,8 +24,8 @@ endfunction
|
||||
|
||||
call ale#linter#Define('lua', {
|
||||
\ 'name': 'luac',
|
||||
\ 'executable_callback': 'ale_linters#lua#luac#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#lua#luac#GetCommand',
|
||||
\ 'executable_callback': ale#VarFunc('lua_luac_executable'),
|
||||
\ 'command': '%e -p -',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale_linters#lua#luac#Handle',
|
||||
\})
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
" Author: Sol Bekic https://github.com/s-ol
|
||||
" Description: luacheck linter for lua files
|
||||
|
||||
let g:ale_lua_luacheck_executable =
|
||||
\ get(g:, 'ale_lua_luacheck_executable', 'luacheck')
|
||||
|
||||
let g:ale_lua_luacheck_options =
|
||||
\ get(g:, 'ale_lua_luacheck_options', '')
|
||||
|
||||
function! ale_linters#lua#luacheck#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'lua_luacheck_executable')
|
||||
endfunction
|
||||
call ale#Set('lua_luacheck_executable', 'luacheck')
|
||||
call ale#Set('lua_luacheck_options', '')
|
||||
|
||||
function! ale_linters#lua#luacheck#GetCommand(buffer) abort
|
||||
return ale#Escape(ale_linters#lua#luacheck#GetExecutable(a:buffer))
|
||||
\ . ' ' . ale#Var(a:buffer, 'lua_luacheck_options')
|
||||
return '%e' . ale#Pad(ale#Var(a:buffer, 'lua_luacheck_options'))
|
||||
\ . ' --formatter plain --codes --filename %s -'
|
||||
endfunction
|
||||
|
||||
@@ -46,7 +38,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('lua', {
|
||||
\ 'name': 'luacheck',
|
||||
\ 'executable_callback': 'ale_linters#lua#luacheck#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('lua_luacheck_executable'),
|
||||
\ 'command_callback': 'ale_linters#lua#luacheck#GetCommand',
|
||||
\ 'callback': 'ale_linters#lua#luacheck#Handle',
|
||||
\})
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
scriptencoding utf-8
|
||||
" Author rhysd https://rhysd.github.io/, Dirk Roorda (dirkroorda), Adrián González Rus (@adrigzr)
|
||||
" Description: remark-lint for Markdown files
|
||||
call ale#Set('markdown_remark_lint_executable', 'remark')
|
||||
call ale#Set('markdown_remark_lint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('markdown_remark_lint_options', '')
|
||||
|
||||
function! ale_linters#markdown#remark_lint#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'markdown_remark_lint_options')
|
||||
|
||||
return '%e' . ale#Pad(l:options) . ' --no-stdout --no-color'
|
||||
endfunction
|
||||
|
||||
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'
|
||||
@@ -25,10 +35,12 @@ function! ale_linters#markdown#remark_lint#Handle(buffer, lines) abort
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'remark-lint',
|
||||
\ 'executable': 'remark',
|
||||
\ 'command': 'remark --no-stdout --no-color %s',
|
||||
\ 'name': 'remark_lint',
|
||||
\ 'aliases': ['remark-lint'],
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('markdown_remark_lint', [
|
||||
\ 'node_modules/.bin/remark',
|
||||
\ ]),
|
||||
\ 'command_callback': 'ale_linters#markdown#remark_lint#GetCommand',
|
||||
\ 'callback': 'ale_linters#markdown#remark_lint#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\ 'output_stream': 'stderr',
|
||||
\})
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for Markdown files
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'write-good',
|
||||
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
||||
\ 'callback': 'ale#handlers#writegood#Handle',
|
||||
\})
|
||||
4
ale_linters/markdown/writegood.vim
Normal file
4
ale_linters/markdown/writegood.vim
Normal file
@@ -0,0 +1,4 @@
|
||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for Markdown files
|
||||
|
||||
call ale#handlers#writegood#DefineLinter('markdown')
|
||||
@@ -1,18 +1,7 @@
|
||||
" Author: awlayton <alex@layton.in>
|
||||
" Description: mlint for MATLAB files
|
||||
|
||||
let g:ale_matlab_mlint_executable =
|
||||
\ get(g:, 'ale_matlab_mlint_executable', 'mlint')
|
||||
|
||||
function! ale_linters#matlab#mlint#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'matlab_mlint_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#matlab#mlint#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#matlab#mlint#GetExecutable(a:buffer)
|
||||
|
||||
return l:executable . ' -id %t'
|
||||
endfunction
|
||||
call ale#Set('matlab_mlint_executable', 'mlint')
|
||||
|
||||
function! ale_linters#matlab#mlint#Handle(buffer, lines) abort
|
||||
" Matches patterns like the following:
|
||||
@@ -48,8 +37,8 @@ endfunction
|
||||
|
||||
call ale#linter#Define('matlab', {
|
||||
\ 'name': 'mlint',
|
||||
\ 'executable_callback': 'ale_linters#matlab#mlint#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#matlab#mlint#GetCommand',
|
||||
\ 'executable_callback': ale#VarFunc('matlab_mlint_executable'),
|
||||
\ 'command': '%e -id %t',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale_linters#matlab#mlint#Handle',
|
||||
\})
|
||||
|
||||
@@ -4,16 +4,11 @@
|
||||
call ale#Set('mercury_mmc_executable', 'mmc')
|
||||
call ale#Set('mercury_mmc_options', '--make --output-compile-error-lines 100')
|
||||
|
||||
function! ale_linters#mercury#mmc#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'mercury_mmc_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#mercury#mmc#GetCommand(buffer) abort
|
||||
let l:module_name = expand('#' . a:buffer . ':t:r')
|
||||
|
||||
return ale#path#BufferCdString(a:buffer)
|
||||
\ . ale_linters#mercury#mmc#GetExecutable(a:buffer)
|
||||
\ . ' --errorcheck-only '
|
||||
\ . '%e --errorcheck-only '
|
||||
\ . ale#Var(a:buffer, 'mercury_mmc_options')
|
||||
\ . ' ' . l:module_name
|
||||
endfunction
|
||||
@@ -38,7 +33,7 @@ endfunction
|
||||
call ale#linter#Define('mercury', {
|
||||
\ 'name': 'mmc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#mercury#mmc#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('mercury_mmc_executable'),
|
||||
\ 'command_callback': 'ale_linters#mercury#mmc#GetCommand',
|
||||
\ 'callback': 'ale_linters#mercury#mmc#Handle',
|
||||
\ 'lint_file': 1,
|
||||
|
||||
@@ -4,25 +4,13 @@
|
||||
call ale#Set('nasm_nasm_executable', 'nasm')
|
||||
call ale#Set('nasm_nasm_options', '')
|
||||
|
||||
function! ale_linters#nasm#nasm#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'nasm_nasm_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#nasm#nasm#GetOptions(buffer) abort
|
||||
return ale#Var(a:buffer, 'nasm_nasm_options')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#nasm#nasm#GetCommand(buffer) abort
|
||||
" Note that NASM require a trailing slash to the -I option.
|
||||
let l:executable = ale#Escape(ale_linters#nasm#nasm#GetExecutable(a:buffer))
|
||||
" Note that NASM requires a trailing slash for the -I option.
|
||||
let l:separator = has('win32') ? '\' : '/'
|
||||
let l:path = ale#Escape(fnamemodify(bufname(a:buffer), ':p:h') . l:separator)
|
||||
let l:options = ale_linters#nasm#nasm#GetOptions(a:buffer)
|
||||
let l:path = fnamemodify(bufname(a:buffer), ':p:h') . l:separator
|
||||
|
||||
return l:executable
|
||||
\ . ' -X gnu'
|
||||
\ . ' -I ' . l:path
|
||||
\ . ' ' . l:options
|
||||
return '%e -X gnu -I ' . ale#Escape(l:path)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'nasm_nasm_options'))
|
||||
\ . ' %s'
|
||||
endfunction
|
||||
|
||||
@@ -30,6 +18,7 @@ function! ale_linters#nasm#nasm#Handle(buffer, lines) abort
|
||||
" Note that we treat 'fatal' as errors.
|
||||
let l:pattern = '^.\+:\(\d\+\): \([^:]\+\): \(.\+\)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
@@ -37,14 +26,15 @@ function! ale_linters#nasm#nasm#Handle(buffer, lines) abort
|
||||
\ 'text': l:match[3],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('nasm', {
|
||||
\ 'name': 'nasm',
|
||||
\ 'executable': 'nasm',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'lint_file': 1,
|
||||
\ 'executable_callback': ale#VarFunc('nasm_nasm_executable'),
|
||||
\ 'command_callback': 'ale_linters#nasm#nasm#GetCommand',
|
||||
\ 'callback': 'ale_linters#nasm#nasm#Handle',
|
||||
\})
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for nroff files
|
||||
|
||||
call ale#linter#Define('nroff', {
|
||||
\ 'name': 'write-good',
|
||||
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
||||
\ 'callback': 'ale#handlers#writegood#Handle',
|
||||
\})
|
||||
4
ale_linters/nroff/writegood.vim
Normal file
4
ale_linters/nroff/writegood.vim
Normal file
@@ -0,0 +1,4 @@
|
||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for nroff files
|
||||
|
||||
call ale#handlers#writegood#DefineLinter('nroff')
|
||||
@@ -19,5 +19,5 @@ call ale#linter#Define('objc', {
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'clang',
|
||||
\ 'command_callback': 'ale_linters#objc#clang#GetCommand',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
|
||||
@@ -19,5 +19,5 @@ call ale#linter#Define('objcpp', {
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'clang++',
|
||||
\ 'command_callback': 'ale_linters#objcpp#clang#GetCommand',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
|
||||
@@ -1,20 +1,11 @@
|
||||
" Author: Vincent Lequertier <https://github.com/SkySymbol>
|
||||
" Description: This file adds support for checking perl syntax
|
||||
|
||||
let g:ale_perl_perl_executable =
|
||||
\ get(g:, 'ale_perl_perl_executable', 'perl')
|
||||
|
||||
let g:ale_perl_perl_options =
|
||||
\ get(g:, 'ale_perl_perl_options', '-c -Mwarnings -Ilib')
|
||||
|
||||
function! ale_linters#perl#perl#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'perl_perl_executable')
|
||||
endfunction
|
||||
call ale#Set('perl_perl_executable', 'perl')
|
||||
call ale#Set('perl_perl_options', '-c -Mwarnings -Ilib')
|
||||
|
||||
function! ale_linters#perl#perl#GetCommand(buffer) abort
|
||||
return ale#Escape(ale_linters#perl#perl#GetExecutable(a:buffer))
|
||||
\ . ' ' . ale#Var(a:buffer, 'perl_perl_options')
|
||||
\ . ' %t'
|
||||
return '%e' . ale#Pad(ale#Var(a:buffer, 'perl_perl_options')) . ' %t'
|
||||
endfunction
|
||||
|
||||
let s:begin_failed_skip_pattern = '\v' . join([
|
||||
@@ -61,7 +52,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('perl', {
|
||||
\ 'name': 'perl',
|
||||
\ 'executable_callback': 'ale_linters#perl#perl#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('perl_perl_executable'),
|
||||
\ 'output_stream': 'both',
|
||||
\ 'command_callback': 'ale_linters#perl#perl#GetCommand',
|
||||
\ 'callback': 'ale_linters#perl#perl#Handle',
|
||||
|
||||
@@ -1,21 +1,10 @@
|
||||
" Author: Vincent Lequertier <https://github.com/SkySymbol>, Chris Weyl <cweyl@alumni.drew.edu>
|
||||
" Description: This file adds support for checking perl with perl critic
|
||||
|
||||
let g:ale_perl_perlcritic_executable =
|
||||
\ get(g:, 'ale_perl_perlcritic_executable', 'perlcritic')
|
||||
|
||||
let g:ale_perl_perlcritic_profile =
|
||||
\ get(g:, 'ale_perl_perlcritic_profile', '.perlcriticrc')
|
||||
|
||||
let g:ale_perl_perlcritic_options =
|
||||
\ get(g:, 'ale_perl_perlcritic_options', '')
|
||||
|
||||
let g:ale_perl_perlcritic_showrules =
|
||||
\ get(g:, 'ale_perl_perlcritic_showrules', 0)
|
||||
|
||||
function! ale_linters#perl#perlcritic#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'perl_perlcritic_executable')
|
||||
endfunction
|
||||
call ale#Set('perl_perlcritic_executable', 'perlcritic')
|
||||
call ale#Set('perl_perlcritic_profile', '.perlcriticrc')
|
||||
call ale#Set('perl_perlcritic_options', '')
|
||||
call ale#Set('perl_perlcritic_showrules', 0)
|
||||
|
||||
function! ale_linters#perl#perlcritic#GetProfile(buffer) abort
|
||||
" first see if we've been overridden
|
||||
@@ -39,11 +28,11 @@ function! ale_linters#perl#perlcritic#GetCommand(buffer) abort
|
||||
let l:profile = ale_linters#perl#perlcritic#GetProfile(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'perl_perlcritic_options')
|
||||
|
||||
return ale#Escape(ale_linters#perl#perlcritic#GetExecutable(a:buffer))
|
||||
return '%e'
|
||||
\ . ' --verbose ' . ale#Escape(l:critic_verbosity)
|
||||
\ . ' --nocolor'
|
||||
\ . (!empty(l:profile) ? ' --profile ' . ale#Escape(l:profile) : '')
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ale#Pad(l:options)
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -66,7 +55,7 @@ endfunction
|
||||
call ale#linter#Define('perl', {
|
||||
\ 'name': 'perlcritic',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable_callback': 'ale_linters#perl#perlcritic#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('perl_perlcritic_executable'),
|
||||
\ 'command_callback': 'ale_linters#perl#perlcritic#GetCommand',
|
||||
\ 'callback': 'ale_linters#perl#perlcritic#Handle',
|
||||
\})
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
" Author: Zefei Xuan <https://github.com/zefei>
|
||||
" Description: Hack type checking (http://hacklang.org/)
|
||||
|
||||
function! ale_linters#php#hack#Handle(buffer, lines) abort
|
||||
let l:pattern = '^\(.*\):\(\d\+\):\(\d\+\),\(\d\+\): \(.\+])\)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
if a:buffer != bufnr(l:match[1])
|
||||
continue
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'text': l:match[5],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'hack',
|
||||
\ 'executable': 'hh_client',
|
||||
\ 'command': 'hh_client --retries 0 --retry-if-init false',
|
||||
\ 'callback': 'ale_linters#php#hack#Handle',
|
||||
\})
|
||||
@@ -4,16 +4,6 @@
|
||||
call ale#Set('php_langserver_executable', 'php-language-server.php')
|
||||
call ale#Set('php_langserver_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#php#langserver#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'php_langserver', [
|
||||
\ 'vendor/bin/php-language-server.php',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#langserver#GetCommand(buffer) abort
|
||||
return 'php ' . ale#Escape(ale_linters#php#langserver#GetExecutable(a:buffer))
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#langserver#GetProjectRoot(buffer) abort
|
||||
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
|
||||
|
||||
@@ -23,8 +13,9 @@ endfunction
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'langserver',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': 'ale_linters#php#langserver#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#php#langserver#GetCommand',
|
||||
\ 'language': 'php',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('php_langserver', [
|
||||
\ 'vendor/bin/php-language-server.php',
|
||||
\ ]),
|
||||
\ 'command': 'php %e',
|
||||
\ 'project_root_callback': 'ale_linters#php#langserver#GetProjectRoot',
|
||||
\})
|
||||
|
||||
@@ -6,23 +6,13 @@ let g:ale_php_phpcs_standard = get(g:, 'ale_php_phpcs_standard', '')
|
||||
call ale#Set('php_phpcs_executable', 'phpcs')
|
||||
call ale#Set('php_phpcs_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#php#phpcs#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'php_phpcs', [
|
||||
\ 'vendor/bin/phpcs',
|
||||
\ 'phpcs'
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#phpcs#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#php#phpcs#GetExecutable(a:buffer)
|
||||
|
||||
let l:standard = ale#Var(a:buffer, 'php_phpcs_standard')
|
||||
let l:standard_option = !empty(l:standard)
|
||||
\ ? '--standard=' . l:standard
|
||||
\ : ''
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . ' -s --report=emacs --stdin-path=%s ' . l:standard_option
|
||||
return '%e -s --report=emacs --stdin-path=%s' . ale#Pad(l:standard_option)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#phpcs#Handle(buffer, lines) abort
|
||||
@@ -50,7 +40,10 @@ endfunction
|
||||
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'phpcs',
|
||||
\ 'executable_callback': 'ale_linters#php#phpcs#GetExecutable',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('php_phpcs', [
|
||||
\ 'vendor/bin/phpcs',
|
||||
\ 'phpcs'
|
||||
\ ]),
|
||||
\ 'command_callback': 'ale_linters#php#phpcs#GetCommand',
|
||||
\ 'callback': 'ale_linters#php#phpcs#Handle',
|
||||
\})
|
||||
|
||||
@@ -6,16 +6,9 @@ let g:ale_php_phpmd_executable = get(g:, 'ale_php_phpmd_executable', 'phpmd')
|
||||
" Set to change the ruleset
|
||||
let g:ale_php_phpmd_ruleset = get(g:, 'ale_php_phpmd_ruleset', 'cleancode,codesize,controversial,design,naming,unusedcode')
|
||||
|
||||
function! ale_linters#php#phpmd#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'php_phpmd_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#phpmd#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#php#phpmd#GetExecutable(a:buffer)
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . ' %s text '
|
||||
\ . ale#Var(a:buffer, 'php_phpmd_ruleset')
|
||||
return '%e %s text'
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'php_phpmd_ruleset'))
|
||||
\ . ' --ignore-violations-on-exit %t'
|
||||
endfunction
|
||||
|
||||
@@ -39,7 +32,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'phpmd',
|
||||
\ 'executable_callback': 'ale_linters#php#phpmd#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('php_phpmd_executable'),
|
||||
\ 'command_callback': 'ale_linters#php#phpmd#GetCommand',
|
||||
\ 'callback': 'ale_linters#php#phpmd#Handle',
|
||||
\})
|
||||
|
||||
@@ -6,20 +6,13 @@ let g:ale_php_phpstan_executable = get(g:, 'ale_php_phpstan_executable', 'phpsta
|
||||
let g:ale_php_phpstan_level = get(g:, 'ale_php_phpstan_level', '4')
|
||||
let g:ale_php_phpstan_configuration = get(g:, 'ale_php_phpstan_configuration', '')
|
||||
|
||||
function! ale_linters#php#phpstan#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'php_phpstan_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#phpstan#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#php#phpstan#GetExecutable(a:buffer)
|
||||
|
||||
let l:configuration = ale#Var(a:buffer, 'php_phpstan_configuration')
|
||||
let l:configuration_option = !empty(l:configuration)
|
||||
\ ? ' -c ' . l:configuration
|
||||
\ : ''
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . ' analyze -l'
|
||||
return '%e analyze -l'
|
||||
\ . ale#Var(a:buffer, 'php_phpstan_level')
|
||||
\ . ' --errorFormat raw'
|
||||
\ . l:configuration_option
|
||||
@@ -47,7 +40,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'phpstan',
|
||||
\ 'executable_callback': 'ale_linters#php#phpstan#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('php_phpstan_executable'),
|
||||
\ 'command_callback': 'ale_linters#php#phpstan#GetCommand',
|
||||
\ 'callback': 'ale_linters#php#phpstan#Handle',
|
||||
\})
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
" 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',
|
||||
\})
|
||||
4
ale_linters/po/writegood.vim
Normal file
4
ale_linters/po/writegood.vim
Normal file
@@ -0,0 +1,4 @@
|
||||
" Author: Cian Butler https://github.com/butlerx
|
||||
" Description: write-good for PO files
|
||||
|
||||
call ale#handlers#writegood#DefineLinter('po')
|
||||
@@ -1,9 +0,0 @@
|
||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for Pod files
|
||||
|
||||
call ale#linter#Define('pod', {
|
||||
\ 'name': 'write-good',
|
||||
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
||||
\ 'callback': 'ale#handlers#writegood#Handle',
|
||||
\})
|
||||
4
ale_linters/pod/writegood.vim
Normal file
4
ale_linters/pod/writegood.vim
Normal file
@@ -0,0 +1,4 @@
|
||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for Pod files
|
||||
|
||||
call ale#handlers#writegood#DefineLinter('pod')
|
||||
@@ -3,19 +3,14 @@
|
||||
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')
|
||||
return '%e' . ale#Pad(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',
|
||||
\ 'executable_callback': ale#VarFunc('pony_ponyc_executable'),
|
||||
\ 'command_callback': 'ale_linters#pony#ponyc#GetCommand',
|
||||
\ 'callback': 'ale#handlers#pony#HandlePonycFormat',
|
||||
\})
|
||||
|
||||
@@ -5,12 +5,6 @@ call ale#Set('pug_puglint_options', '')
|
||||
call ale#Set('pug_puglint_executable', 'pug-lint')
|
||||
call ale#Set('pug_puglint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#pug#puglint#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'pug_puglint', [
|
||||
\ 'node_modules/.bin/pug-lint',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! s:FindConfig(buffer) abort
|
||||
for l:filename in [
|
||||
\ '.pug-lintrc',
|
||||
@@ -29,19 +23,19 @@ function! s:FindConfig(buffer) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#pug#puglint#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#pug#puglint#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'pug_puglint_options')
|
||||
let l:config = s:FindConfig(a:buffer)
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
return '%e' . ale#Pad(l:options)
|
||||
\ . (!empty(l:config) ? ' -c ' . ale#Escape(l:config) : '')
|
||||
\ . ' -r inline %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('pug', {
|
||||
\ 'name': 'puglint',
|
||||
\ 'executable_callback': 'ale_linters#pug#puglint#GetExecutable',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('pug_puglint', [
|
||||
\ 'node_modules/.bin/pug-lint',
|
||||
\ ]),
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'command_callback': 'ale_linters#pug#puglint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||
|
||||
35
ale_linters/puppet/languageserver.vim
Normal file
35
ale_linters/puppet/languageserver.vim
Normal file
@@ -0,0 +1,35 @@
|
||||
" Author: Alexander Olofsson <alexander.olofsson@liu.se>
|
||||
" Description: Puppet Language Server integration for ALE
|
||||
|
||||
call ale#Set('puppet_languageserver_executable', 'puppet-languageserver')
|
||||
|
||||
function! ale_linters#puppet#languageserver#GetProjectRoot(buffer) abort
|
||||
" Note: The metadata.json file is recommended for Puppet 4+ modules, but
|
||||
" there's no requirement to have it, so fall back to the other possible
|
||||
" Puppet module directories
|
||||
let l:root_path = ale#path#FindNearestFile(a:buffer, 'metadata.json')
|
||||
if !empty(l:root_path)
|
||||
return fnamemodify(l:root_path, ':h')
|
||||
endif
|
||||
|
||||
for l:test_path in [
|
||||
\ 'manifests',
|
||||
\ 'templates',
|
||||
\]
|
||||
let l:root_path = ale#path#FindNearestDirectory(a:buffer, l:test_path)
|
||||
if !empty(l:root_path)
|
||||
return fnamemodify(l:root_path, ':h:h')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('puppet', {
|
||||
\ 'name': 'languageserver',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('puppet_languageserver_executable'),
|
||||
\ 'command': '%e --stdio',
|
||||
\ 'language': 'puppet',
|
||||
\ 'project_root_callback': 'ale_linters#puppet#languageserver#GetProjectRoot',
|
||||
\})
|
||||
@@ -1,26 +1,18 @@
|
||||
" Author: Alexander Olofsson <alexander.olofsson@liu.se>, Robert Flechtner <flechtner@chemmedia.de>
|
||||
" Description: puppet-lint for puppet files
|
||||
|
||||
let g:ale_puppet_puppetlint_executable =
|
||||
\ get(g:, 'ale_puppet_puppetlint_executable', 'puppet-lint')
|
||||
|
||||
let g:ale_puppet_puppetlint_options =
|
||||
\ get(g:, 'ale_puppet_puppetlint_options', '--no-autoloader_layout-check')
|
||||
|
||||
function! ale_linters#puppet#puppetlint#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'puppet_puppetlint_executable')
|
||||
endfunction
|
||||
call ale#Set('puppet_puppetlint_executable', 'puppet-lint')
|
||||
call ale#Set('puppet_puppetlint_options', '--no-autoloader_layout-check')
|
||||
|
||||
function! ale_linters#puppet#puppetlint#GetCommand(buffer) abort
|
||||
return ale_linters#puppet#puppetlint#GetExecutable(a:buffer)
|
||||
\ . ' ' . ale#Var(a:buffer, 'puppet_puppetlint_options')
|
||||
return '%e' . ale#Pad(ale#Var(a:buffer, 'puppet_puppetlint_options'))
|
||||
\ . ' --log-format "-:%{line}:%{column}: %{kind}: [%{check}] %{message}"'
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('puppet', {
|
||||
\ 'name': 'puppetlint',
|
||||
\ 'executable_callback': 'ale_linters#puppet#puppetlint#GetExecutable',
|
||||
\ 'executable_callback': ale#VarFunc('puppet_puppetlint_executable'),
|
||||
\ 'command_callback': 'ale_linters#puppet#puppetlint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\})
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user