mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 05:04:28 +08:00
Compare commits
249 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02af53b8b0 | ||
|
|
ce64e349cd | ||
|
|
e85eb82401 | ||
|
|
3bebcb5d48 | ||
|
|
cdf89f8269 | ||
|
|
8c31e2f04a | ||
|
|
435a072181 | ||
|
|
5be6a2b4e0 | ||
|
|
669aeb2c9d | ||
|
|
e3080e2c1b | ||
|
|
cfffdab856 | ||
|
|
1dbba6849f | ||
|
|
2f1d1b7826 | ||
|
|
5fe45f3219 | ||
|
|
6a29641872 | ||
|
|
89273b65b8 | ||
|
|
3eb6d7b3db | ||
|
|
e1e8f0dae1 | ||
|
|
000c37e775 | ||
|
|
442d672d8a | ||
|
|
a92627e1e1 | ||
|
|
32c8bd1fa4 | ||
|
|
8768a309b8 | ||
|
|
ad998211f8 | ||
|
|
8ec9615400 | ||
|
|
a3a052b55a | ||
|
|
dfff73795a | ||
|
|
80ef7ea2d0 | ||
|
|
67ea571659 | ||
|
|
5f03bae41c | ||
|
|
b0fac47060 | ||
|
|
365ffae6c4 | ||
|
|
f0da35b958 | ||
|
|
a22ab78dd7 | ||
|
|
a6012d853c | ||
|
|
d9a12348d0 | ||
|
|
03384a5d6f | ||
|
|
a5cf7e854b | ||
|
|
8a0213f1fd | ||
|
|
c6a6a37931 | ||
|
|
7eae06d3f3 | ||
|
|
fd31987f23 | ||
|
|
413529f603 | ||
|
|
be2c0c3af5 | ||
|
|
5505f2323d | ||
|
|
6aef52f026 | ||
|
|
cf883aa5a8 | ||
|
|
e5746d9a83 | ||
|
|
4fc27f099b | ||
|
|
32dbf5942e | ||
|
|
163f0ab06e | ||
|
|
26460a77a7 | ||
|
|
c4328f2a31 | ||
|
|
37a1d24a36 | ||
|
|
38009b8e58 | ||
|
|
70a9176de0 | ||
|
|
89e5491862 | ||
|
|
883978ece9 | ||
|
|
f53b25d256 | ||
|
|
f8aeb5c5a4 | ||
|
|
ffa45fa3fb | ||
|
|
a8b987a1c3 | ||
|
|
8012e5b60f | ||
|
|
707a42167f | ||
|
|
09cbd70d9b | ||
|
|
b8cecca8c8 | ||
|
|
fefc093e70 | ||
|
|
90457fdb6b | ||
|
|
52c2400786 | ||
|
|
3300b1aca7 | ||
|
|
c3d4e0983b | ||
|
|
5b6df0a85f | ||
|
|
1a69c9c88c | ||
|
|
0d10653a7c | ||
|
|
89039187da | ||
|
|
7487ecb957 | ||
|
|
3140abcd0c | ||
|
|
3050a132b5 | ||
|
|
21a8b9f1e3 | ||
|
|
1ee56713b8 | ||
|
|
e88243687a | ||
|
|
f1bf795b8b | ||
|
|
690b1a5bb1 | ||
|
|
926ad47a49 | ||
|
|
a6caa85a58 | ||
|
|
bf196ba17c | ||
|
|
df9bee88f6 | ||
|
|
aca1edb476 | ||
|
|
6ebe24b5ff | ||
|
|
752e6f0ab9 | ||
|
|
5dbac4ab9c | ||
|
|
b235e08b3c | ||
|
|
a0d4eb3699 | ||
|
|
82b15fb706 | ||
|
|
7a48750610 | ||
|
|
d072d2654c | ||
|
|
a24f0b4d5f | ||
|
|
422908a572 | ||
|
|
ba6f08f3d4 | ||
|
|
3ba7d02708 | ||
|
|
1fb0de2a8e | ||
|
|
d21581016e | ||
|
|
800d029b46 | ||
|
|
b32fdfe816 | ||
|
|
19cc724807 | ||
|
|
2885c57e3e | ||
|
|
5ce1e9b0b4 | ||
|
|
0b9c0c2200 | ||
|
|
b47a0c9519 | ||
|
|
c0c634c5ec | ||
|
|
81c73da3b9 | ||
|
|
3e11cbd18d | ||
|
|
70b95f16c3 | ||
|
|
9f63bec12c | ||
|
|
7ce481c8f6 | ||
|
|
a4ed9a1c35 | ||
|
|
37daedafed | ||
|
|
626572a539 | ||
|
|
771581a945 | ||
|
|
4d426bf287 | ||
|
|
de29ff26ff | ||
|
|
067601e9db | ||
|
|
17a2f554e3 | ||
|
|
08d3523962 | ||
|
|
3c38fdb1bb | ||
|
|
a7b3b84899 | ||
|
|
03b25dd39b | ||
|
|
79135dfe13 | ||
|
|
d7ced31fe2 | ||
|
|
e46c17e8ef | ||
|
|
f03370e183 | ||
|
|
d882c434a1 | ||
|
|
3ac12b6939 | ||
|
|
dd995d9aa9 | ||
|
|
6288c8b08e | ||
|
|
b8bf7b220d | ||
|
|
91c1fc3bb3 | ||
|
|
20b9dfdb4a | ||
|
|
6e9040da75 | ||
|
|
0a9dc7b4ba | ||
|
|
6543d0e902 | ||
|
|
a47deeae40 | ||
|
|
452460b8cd | ||
|
|
cf14d0aa53 | ||
|
|
0a5de2b42b | ||
|
|
6fc016ad05 | ||
|
|
766636e0c4 | ||
|
|
a6de3f3727 | ||
|
|
eec8b9da60 | ||
|
|
8037f472ef | ||
|
|
e273f678ff | ||
|
|
f12d312aa4 | ||
|
|
d0284f22ea | ||
|
|
a4932679b5 | ||
|
|
bcf63eea96 | ||
|
|
37107df6f3 | ||
|
|
c2e4b553d0 | ||
|
|
e960e54eca | ||
|
|
2e85eed756 | ||
|
|
bffb26cb72 | ||
|
|
f2db164268 | ||
|
|
bd1e639681 | ||
|
|
9c0c6efbd0 | ||
|
|
d6d6fcf928 | ||
|
|
cdc3bc9238 | ||
|
|
08affaad7a | ||
|
|
d1fc084b2d | ||
|
|
6efa37d35b | ||
|
|
86af4be0d0 | ||
|
|
a50e049e74 | ||
|
|
d09e8bc99e | ||
|
|
c0b2090fbb | ||
|
|
7f176390fc | ||
|
|
56b7dca623 | ||
|
|
cbaa7eb3c7 | ||
|
|
6644563949 | ||
|
|
d8a53cc7a5 | ||
|
|
fabebb3a47 | ||
|
|
721183116e | ||
|
|
7e7447bb93 | ||
|
|
4bbb10b46a | ||
|
|
4f72023e16 | ||
|
|
f23811770a | ||
|
|
84475ff6f1 | ||
|
|
b1b05e6e66 | ||
|
|
9bcf8a2336 | ||
|
|
1d7acad891 | ||
|
|
0fcd5e79a9 | ||
|
|
cb0a5c7a36 | ||
|
|
5bbe77101d | ||
|
|
4f3190daa8 | ||
|
|
3b96ab43fb | ||
|
|
1f21eb0c42 | ||
|
|
4a11a6337e | ||
|
|
ba38688dff | ||
|
|
bbf02d837e | ||
|
|
08606b88d0 | ||
|
|
7919db0db5 | ||
|
|
1b264b8662 | ||
|
|
78724f4cd3 | ||
|
|
a1654cfb58 | ||
|
|
5f613a5fd6 | ||
|
|
1d87c844b0 | ||
|
|
5792bd6e29 | ||
|
|
f534db1ef9 | ||
|
|
24fda01a0e | ||
|
|
e5f33c6598 | ||
|
|
f7c4c403eb | ||
|
|
8550fa6059 | ||
|
|
3ec20a730d | ||
|
|
c499825a0b | ||
|
|
48057407ec | ||
|
|
4bf260e953 | ||
|
|
63e76875d5 | ||
|
|
1c9ad77866 | ||
|
|
6619e1ac53 | ||
|
|
73ca1e7191 | ||
|
|
5345a5dd81 | ||
|
|
73a204dd00 | ||
|
|
c19f2aa302 | ||
|
|
f1ed654ca5 | ||
|
|
0e3778e335 | ||
|
|
e55d07cf6f | ||
|
|
9a3be907ea | ||
|
|
ebab81b220 | ||
|
|
13060a3492 | ||
|
|
38d25fc7c0 | ||
|
|
5052eca5cb | ||
|
|
2cfa09e02d | ||
|
|
c899ff3523 | ||
|
|
39c892eff4 | ||
|
|
a6a8c90126 | ||
|
|
57a04701c3 | ||
|
|
cbc029b2b8 | ||
|
|
9226e13b31 | ||
|
|
3db564f774 | ||
|
|
fdd37acc1f | ||
|
|
2760cf7018 | ||
|
|
dc61d46e28 | ||
|
|
3346b200bf | ||
|
|
92668b6beb | ||
|
|
b4bcbfcc3b | ||
|
|
f4af9157e1 | ||
|
|
0d14380d8a | ||
|
|
f2b353fa09 | ||
|
|
6f32f002e7 | ||
|
|
9eda079e02 | ||
|
|
146769c616 | ||
|
|
9e97a6914e |
5
.github/ISSUE_TEMPLATE/report-a-bug.md
vendored
5
.github/ISSUE_TEMPLATE/report-a-bug.md
vendored
@@ -27,8 +27,9 @@ Operating System: <!-- Describe your operating system version. -->
|
||||
|
||||
<!-- Describe what went wrong here. Be specific. -->
|
||||
|
||||
Something went wrong in specifically this place, and I also searched through
|
||||
both open and closed issues for the same problem before reporting a bug here.
|
||||
Something went wrong in specifically this place, and I also searched through both open and closed issues for the same problem before reporting a bug here.
|
||||
|
||||
Are you having trouble configuring ALE? Try asking for help on [Stack Exchange](https://vi.stackexchange.com/) or perhaps on [Reddit](https://www.reddit.com/r/vim/) instead. The GitHub issue tracker should be used for reporting bugs or asking for new features.
|
||||
|
||||
## Reproducing the bug
|
||||
|
||||
|
||||
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -2,7 +2,7 @@
|
||||
Before creating a pull request, do the following.
|
||||
|
||||
* Read the Contributing guide linked above first.
|
||||
* Read the documentation that comes with ALE with `:help ale-development`.
|
||||
* Read the documentation that comes with ALE with `:help ale-dev`.
|
||||
|
||||
Have fun!
|
||||
-->
|
||||
@@ -10,4 +10,4 @@ Have fun!
|
||||
Where are the tests? Have you added tests? Have you updated the tests? Read the
|
||||
comment above and the documentation referenced in it first. Write tests!
|
||||
|
||||
Seriously, read `:help ale-development` and write tests.
|
||||
Seriously, read `:help ale-dev` and write tests.
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,7 @@
|
||||
!.editorconfig
|
||||
*.obj
|
||||
# Ignore all hidden files everywhere.
|
||||
# Use `git add -f` to add hidden files.
|
||||
.*
|
||||
/doc/tags
|
||||
/init.vim
|
||||
|
||||
172
README.md
172
README.md
@@ -1,11 +1,11 @@
|
||||
# Asynchronous Lint Engine [](https://travis-ci.org/w0rp/ale) [](https://ci.appveyor.com/project/w0rp/ale)
|
||||
# Asynchronous Lint Engine [](https://travis-ci.org/w0rp/ale) [](https://ci.appveyor.com/project/w0rp/ale) [](https://gitter.im/vim-ale/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
|
||||

|
||||
|
||||
ALE (Asynchronous Lint Engine) is a plugin for providing linting in NeoVim
|
||||
0.2.0+ and Vim 8 while you edit your text files, and acts as a Vim
|
||||
[Language Server Protocol](https://langserver.org/) client.
|
||||
ALE (Asynchronous Lint Engine) is a plugin for providing linting (checking
|
||||
syntax and semantics) in NeoVim 0.2.0+ and Vim 8 while you edit your text files,
|
||||
and acts as a Vim [Language Server Protocol](https://langserver.org/) client.
|
||||
|
||||
<img src="img/example.gif?raw=true" alt="A linting example with the darkspectrum color scheme in GVim." title="A linting example with the darkspectrum color scheme in GVim.">
|
||||
|
||||
@@ -73,140 +73,15 @@ other content at [w0rp.com](https://w0rp.com).
|
||||
15. [How can I configure my C or C++ project?](#faq-c-configuration)
|
||||
16. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
|
||||
17. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
|
||||
18. [How can I see what ALE has configured for the current file?](#faq-get-info)
|
||||
|
||||
<a name="supported-languages"></a>
|
||||
|
||||
## 1. Supported Languages and Tools
|
||||
|
||||
This plugin supports the following languages and tools. All available
|
||||
tools will be run in combination, so they can be complementary.
|
||||
|
||||
<!--
|
||||
Keep the table rows sorted alphabetically by the language name,
|
||||
and the tools in the tools column sorted alphabetically by the tool
|
||||
name. That seems to be the fairest way to arrange this table.
|
||||
|
||||
Remember to also update doc/ale.txt, which has a similar list with different
|
||||
formatting.
|
||||
-->
|
||||
|
||||
**Notes:**
|
||||
|
||||
* *^ No linters for text or Vim help filetypes are enabled by default.*
|
||||
* *!! These linters check only files on disk. See `:help ale-lint-file-linters`*
|
||||
|
||||
| Language | Tools |
|
||||
| -------- | ----- |
|
||||
| Ada | [gcc](https://gcc.gnu.org) |
|
||||
| ASM | [gcc](https://gcc.gnu.org) |
|
||||
| Ansible | [ansible-lint](https://github.com/willthames/ansible-lint) |
|
||||
| API Blueprint | [drafter](https://github.com/apiaryio/drafter) |
|
||||
| AsciiDoc | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [write-good](https://github.com/btford/write-good), [vale](https://github.com/ValeLint/vale) |
|
||||
| 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/), [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/), [uncrustify](https://github.com/uncrustify/uncrustify), [ccls](https://github.com/MaskRay/ccls) |
|
||||
| C++ (filetype cpp) | [clang](http://clang.llvm.org/), [clangd](https://clang.llvm.org/extra/clangd.html), [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), [clazy](https://github.com/KDE/clazy) !!, [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/), [uncrustify](https://github.com/uncrustify/uncrustify), [ccls](https://github.com/MaskRay/ccls) |
|
||||
| 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, [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| Chef | [foodcritic](http://www.foodcritic.io/) |
|
||||
| Clojure | [joker](https://github.com/candid82/joker) |
|
||||
| CloudFormation | [cfn-python-lint](https://github.com/awslabs/cfn-python-lint) |
|
||||
| CMake | [cmakelint](https://github.com/richq/cmake-lint) |
|
||||
| CoffeeScript | [coffee](http://coffeescript.org/), [coffeelint](https://www.npmjs.com/package/coffeelint) |
|
||||
| Crystal | [crystal](https://crystal-lang.org/) !! |
|
||||
| CSS | [csslint](http://csslint.net/), [prettier](https://github.com/prettier/prettier), [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| Cucumber | [cucumber](https://cucumber.io/) |
|
||||
| Cython (pyrex filetype) | [cython](http://cython.org/) |
|
||||
| D | [dls](https://github.com/d-language-server/dls), [dmd](https://dlang.org/dmd-linux.html), [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| Dafny | [dafny](https://rise4fun.com/Dafny) !! |
|
||||
| Dart | [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) !!, [language_server](https://github.com/natebosch/dart_language_server), [dartfmt](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt) |
|
||||
| Dockerfile | [dockerfile_lint](https://github.com/projectatomic/dockerfile_lint), [hadolint](https://github.com/hadolint/hadolint) |
|
||||
| Elixir | [credo](https://github.com/rrrene/credo), [dialyxir](https://github.com/jeremyjh/dialyxir), [dogma](https://github.com/lpil/dogma), [mix](https://hexdocs.pm/mix/Mix.html) !!, [elixir-ls](https://github.com/JakeBecker/elixir-ls) |
|
||||
| Elm | [elm-format](https://github.com/avh4/elm-format), [elm-make](https://github.com/elm-lang/elm-make) |
|
||||
| Erb | [erb](https://apidock.com/ruby/ERB), [erubi](https://github.com/jeremyevans/erubi), [erubis](https://github.com/kwatch/erubis), [ruumba](https://github.com/ericqweinstein/ruumba) |
|
||||
| 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/), [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 mod](https://golang.org/cmd/go/) !!, [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) !!, [golangserver](https://github.com/sourcegraph/go-langserver), [golangci-lint](https://github.com/golangci/golangci-lint) !! |
|
||||
| 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/), [cabal-ghc](https://www.haskell.org/cabal/), [stylish-haskell](https://github.com/jaspervdj/stylish-haskell), [stack-ghc](https://haskellstack.org/), [stack-build](https://haskellstack.org/) !!, [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) |
|
||||
| HCL | [terraform-fmt](https://github.com/hashicorp/terraform) |
|
||||
| HTML | [alex](https://github.com/wooorm/alex) !!, [HTMLHint](http://htmlhint.com/), [proselint](http://proselint.com/), [tidy](http://www.html-tidy.org/), [prettier](https://github.com/prettier/prettier), [write-good](https://github.com/btford/write-good) |
|
||||
| Idris | [idris](http://www.idris-lang.org/) |
|
||||
| ISPC | [ispc](https://ispc.github.io/) !! |
|
||||
| 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/), [javalsp](https://github.com/georgewfraser/vscode-javac), [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| 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) |
|
||||
| Julia | [languageserver](https://github.com/JuliaEditorSupport/LanguageServer.jl) |
|
||||
| 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) |
|
||||
| MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) |
|
||||
| Mercury | [mmc](http://mercurylang.org) !! |
|
||||
| NASM | [nasm](https://www.nasm.us/) !! |
|
||||
| Nim | [nim check](https://nim-lang.org/docs/nimc.html) !! |
|
||||
| nix | [nix-instantiate](http://nixos.org/nix/manual/#sec-nix-instantiate) |
|
||||
| nroff | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good)|
|
||||
| Objective-C | [clang](http://clang.llvm.org/), [clangd](https://clang.llvm.org/extra/clangd.html), [uncrustify](https://github.com/uncrustify/uncrustify), [ccls](https://github.com/MaskRay/ccls) |
|
||||
| Objective-C++ | [clang](http://clang.llvm.org/), [clangd](https://clang.llvm.org/extra/clangd.html), [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| 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), [ocamlformat](https://github.com/ocaml-ppx/ocamlformat) |
|
||||
| Pawn | [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| Perl | [perl -c](https://perl.org/), [perl-critic](https://metacpan.org/pod/Perl::Critic), [perltidy](https://metacpan.org/pod/distribution/Perl-Tidy/bin/perltidy) |
|
||||
| Perl6 | [perl6 -c](https://perl6.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/), [psalm](https://getpsalm.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) |
|
||||
| Prolog | [swipl](https://github.com/SWI-Prolog/swipl-devel) |
|
||||
| proto | [protoc-gen-lint](https://github.com/ckaznocha/protoc-gen-lint) |
|
||||
| Pug | [pug-lint](https://github.com/pugjs/pug-lint) |
|
||||
| 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](https://github.com/PyCQA/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) |
|
||||
| reStructuredText | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [rstcheck](https://github.com/myint/rstcheck), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
||||
| Re:VIEW | [redpen](http://redpen.cc/) |
|
||||
| RPM spec | [rpmlint](https://github.com/rpm-software-management/rpmlint) (disabled by default; see `:help ale-integration-spec`) |
|
||||
| Ruby | [brakeman](http://brakemanscanner.org/) !!, [rails_best_practices](https://github.com/flyerhzm/rails_best_practices) !!, [reek](https://github.com/troessner/reek), [rubocop](https://github.com/bbatsov/rubocop), [ruby](https://www.ruby-lang.org), [rufo](https://github.com/ruby-formatter/rufo), [solargraph](https://solargraph.org) |
|
||||
| Rust | [cargo](https://github.com/rust-lang/cargo) !! (see `:help ale-integration-rust` for configuration instructions), [rls](https://github.com/rust-lang-nursery/rls), [rustc](https://www.rust-lang.org/), [rustfmt](https://github.com/rust-lang-nursery/rustfmt) |
|
||||
| SASS | [sass-lint](https://www.npmjs.com/package/sass-lint), [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| SCSS | [prettier](https://github.com/prettier/prettier), [sass-lint](https://www.npmjs.com/package/sass-lint), [scss-lint](https://github.com/brigade/scss-lint), [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| Scala | [fsc](https://www.scala-lang.org/old/sites/default/files/linuxsoft_archives/docu/files/tools/fsc.html), [sbtserver](https://www.scala-sbt.org/1.x/docs/sbt-server.html), [scalac](http://scala-lang.org), [scalafmt](https://scalameta.org/scalafmt/), [scalastyle](http://www.scalastyle.org)|
|
||||
| Slim | [slim-lint](https://github.com/sds/slim-lint) |
|
||||
| SML | [smlnj](http://www.smlnj.org/) |
|
||||
| Solidity | [solhint](https://github.com/protofire/solhint), [solium](https://github.com/duaraghav8/Solium) |
|
||||
| Stylus | [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| SQL | [sqlint](https://github.com/purcell/sqlint), [sqlfmt](https://github.com/jackc/sqlfmt) |
|
||||
| Swift | [swiftlint](https://github.com/realm/SwiftLint), [swiftformat](https://github.com/nicklockwood/SwiftFormat) |
|
||||
| Tcl | [nagelfar](http://nagelfar.sourceforge.net) !! |
|
||||
| Terraform | [fmt](https://github.com/hashicorp/terraform), [tflint](https://github.com/wata727/tflint) |
|
||||
| Texinfo | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good)|
|
||||
| Text^ | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [textlint](https://textlint.github.io/), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
||||
| Thrift | [thrift](http://thrift.apache.org/) |
|
||||
| TypeScript | [eslint](http://eslint.org/), [prettier](https://github.com/prettier/prettier), [tslint](https://github.com/palantir/tslint), [tsserver](https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29), typecheck |
|
||||
| VALA | [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| 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), [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 | [prettier](https://github.com/prettier/prettier), [swaglint](https://github.com/byCedric/swaglint), [yamllint](https://yamllint.readthedocs.io/) |
|
||||
| YANG | [yang-lsp](https://github.com/theia-ide/yang-lsp) |
|
||||
ALE supports a wide variety of languages and tools. See the
|
||||
[full list](supported-tools.md) in the
|
||||
[Supported Languages and Tools](supported-tools.md) page.
|
||||
|
||||
<a name="usage"></a>
|
||||
|
||||
@@ -226,7 +101,7 @@ new buffers or as you make edits to your files.
|
||||
The behaviour of linting can be configured with a variety of options,
|
||||
documented in [the Vim help file](doc/ale.txt). For more information on the
|
||||
options ALE offers, consult `:help ale-options` for global options and `:help
|
||||
ale-linter-options` for options specified to particular linters.
|
||||
ale-integration-options` for options specified to particular linters.
|
||||
|
||||
<a name="usage-fixing"></a>
|
||||
|
||||
@@ -574,8 +449,16 @@ let g:airline#extensions#ale#enabled = 1
|
||||
```
|
||||
|
||||
If you don't want to use vim-airline, you can implement your own statusline
|
||||
function without adding any other plugins. ALE provides a function for counting
|
||||
the number of problems for this purpose, named `ale#statusline#Count`.
|
||||
function without adding any other plugins. ALE provides some functions to
|
||||
assist in this endeavour, including:
|
||||
|
||||
* `ale#statusline#Count`: Which returns the number of problems found by ALE
|
||||
for a specified buffer.
|
||||
* `ale#statusline#FirstProblem`: Which returns a dictionary containing the
|
||||
full loclist details of the first problem of a specified type found by ALE
|
||||
in a buffer. (e.g. The first style warning in the current buffer.)
|
||||
This can be useful for displaying more detailed information such as the
|
||||
line number of the first problem in a file.
|
||||
|
||||
Say you want to display all errors as one figure, and all non-errors as another
|
||||
figure. You can do the following:
|
||||
@@ -597,7 +480,8 @@ endfunction
|
||||
set statusline=%{LinterStatus()}
|
||||
```
|
||||
|
||||
See `:help ale#statusline#Count()` for more information.
|
||||
See `:help ale#statusline#Count()` or `:help ale#statusline#FirstProblem()`
|
||||
for more information.
|
||||
|
||||
<a name="faq-lightline"></a>
|
||||
|
||||
@@ -619,7 +503,7 @@ There are 3 global options that allow customizing the echoed message.
|
||||
* `%...code...%` is an optional error code, and most characters can be
|
||||
written between the `%` characters.
|
||||
* `%linter%` is the linter name
|
||||
* `%severity` is the severity type
|
||||
* `%severity%` is the severity type
|
||||
- `g:ale_echo_msg_error_str` is the string used for error severity.
|
||||
- `g:ale_echo_msg_warning_str` is the string used for warning severity.
|
||||
|
||||
@@ -759,7 +643,7 @@ Or if you want, you can configure the linters from your vimrc file.
|
||||
|
||||
```vim
|
||||
" In ~/.vim/vimrc, or somewhere similar.
|
||||
let g:ale_linter_aliases = {'jsx': ['css, 'javascript']}
|
||||
let g:ale_linter_aliases = {'jsx': ['css', 'javascript']}
|
||||
let g:ale_linters = {'jsx': ['stylelint', 'eslint']}
|
||||
```
|
||||
|
||||
@@ -896,3 +780,13 @@ To set a default height for the error list, use the `g:ale_list_window_size` var
|
||||
" Show 5 lines of errors (default: 10)
|
||||
let g:ale_list_window_size = 5
|
||||
```
|
||||
|
||||
<a name="faq-get-info"></a>
|
||||
|
||||
### 5.xviii. How can I see what ALE has configured for the current file?
|
||||
|
||||
Run the following to see what is currently configured:
|
||||
|
||||
```vim
|
||||
:ALEInfo
|
||||
```
|
||||
|
||||
@@ -12,7 +12,7 @@ function! ale_linters#ada#gcc#GetCommand(buffer) abort
|
||||
" the .ali file may be created even if no code generation is attempted.
|
||||
" The output file name must match the source file name (except for the
|
||||
" extension), so here we cannot use the null file as output.
|
||||
let l:tmp_dir = fnamemodify(ale#engine#CreateDirectory(a:buffer), ':p')
|
||||
let l:tmp_dir = fnamemodify(ale#command#CreateDirectory(a:buffer), ':p')
|
||||
let l:out_file = l:tmp_dir . fnamemodify(bufname(a:buffer), ':t:r') . '.o'
|
||||
|
||||
" -gnatc: Check syntax and semantics only (no code generation attempted)
|
||||
@@ -48,7 +48,7 @@ endfunction
|
||||
call ale#linter#Define('ada', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('ada_gcc_executable'),
|
||||
\ 'command_callback': 'ale_linters#ada#gcc#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'ada_gcc_executable')},
|
||||
\ 'command': function('ale_linters#ada#gcc#GetCommand'),
|
||||
\ 'callback': 'ale_linters#ada#gcc#Handle',
|
||||
\})
|
||||
|
||||
@@ -50,7 +50,7 @@ endfunction
|
||||
call ale#linter#Define('ansible', {
|
||||
\ 'name': 'ansible_lint',
|
||||
\ 'aliases': ['ansible', 'ansible-lint'],
|
||||
\ 'executable_callback': 'ale_linters#ansible#ansible_lint#GetExecutable',
|
||||
\ 'executable': function('ale_linters#ansible#ansible_lint#GetExecutable'),
|
||||
\ 'command': '%e -p %t',
|
||||
\ 'callback': 'ale_linters#ansible#ansible_lint#Handle',
|
||||
\})
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
" Author: Johannes Wienke <languitar@semipol.de>
|
||||
" Description: alex for asciidoc files
|
||||
|
||||
call ale#linter#Define('help', {
|
||||
\ 'name': 'alex',
|
||||
\ 'executable': 'alex',
|
||||
\ 'command': 'alex %s -t',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale#handlers#alex#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
call ale#handlers#alex#DefineLinter('asciidoc', '--text')
|
||||
|
||||
9
ale_linters/asciidoc/textlint.vim
Normal file
9
ale_linters/asciidoc/textlint.vim
Normal file
@@ -0,0 +1,9 @@
|
||||
" Author: TANIGUCHI Masaya <ta2gch@gmail.com>
|
||||
" Description: textlint for AsciiDoc files
|
||||
|
||||
call ale#linter#Define('asciidoc', {
|
||||
\ 'name': 'textlint',
|
||||
\ 'executable': function('ale#handlers#textlint#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#textlint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#textlint#HandleTextlintOutput',
|
||||
\})
|
||||
@@ -28,7 +28,7 @@ endfunction
|
||||
call ale#linter#Define('asm', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('asm_gcc_executable'),
|
||||
\ 'command_callback': 'ale_linters#asm#gcc#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'asm_gcc_executable')},
|
||||
\ 'command': function('ale_linters#asm#gcc#GetCommand'),
|
||||
\ 'callback': 'ale_linters#asm#gcc#Handle',
|
||||
\})
|
||||
|
||||
@@ -15,8 +15,8 @@ endfunction
|
||||
|
||||
call ale#linter#Define('awk', {
|
||||
\ 'name': 'gawk',
|
||||
\ 'executable_callback': ale#VarFunc('awk_gawk_executable'),
|
||||
\ 'command_callback': 'ale_linters#awk#gawk#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'awk_gawk_executable')},
|
||||
\ 'command': function('ale_linters#awk#gawk#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#gawk#HandleGawkFormat',
|
||||
\ 'output_stream': 'both'
|
||||
\})
|
||||
|
||||
75
ale_linters/bib/bibclean.vim
Normal file
75
ale_linters/bib/bibclean.vim
Normal file
@@ -0,0 +1,75 @@
|
||||
" Author: Horacio Sanson - https://github.com/hsanson
|
||||
" Description: Support for bibclean linter for BibTeX files.
|
||||
|
||||
call ale#Set('bib_bibclean_executable', 'bibclean')
|
||||
|
||||
function! ale_linters#bib#bibclean#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'bib_bibclean_executable')
|
||||
|
||||
return ale#Escape(l:executable) . ' -file-position '
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bib#bibclean#get_type(str) abort
|
||||
if a:str is# '??'
|
||||
return 'E'
|
||||
else
|
||||
return 'W'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bib#bibclean#match_msg(line) abort
|
||||
return matchlist(a:line, '^\(.*\) "stdin", line \(.*\): \(.*\)$')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bib#bibclean#match_entry(line) abort
|
||||
return matchlist(a:line, 'Entry input byte=.* line=\(.*\) column=\(.*\) output .*$')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bib#bibclean#match_value(line) abort
|
||||
return matchlist(a:line, 'Value input byte=.* line=\(.*\) column=\(.*\) output .*$')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bib#bibclean#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
|
||||
let l:type = 'E'
|
||||
let l:msg = ''
|
||||
|
||||
for l:line in a:lines
|
||||
if empty(l:msg)
|
||||
let l:mlist = ale_linters#bib#bibclean#match_msg(l:line)
|
||||
|
||||
if !empty(l:mlist)
|
||||
let l:msg = l:mlist[3]
|
||||
let l:type = ale_linters#bib#bibclean#get_type(l:mlist[1])
|
||||
endif
|
||||
else
|
||||
if l:type is# 'E'
|
||||
let l:mlist = ale_linters#bib#bibclean#match_entry(l:line)
|
||||
else
|
||||
let l:mlist = ale_linters#bib#bibclean#match_value(l:line)
|
||||
endif
|
||||
|
||||
if !empty(l:mlist)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:mlist[1],
|
||||
\ 'col': l:mlist[2],
|
||||
\ 'text': l:msg,
|
||||
\ 'type': l:type
|
||||
\})
|
||||
|
||||
let l:msg = ''
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('bib', {
|
||||
\ 'name': 'bibclean',
|
||||
\ 'executable': {b -> ale#Var(b, 'bib_bibclean_executable')},
|
||||
\ 'command': function('ale_linters#bib#bibclean#GetCommand'),
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale_linters#bib#bibclean#Handle',
|
||||
\})
|
||||
@@ -7,8 +7,8 @@ call ale#Set('c_ccls_init_options', {})
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'ccls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('c_ccls_executable'),
|
||||
\ 'executable': {b -> ale#Var(b, 'c_ccls_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': 'ale#handlers#ccls#GetProjectRoot',
|
||||
\ 'initialization_options_callback':ale#VarFunc('c_ccls_init_options'),
|
||||
\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'),
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'c_ccls_init_options')},
|
||||
\})
|
||||
|
||||
@@ -18,10 +18,7 @@ endfunction
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'clang',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('c_clang_executable'),
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
|
||||
\ {'callback': 'ale_linters#c#clang#GetCommand'}
|
||||
\ ],
|
||||
\ 'executable': {b -> ale#Var(b, 'c_clang_executable')},
|
||||
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#clang#GetCommand'))},
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
|
||||
@@ -17,7 +17,7 @@ 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',
|
||||
\ 'executable': {b -> ale#Var(b, 'c_clangd_executable')},
|
||||
\ 'command': function('ale_linters#c#clangd#GetCommand'),
|
||||
\ 'project_root': function('ale_linters#c#clangd#GetProjectRoot'),
|
||||
\})
|
||||
|
||||
@@ -35,8 +35,8 @@ endfunction
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'clangtidy',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable_callback': ale#VarFunc('c_clangtidy_executable'),
|
||||
\ 'command_callback': 'ale_linters#c#clangtidy#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'c_clangtidy_executable')},
|
||||
\ 'command': function('ale_linters#c#clangtidy#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
@@ -28,7 +28,7 @@ endfunction
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'cppcheck',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'executable_callback': ale#VarFunc('c_cppcheck_executable'),
|
||||
\ 'command_callback': 'ale_linters#c#cppcheck#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'c_cppcheck_executable')},
|
||||
\ 'command': function('ale_linters#c#cppcheck#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
||||
\})
|
||||
|
||||
@@ -21,8 +21,8 @@ endfunction
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'cquery',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('c_cquery_executable'),
|
||||
\ 'executable': {b -> ale#Var(b, 'c_cquery_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': 'ale_linters#c#cquery#GetProjectRoot',
|
||||
\ 'initialization_options_callback': 'ale_linters#c#cquery#GetInitializationOptions',
|
||||
\ 'project_root': function('ale_linters#c#cquery#GetProjectRoot'),
|
||||
\ 'initialization_options': function('ale_linters#c#cquery#GetInitializationOptions'),
|
||||
\})
|
||||
|
||||
@@ -7,19 +7,19 @@ call ale#Set('c_flawfinder_minlevel', 1)
|
||||
call ale#Set('c_flawfinder_error_severity', 6)
|
||||
|
||||
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')
|
||||
" Set the minimum vulnerability level for flawfinder to bother with
|
||||
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'c_flawfinder_minlevel')
|
||||
|
||||
return '%e -CDQS'
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'c_flawfinder_options'))
|
||||
\ . l:minlevel
|
||||
\ . ' %t'
|
||||
return '%e -CDQS'
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'c_flawfinder_options'))
|
||||
\ . l:minlevel
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'flawfinder',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable_callback': ale#VarFunc('c_flawfinder_executable'),
|
||||
\ 'command_callback': 'ale_linters#c#flawfinder#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'c_flawfinder_executable')},
|
||||
\ 'command': function('ale_linters#c#flawfinder#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
|
||||
\})
|
||||
|
||||
@@ -18,10 +18,7 @@ endfunction
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('c_gcc_executable'),
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
|
||||
\ {'callback': 'ale_linters#c#gcc#GetCommand'}
|
||||
\ ],
|
||||
\ 'executable': {b -> ale#Var(b, 'c_gcc_executable')},
|
||||
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#gcc#GetCommand'))},
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
|
||||
@@ -34,8 +34,8 @@ endfunction
|
||||
|
||||
call ale#linter#Define('chef', {
|
||||
\ 'name': 'foodcritic',
|
||||
\ 'executable_callback': ale#VarFunc('chef_foodcritic_executable'),
|
||||
\ 'command_callback': 'ale_linters#chef#foodcritic#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'chef_foodcritic_executable')},
|
||||
\ 'command': function('ale_linters#chef#foodcritic#GetCommand'),
|
||||
\ 'callback': 'ale_linters#chef#foodcritic#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
@@ -11,7 +11,7 @@ function! ale_linters#clojure#joker#HandleJokerFormat(buffer, lines) abort
|
||||
let l:type = 'E'
|
||||
|
||||
if l:match[4] is? 'Parse warning'
|
||||
let l:type = 'W'
|
||||
let l:type = 'W'
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
|
||||
@@ -18,7 +18,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('cmake', {
|
||||
\ 'name': 'cmakelint',
|
||||
\ 'executable_callback': 'ale_linters#cmake#cmakelint#Executable',
|
||||
\ 'command_callback': 'ale_linters#cmake#cmakelint#Command',
|
||||
\ 'executable': function('ale_linters#cmake#cmakelint#Executable'),
|
||||
\ 'command': function('ale_linters#cmake#cmakelint#Command'),
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -16,8 +16,8 @@ endfunction
|
||||
|
||||
call ale#linter#Define('coffee', {
|
||||
\ 'name': 'coffee',
|
||||
\ 'executable_callback': 'ale_linters#coffee#coffee#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#coffee#coffee#GetCommand',
|
||||
\ 'executable': function('ale_linters#coffee#coffee#GetExecutable'),
|
||||
\ 'command': function('ale_linters#coffee#coffee#GetCommand'),
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\})
|
||||
|
||||
@@ -37,7 +37,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('coffee', {
|
||||
\ 'name': 'coffeelint',
|
||||
\ 'executable_callback': 'ale_linters#coffee#coffeelint#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#coffee#coffeelint#GetCommand',
|
||||
\ 'executable': function('ale_linters#coffee#coffeelint#GetExecutable'),
|
||||
\ 'command': function('ale_linters#coffee#coffeelint#GetCommand'),
|
||||
\ 'callback': 'ale_linters#coffee#coffeelint#Handle',
|
||||
\})
|
||||
|
||||
@@ -7,8 +7,8 @@ call ale#Set('cpp_ccls_init_options', {})
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'ccls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_ccls_executable'),
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_ccls_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': 'ale#handlers#ccls#GetProjectRoot',
|
||||
\ 'initialization_options_callback': ale#VarFunc('cpp_ccls_init_options'),
|
||||
\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'),
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'cpp_ccls_init_options')},
|
||||
\})
|
||||
|
||||
@@ -18,10 +18,7 @@ endfunction
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'clang',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_clang_executable'),
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
|
||||
\ {'callback': 'ale_linters#cpp#clang#GetCommand'},
|
||||
\ ],
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_clang_executable')},
|
||||
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#clang#GetCommand'))},
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
|
||||
@@ -27,8 +27,8 @@ endfunction
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'clangcheck',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_clangcheck_executable'),
|
||||
\ 'command_callback': 'ale_linters#cpp#clangcheck#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_clangcheck_executable')},
|
||||
\ 'command': function('ale_linters#cpp#clangcheck#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
@@ -17,7 +17,7 @@ endfunction
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'clangd',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_clangd_executable'),
|
||||
\ 'command_callback': 'ale_linters#cpp#clangd#GetCommand',
|
||||
\ 'project_root_callback': 'ale_linters#cpp#clangd#GetProjectRoot',
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_clangd_executable')},
|
||||
\ 'command': function('ale_linters#cpp#clangd#GetCommand'),
|
||||
\ 'project_root': function('ale_linters#cpp#clangd#GetProjectRoot'),
|
||||
\})
|
||||
|
||||
@@ -29,8 +29,8 @@ endfunction
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'clangtidy',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_clangtidy_executable'),
|
||||
\ 'command_callback': 'ale_linters#cpp#clangtidy#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_clangtidy_executable')},
|
||||
\ 'command': function('ale_linters#cpp#clangtidy#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
@@ -25,8 +25,8 @@ endfunction
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'clazy',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_clazy_executable'),
|
||||
\ 'command_callback': 'ale_linters#cpp#clazy#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_clazy_executable')},
|
||||
\ 'command': function('ale_linters#cpp#clazy#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
@@ -28,7 +28,7 @@ endfunction
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'cppcheck',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_cppcheck_executable'),
|
||||
\ 'command_callback': 'ale_linters#cpp#cppcheck#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_cppcheck_executable')},
|
||||
\ 'command': function('ale_linters#cpp#cppcheck#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
||||
\})
|
||||
|
||||
@@ -13,8 +13,8 @@ endfunction
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'cpplint',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_cpplint_executable'),
|
||||
\ 'command_callback': 'ale_linters#cpp#cpplint#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_cpplint_executable')},
|
||||
\ 'command': function('ale_linters#cpp#cpplint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#cpplint#HandleCppLintFormat',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
@@ -21,8 +21,8 @@ endfunction
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'cquery',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_cquery_executable'),
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_cquery_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': 'ale_linters#cpp#cquery#GetProjectRoot',
|
||||
\ 'initialization_options_callback': 'ale_linters#cpp#cquery#GetInitializationOptions',
|
||||
\ 'project_root': function('ale_linters#cpp#cquery#GetProjectRoot'),
|
||||
\ 'initialization_options': function('ale_linters#cpp#cquery#GetInitializationOptions'),
|
||||
\})
|
||||
|
||||
@@ -7,19 +7,19 @@ call ale#Set('cpp_flawfinder_minlevel', 1)
|
||||
call ale#Set('c_flawfinder_error_severity', 6)
|
||||
|
||||
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')
|
||||
" Set the minimum vulnerability level for flawfinder to bother with
|
||||
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'cpp_flawfinder_minlevel')
|
||||
|
||||
return '%e -CDQS'
|
||||
\ . ale#Var(a:buffer, 'cpp_flawfinder_options')
|
||||
\ . l:minlevel
|
||||
\ . ' %t'
|
||||
return '%e -CDQS'
|
||||
\ . ale#Var(a:buffer, 'cpp_flawfinder_options')
|
||||
\ . l:minlevel
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'flawfinder',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_flawfinder_executable'),
|
||||
\ 'command_callback': 'ale_linters#cpp#flawfinder#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_flawfinder_executable')},
|
||||
\ 'command': function('ale_linters#cpp#flawfinder#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
|
||||
\})
|
||||
|
||||
@@ -19,10 +19,7 @@ call ale#linter#Define('cpp', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'aliases': ['g++'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('cpp_gcc_executable'),
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
|
||||
\ {'callback': 'ale_linters#cpp#gcc#GetCommand'},
|
||||
\ ],
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_gcc_executable')},
|
||||
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#gcc#GetCommand'))},
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
|
||||
57
ale_linters/crystal/ameba.vim
Normal file
57
ale_linters/crystal/ameba.vim
Normal file
@@ -0,0 +1,57 @@
|
||||
" Author: Harrison Bachrach - https://github.com/HarrisonB
|
||||
" Description: Ameba, a linter for crystal files
|
||||
|
||||
call ale#Set('crystal_ameba_executable', 'bin/ameba')
|
||||
|
||||
function! ale_linters#crystal#ameba#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'crystal_ameba_executable')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . ' --format json '
|
||||
\ . ale#Escape(expand('#' . a:buffer . ':p'))
|
||||
endfunction
|
||||
|
||||
" Handle output from ameba
|
||||
function! ale_linters#crystal#ameba#HandleAmebaOutput(buffer, lines) abort
|
||||
if len(a:lines) == 0
|
||||
return []
|
||||
endif
|
||||
|
||||
let l:errors = ale#util#FuzzyJSONDecode(a:lines[0], {})
|
||||
|
||||
if !has_key(l:errors, 'summary')
|
||||
\|| l:errors['summary']['issues_count'] == 0
|
||||
\|| empty(l:errors['sources'])
|
||||
return []
|
||||
endif
|
||||
|
||||
let l:output = []
|
||||
|
||||
for l:error in l:errors['sources'][0]['issues']
|
||||
let l:start_col = str2nr(l:error['location']['column'])
|
||||
let l:end_col = str2nr(l:error['end_location']['column'])
|
||||
|
||||
if !l:end_col
|
||||
let l:end_col = l:start_col + 1
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': str2nr(l:error['location']['line']),
|
||||
\ 'col': l:start_col,
|
||||
\ 'end_col': l:end_col,
|
||||
\ 'code': l:error['rule_name'],
|
||||
\ 'text': l:error['message'],
|
||||
\ 'type': 'W',
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('crystal', {
|
||||
\ 'name': 'ameba',
|
||||
\ 'executable': {b -> ale#Var(b, 'crystal_ameba_executable')},
|
||||
\ 'command': function('ale_linters#crystal#ameba#GetCommand'),
|
||||
\ 'callback': 'ale_linters#crystal#ameba#HandleAmebaOutput',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
@@ -26,6 +26,6 @@ call ale#linter#Define('crystal', {
|
||||
\ 'executable': 'crystal',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'lint_file': 1,
|
||||
\ 'command_callback': 'ale_linters#crystal#crystal#GetCommand',
|
||||
\ 'command': function('ale_linters#crystal#crystal#GetCommand'),
|
||||
\ 'callback': 'ale_linters#crystal#crystal#Handle',
|
||||
\})
|
||||
|
||||
@@ -32,6 +32,6 @@ call ale#linter#Define('cs',{
|
||||
\ 'name': 'mcs',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'mcs',
|
||||
\ 'command_callback': 'ale_linters#cs#mcs#GetCommand',
|
||||
\ 'command': function('ale_linters#cs#mcs#GetCommand'),
|
||||
\ 'callback': 'ale_linters#cs#mcs#Handle',
|
||||
\})
|
||||
|
||||
@@ -30,7 +30,7 @@ function! ale_linters#cs#mcsc#GetCommand(buffer) abort
|
||||
|
||||
" register temporary module target file with ale
|
||||
" register temporary module target file with ALE.
|
||||
let l:out = ale#engine#CreateFile(a:buffer)
|
||||
let l:out = ale#command#CreateFile(a:buffer)
|
||||
|
||||
" The code is compiled as a module and the output is redirected to a
|
||||
" temporary file.
|
||||
@@ -75,7 +75,7 @@ call ale#linter#Define('cs',{
|
||||
\ 'name': 'mcsc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'mcs',
|
||||
\ 'command_callback': 'ale_linters#cs#mcsc#GetCommand',
|
||||
\ 'command': function('ale_linters#cs#mcsc#GetCommand'),
|
||||
\ 'callback': 'ale_linters#cs#mcsc#Handle',
|
||||
\ 'lint_file': 1
|
||||
\})
|
||||
|
||||
@@ -13,6 +13,6 @@ endfunction
|
||||
call ale#linter#Define('css', {
|
||||
\ 'name': 'csslint',
|
||||
\ 'executable': 'csslint',
|
||||
\ 'command_callback': 'ale_linters#css#csslint#GetCommand',
|
||||
\ 'command': function('ale_linters#css#csslint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#css#HandleCSSLintFormat',
|
||||
\})
|
||||
|
||||
@@ -11,9 +11,9 @@ endfunction
|
||||
|
||||
call ale#linter#Define('css', {
|
||||
\ 'name': 'stylelint',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('css_stylelint', [
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'css_stylelint', [
|
||||
\ 'node_modules/.bin/stylelint',
|
||||
\ ]),
|
||||
\ 'command_callback': 'ale_linters#css#stylelint#GetCommand',
|
||||
\ ])},
|
||||
\ 'command': function('ale_linters#css#stylelint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
|
||||
\})
|
||||
|
||||
@@ -41,6 +41,6 @@ endfunction
|
||||
call ale#linter#Define('cucumber', {
|
||||
\ 'name': 'cucumber',
|
||||
\ 'executable': 'cucumber',
|
||||
\ 'command_callback': 'ale_linters#cucumber#cucumber#GetCommand',
|
||||
\ 'command': function('ale_linters#cucumber#cucumber#GetCommand'),
|
||||
\ 'callback': 'ale_linters#cucumber#cucumber#Handle'
|
||||
\})
|
||||
|
||||
@@ -7,7 +7,7 @@ call ale#Set('cuda_nvcc_options', '-std=c++11')
|
||||
function! ale_linters#cuda#nvcc#GetCommand(buffer) abort
|
||||
" Unused: use ale#util#nul_file
|
||||
" let l:output_file = ale#util#Tempname() . '.ii'
|
||||
" call ale#engine#ManageFile(a:buffer, l:output_file)
|
||||
" call ale#command#ManageFile(a:buffer, l:output_file)
|
||||
return '%e -cuda'
|
||||
\ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'cuda_nvcc_options'))
|
||||
@@ -42,8 +42,8 @@ endfunction
|
||||
call ale#linter#Define('cuda', {
|
||||
\ 'name': 'nvcc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('cuda_nvcc_executable'),
|
||||
\ 'command_callback': 'ale_linters#cuda#nvcc#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'cuda_nvcc_executable')},
|
||||
\ 'command': function('ale_linters#cuda#nvcc#GetCommand'),
|
||||
\ 'callback': 'ale_linters#cuda#nvcc#HandleNVCCFormat',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
26
ale_linters/cypher/cypher_lint.vim
Normal file
26
ale_linters/cypher/cypher_lint.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
" Author: Francisco Lopes <francisco@oblita.com>
|
||||
" Description: Linting for Neo4j's Cypher
|
||||
|
||||
function! ale_linters#cypher#cypher_lint#Handle(buffer, lines) abort
|
||||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+): (.*)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'text': l:match[4],
|
||||
\ 'type': 'E',
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cypher', {
|
||||
\ 'name': 'cypher_lint',
|
||||
\ 'executable': 'cypher-lint',
|
||||
\ 'command': 'cypher-lint',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale_linters#cypher#cypher_lint#Handle',
|
||||
\})
|
||||
@@ -16,7 +16,7 @@ endfunction
|
||||
call ale#linter#Define('d', {
|
||||
\ 'name': 'dls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': 'ale_linters#d#dls#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#d#dls#GetExecutable',
|
||||
\ 'project_root_callback': 'ale_linters#d#dls#FindProjectRoot',
|
||||
\ 'executable': function('ale_linters#d#dls#GetExecutable'),
|
||||
\ 'command': function('ale_linters#d#dls#GetExecutable'),
|
||||
\ 'project_root': function('ale_linters#d#dls#FindProjectRoot'),
|
||||
\})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: "dmd for D files"
|
||||
|
||||
function! ale_linters#d#dmd#DUBCommand(buffer) abort
|
||||
function! ale_linters#d#dmd#GetDUBCommand(buffer) abort
|
||||
" If we can't run dub, then skip this command.
|
||||
if !executable('dub')
|
||||
" Returning an empty string skips to the DMD command.
|
||||
@@ -21,7 +21,18 @@ function! ale_linters#d#dmd#DUBCommand(buffer) abort
|
||||
\ . ' && dub describe --import-paths'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#d#dmd#DMDCommand(buffer, dub_output) abort
|
||||
function! ale_linters#d#dmd#RunDUBCommand(buffer) abort
|
||||
let l:command = ale_linters#d#dmd#GetDUBCommand(a:buffer)
|
||||
|
||||
if empty(l:command)
|
||||
" If we can't run DUB, just run DMD.
|
||||
return ale_linters#d#dmd#DMDCommand(a:buffer, [], {})
|
||||
endif
|
||||
|
||||
return ale#command#Run(a:buffer, l:command, function('ale_linters#d#dmd#DMDCommand'))
|
||||
endfunction
|
||||
|
||||
function! ale_linters#d#dmd#DMDCommand(buffer, dub_output, meta) abort
|
||||
let l:import_list = []
|
||||
|
||||
" Build a list of import paths generated from DUB, if available.
|
||||
@@ -57,9 +68,7 @@ endfunction
|
||||
call ale#linter#Define('d', {
|
||||
\ 'name': 'dmd',
|
||||
\ 'executable': 'dmd',
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale_linters#d#dmd#DUBCommand', 'output_stream': 'stdout'},
|
||||
\ {'callback': 'ale_linters#d#dmd#DMDCommand', 'output_stream': 'stderr'},
|
||||
\ ],
|
||||
\ 'command': function('ale_linters#d#dmd#RunDUBCommand'),
|
||||
\ 'callback': 'ale_linters#d#dmd#Handle',
|
||||
\ 'output_stream': 'stderr',
|
||||
\})
|
||||
|
||||
@@ -29,8 +29,8 @@ endfunction
|
||||
|
||||
call ale#linter#Define('dart', {
|
||||
\ 'name': 'dartanalyzer',
|
||||
\ 'executable_callback': ale#VarFunc('dart_dartanalyzer_executable'),
|
||||
\ 'command_callback': 'ale_linters#dart#dartanalyzer#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'dart_dartanalyzer_executable')},
|
||||
\ 'command': function('ale_linters#dart#dartanalyzer#GetCommand'),
|
||||
\ 'callback': 'ale_linters#dart#dartanalyzer#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
@@ -14,7 +14,7 @@ endfunction
|
||||
call ale#linter#Define('dart', {
|
||||
\ 'name': 'language_server',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('dart_language_server_executable'),
|
||||
\ 'executable': {b -> ale#Var(b, 'dart_language_server_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': 'ale_linters#dart#language_server#GetProjectRoot',
|
||||
\ 'project_root': function('ale_linters#dart#language_server#GetProjectRoot'),
|
||||
\})
|
||||
|
||||
@@ -55,7 +55,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('dockerfile', {
|
||||
\ 'name': 'dockerfile_lint',
|
||||
\ 'executable_callback': ale#VarFunc('dockerfile_dockerfile_lint_executable'),
|
||||
\ 'command_callback': 'ale_linters#dockerfile#dockerfile_lint#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'dockerfile_dockerfile_lint_executable')},
|
||||
\ 'command': function('ale_linters#dockerfile#dockerfile_lint#GetCommand'),
|
||||
\ 'callback': 'ale_linters#dockerfile#dockerfile_lint#Handle',
|
||||
\})
|
||||
|
||||
@@ -93,7 +93,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('dockerfile', {
|
||||
\ 'name': 'hadolint',
|
||||
\ 'executable_callback': 'ale_linters#dockerfile#hadolint#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#dockerfile#hadolint#GetCommand',
|
||||
\ 'executable': function('ale_linters#dockerfile#hadolint#GetExecutable'),
|
||||
\ 'command': function('ale_linters#dockerfile#hadolint#GetCommand'),
|
||||
\ 'callback': 'ale_linters#dockerfile#hadolint#Handle',
|
||||
\})
|
||||
|
||||
@@ -37,16 +37,27 @@ function! ale_linters#elixir#credo#Handle(buffer, lines) abort
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elixir#credo#GetMode() abort
|
||||
if get(g:, 'ale_elixir_credo_strict', 0)
|
||||
return '--strict'
|
||||
else
|
||||
return 'suggest'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elixir#credo#GetCommand(buffer) abort
|
||||
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
|
||||
let l:mode = ale_linters#elixir#credo#GetMode()
|
||||
|
||||
return ale#path#CdString(l:project_root)
|
||||
\ . ' mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s'
|
||||
\ . 'mix help credo && '
|
||||
\ . 'mix credo ' . ale_linters#elixir#credo#GetMode()
|
||||
\ . ' --format=flycheck --read-from-stdin %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('elixir', {
|
||||
\ 'name': 'credo',
|
||||
\ 'executable': 'mix',
|
||||
\ 'command_callback': 'ale_linters#elixir#credo#GetCommand',
|
||||
\ 'command': function('ale_linters#elixir#credo#GetCommand'),
|
||||
\ 'callback': 'ale_linters#elixir#credo#Handle',
|
||||
\})
|
||||
|
||||
@@ -35,7 +35,7 @@ endfunction
|
||||
call ale#linter#Define('elixir', {
|
||||
\ 'name': 'dialyxir',
|
||||
\ 'executable': 'mix',
|
||||
\ 'command_callback': 'ale_linters#elixir#dialyxir#GetCommand',
|
||||
\ 'command': function('ale_linters#elixir#dialyxir#GetCommand'),
|
||||
\ 'callback': 'ale_linters#elixir#dialyxir#Handle',
|
||||
\})
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ endfunction
|
||||
call ale#linter#Define('elixir', {
|
||||
\ 'name': 'dogma',
|
||||
\ 'executable': 'mix',
|
||||
\ 'command_callback': 'ale_linters#elixir#dogma#GetCommand',
|
||||
\ 'command': function('ale_linters#elixir#dogma#GetCommand'),
|
||||
\ 'lint_file': 1,
|
||||
\ 'callback': 'ale_linters#elixir#dogma#Handle',
|
||||
\})
|
||||
|
||||
@@ -6,7 +6,7 @@ call ale#Set('elixir_elixir_ls_config', {})
|
||||
|
||||
function! ale_linters#elixir#elixir_ls#GetExecutable(buffer) abort
|
||||
let l:dir = ale#path#Simplify(ale#Var(a:buffer, 'elixir_elixir_ls_release'))
|
||||
let l:cmd = ale#Has('win32') ? '\language_server.bat' : '/language_server.sh'
|
||||
let l:cmd = has('win32') ? '\language_server.bat' : '/language_server.sh'
|
||||
|
||||
return l:dir . l:cmd
|
||||
endfunction
|
||||
@@ -14,8 +14,8 @@ endfunction
|
||||
call ale#linter#Define('elixir', {
|
||||
\ 'name': 'elixir-ls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': 'ale_linters#elixir#elixir_ls#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#elixir#elixir_ls#GetExecutable',
|
||||
\ 'project_root_callback': 'ale#handlers#elixir#FindMixUmbrellaRoot',
|
||||
\ 'lsp_config_callback': ale#VarFunc('elixir_elixir_ls_config'),
|
||||
\ 'executable': function('ale_linters#elixir#elixir_ls#GetExecutable'),
|
||||
\ 'command': function('ale_linters#elixir#elixir_ls#GetExecutable'),
|
||||
\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
|
||||
\ 'lsp_config': {b -> ale#Var(b, 'elixir_elixir_ls_config')},
|
||||
\})
|
||||
|
||||
@@ -32,7 +32,7 @@ endfunction
|
||||
function! ale_linters#elixir#mix#GetCommand(buffer) abort
|
||||
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
|
||||
|
||||
let l:temp_dir = ale#engine#CreateDirectory(a:buffer)
|
||||
let l:temp_dir = ale#command#CreateDirectory(a:buffer)
|
||||
|
||||
let l:mix_build_path = has('win32')
|
||||
\ ? 'set MIX_BUILD_PATH=' . ale#Escape(l:temp_dir) . ' &&'
|
||||
@@ -46,7 +46,7 @@ endfunction
|
||||
call ale#linter#Define('elixir', {
|
||||
\ 'name': 'mix',
|
||||
\ 'executable': 'mix',
|
||||
\ 'command_callback': 'ale_linters#elixir#mix#GetCommand',
|
||||
\ 'command': function('ale_linters#elixir#mix#GetCommand'),
|
||||
\ 'callback': 'ale_linters#elixir#mix#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
22
ale_linters/elm/elm_lsp.vim
Normal file
22
ale_linters/elm/elm_lsp.vim
Normal file
@@ -0,0 +1,22 @@
|
||||
" Author: antew - https://github.com/antew
|
||||
" Description: LSP integration for elm, currently supports diagnostics (linting)
|
||||
|
||||
call ale#Set('elm_lsp_executable', 'elm-lsp')
|
||||
call ale#Set('elm_lsp_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! elm_lsp#GetRootDir(buffer) abort
|
||||
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm.json')
|
||||
|
||||
return !empty(l:elm_json) ? fnamemodify(l:elm_json, ':p:h') : ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('elm', {
|
||||
\ 'name': 'elm_lsp',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'elm_lsp', [
|
||||
\ 'node_modules/.bin/elm-lsp',
|
||||
\ ])},
|
||||
\ 'command': '%e --stdio',
|
||||
\ 'project_root': function('elm_lsp#GetRootDir'),
|
||||
\ 'language': 'elm'
|
||||
\})
|
||||
@@ -137,9 +137,7 @@ function! ale_linters#elm#make#ParseMessageItem(item) abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Return the command to execute the linter in the projects directory.
|
||||
" If it doesn't, then this will fail when imports are needed.
|
||||
function! ale_linters#elm#make#GetCommand(buffer) abort
|
||||
function! ale_linters#elm#make#GetPackageFile(buffer) abort
|
||||
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm.json')
|
||||
|
||||
if empty(l:elm_json)
|
||||
@@ -147,26 +145,96 @@ function! ale_linters#elm#make#GetCommand(buffer) abort
|
||||
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm-package.json')
|
||||
endif
|
||||
|
||||
return l:elm_json
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elm#make#IsVersionGte19(buffer) abort
|
||||
let l:elm_json = ale_linters#elm#make#GetPackageFile(a:buffer)
|
||||
|
||||
if l:elm_json =~# '-package'
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elm#make#GetRootDir(buffer) abort
|
||||
let l:elm_json = ale_linters#elm#make#GetPackageFile(a:buffer)
|
||||
|
||||
if empty(l:elm_json)
|
||||
return ''
|
||||
else
|
||||
return fnamemodify(l:elm_json, ':p:h')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elm#make#IsTest(buffer) abort
|
||||
let l:root_dir = ale_linters#elm#make#GetRootDir(a:buffer)
|
||||
|
||||
if empty(l:root_dir)
|
||||
return 0
|
||||
endif
|
||||
|
||||
let l:tests_dir = join([l:root_dir, 'tests', ''], has('win32') ? '\' : '/')
|
||||
|
||||
let l:buffer_path = fnamemodify(bufname(a:buffer), ':p')
|
||||
|
||||
if stridx(l:buffer_path, l:tests_dir) == 0
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Return the command to execute the linter in the projects directory.
|
||||
" If it doesn't, then this will fail when imports are needed.
|
||||
function! ale_linters#elm#make#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#elm#make#GetExecutable(a:buffer)
|
||||
let l:root_dir = ale_linters#elm#make#GetRootDir(a:buffer)
|
||||
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
|
||||
let l:is_using_elm_test = l:executable =~# 'elm-test$'
|
||||
|
||||
if empty(l:root_dir)
|
||||
let l:dir_set_cmd = ''
|
||||
else
|
||||
let l:root_dir = fnamemodify(l:elm_json, ':p:h')
|
||||
let l:dir_set_cmd = 'cd ' . ale#Escape(l:root_dir) . ' && '
|
||||
endif
|
||||
|
||||
" elm-test needs to know the path of elm-make if elm isn't installed globally.
|
||||
" https://github.com/rtfeldman/node-test-runner/blob/57728f10668f2d2ab3179e7e3208bcfa9a1f19aa/README.md#--compiler
|
||||
if l:is_v19 && l:is_using_elm_test
|
||||
let l:elm_make_executable = ale#node#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
|
||||
let l:elm_test_compiler_flag = ' --compiler ' . l:elm_make_executable . ' '
|
||||
else
|
||||
let l:elm_test_compiler_flag = ' '
|
||||
endif
|
||||
|
||||
" The elm compiler, at the time of this writing, uses '/dev/null' as
|
||||
" 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
|
||||
return l:dir_set_cmd . '%e make --report=json --output=/dev/null %t'
|
||||
return l:dir_set_cmd . '%e make --report=json --output=/dev/null' . l:elm_test_compiler_flag . '%t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elm#make#GetExecutable(buffer) abort
|
||||
let l:is_test = ale_linters#elm#make#IsTest(a:buffer)
|
||||
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
|
||||
|
||||
if l:is_test && l:is_v19
|
||||
return ale#node#FindExecutable(
|
||||
\ a:buffer,
|
||||
\ 'elm_make',
|
||||
\ ['node_modules/.bin/elm-test', 'node_modules/.bin/elm']
|
||||
\)
|
||||
else
|
||||
return ale#node#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('elm', {
|
||||
\ 'name': 'make',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('elm_make', [
|
||||
\ 'node_modules/.bin/elm',
|
||||
\ ]),
|
||||
\ 'executable': function('ale_linters#elm#make#GetExecutable'),
|
||||
\ 'output_stream': 'both',
|
||||
\ 'command_callback': 'ale_linters#elm#make#GetCommand',
|
||||
\ 'command': function('ale_linters#elm#make#GetCommand'),
|
||||
\ 'callback': 'ale_linters#elm#make#Handle'
|
||||
\})
|
||||
|
||||
@@ -4,7 +4,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 = ale#util#Tempname()
|
||||
call ale#engine#ManageFile(a:buffer, l:output_file)
|
||||
call ale#command#ManageFile(a:buffer, l:output_file)
|
||||
|
||||
return 'erlc -o ' . ale#Escape(l:output_file)
|
||||
\ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
|
||||
@@ -91,6 +91,6 @@ endfunction
|
||||
call ale#linter#Define('erlang', {
|
||||
\ 'name': 'erlc',
|
||||
\ 'executable': 'erlc',
|
||||
\ 'command_callback': 'ale_linters#erlang#erlc#GetCommand',
|
||||
\ 'command': function('ale_linters#erlang#erlc#GetCommand'),
|
||||
\ 'callback': 'ale_linters#erlang#erlc#Handle',
|
||||
\})
|
||||
|
||||
@@ -3,7 +3,17 @@
|
||||
|
||||
call ale#Set('erlang_syntaxerl_executable', 'syntaxerl')
|
||||
|
||||
function! ale_linters#erlang#syntaxerl#GetCommand(buffer, output) abort
|
||||
function! ale_linters#erlang#syntaxerl#RunHelpCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'erlang_syntaxerl_executable')
|
||||
|
||||
return ale#command#Run(
|
||||
\ a:buffer,
|
||||
\ ale#Escape(l:executable) . ' -h',
|
||||
\ function('ale_linters#erlang#syntaxerl#GetCommand'),
|
||||
\)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#erlang#syntaxerl#GetCommand(buffer, output, meta) abort
|
||||
let l:use_b_option = match(a:output, '\C\V-b, --base\>') > -1
|
||||
|
||||
return '%e' . (l:use_b_option ? ' -b %s %t' : ' %t')
|
||||
@@ -26,10 +36,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('erlang', {
|
||||
\ 'name': 'syntaxerl',
|
||||
\ 'executable_callback': ale#VarFunc('erlang_syntaxerl_executable'),
|
||||
\ 'command_chain': [
|
||||
\ {'callback': {-> '%e -h'}},
|
||||
\ {'callback': 'ale_linters#erlang#syntaxerl#GetCommand'},
|
||||
\ ],
|
||||
\ 'executable': {b -> ale#Var(b, 'erlang_syntaxerl_executable')},
|
||||
\ 'command': {b -> ale_linters#erlang#syntaxerl#RunHelpCommand(b)},
|
||||
\ 'callback': 'ale_linters#erlang#syntaxerl#Handle',
|
||||
\})
|
||||
|
||||
@@ -19,7 +19,7 @@ call ale#linter#Define('eruby', {
|
||||
\ 'aliases': ['erubylint'],
|
||||
\ 'executable': 'erb',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'command_callback': 'ale_linters#eruby#erb#GetCommand',
|
||||
\ 'command': function('ale_linters#eruby#erb#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
||||
\})
|
||||
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
" Author: Eddie Lebow https://github.com/elebow
|
||||
" Description: eruby checker using `erubi`
|
||||
|
||||
function! ale_linters#eruby#erubi#CheckErubi(buffer) abort
|
||||
return 'ruby -r erubi/capture_end -e ' . ale#Escape('""')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#eruby#erubi#GetCommand(buffer, check_erubi_output) abort
|
||||
function! ale_linters#eruby#erubi#GetCommand(buffer, output, meta) abort
|
||||
let l:rails_root = ale#ruby#FindRailsRoot(a:buffer)
|
||||
|
||||
if (!empty(a:check_erubi_output))
|
||||
if !empty(a:output)
|
||||
" The empty command in CheckErubi returns nothing if erubi runs and
|
||||
" emits an error if erubi is not present
|
||||
return ''
|
||||
@@ -27,9 +23,10 @@ endfunction
|
||||
call ale#linter#Define('eruby', {
|
||||
\ 'name': 'erubi',
|
||||
\ 'executable': 'ruby',
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale_linters#eruby#erubi#CheckErubi'},
|
||||
\ {'callback': 'ale_linters#eruby#erubi#GetCommand', 'output_stream': 'stderr'},
|
||||
\ ],
|
||||
\ 'command': {buffer -> ale#command#Run(
|
||||
\ buffer,
|
||||
\ 'ruby -r erubi/capture_end -e ' . ale#Escape('""'),
|
||||
\ function('ale_linters#eruby#erubi#GetCommand'),
|
||||
\ )},
|
||||
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
||||
\})
|
||||
|
||||
@@ -18,6 +18,6 @@ call ale#linter#Define('eruby', {
|
||||
\ 'name': 'erubis',
|
||||
\ 'executable': 'erubis',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'command_callback': 'ale_linters#eruby#erubis#GetCommand',
|
||||
\ 'command': function('ale_linters#eruby#erubis#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
||||
\})
|
||||
|
||||
@@ -56,7 +56,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('eruby', {
|
||||
\ 'name': 'ruumba',
|
||||
\ 'executable_callback': ale#VarFunc('eruby_ruumba_executable'),
|
||||
\ 'command_callback': 'ale_linters#eruby#ruumba#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'eruby_ruumba_executable')},
|
||||
\ 'command': function('ale_linters#eruby#ruumba#GetCommand'),
|
||||
\ 'callback': 'ale_linters#eruby#ruumba#Handle',
|
||||
\})
|
||||
|
||||
@@ -66,7 +66,7 @@ endfunction
|
||||
call ale#linter#Define('fortran', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('fortran_gcc_executable'),
|
||||
\ 'command_callback': 'ale_linters#fortran#gcc#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'fortran_gcc_executable')},
|
||||
\ 'command': function('ale_linters#fortran#gcc#GetCommand'),
|
||||
\ 'callback': 'ale_linters#fortran#gcc#Handle',
|
||||
\})
|
||||
|
||||
@@ -13,7 +13,7 @@ endfunction
|
||||
call ale#linter#Define('fortran', {
|
||||
\ 'name': 'language_server',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('fortran_language_server_executable'),
|
||||
\ 'executable': {b -> ale#Var(b, 'fortran_language_server_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': 'ale_linters#fortran#language_server#GetProjectRoot',
|
||||
\ 'project_root': function('ale_linters#fortran#language_server#GetProjectRoot'),
|
||||
\})
|
||||
|
||||
@@ -27,7 +27,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('fuse', {
|
||||
\ 'name': 'fusionlint',
|
||||
\ 'executable_callback': ale#VarFunc('fuse_fusionlint_executable'),
|
||||
\ 'command_callback': 'ale_linters#fuse#fusionlint#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'fuse_fusionlint_executable')},
|
||||
\ 'command': function('ale_linters#fuse#fusionlint#GetCommand'),
|
||||
\ 'callback': 'ale_linters#fuse#fusionlint#Handle',
|
||||
\})
|
||||
|
||||
@@ -45,7 +45,7 @@ endfunction
|
||||
call ale#linter#Define('gitcommit', {
|
||||
\ 'name': 'gitlint',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#gitcommit#gitlint#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#gitcommit#gitlint#GetCommand',
|
||||
\ 'executable': function('ale_linters#gitcommit#gitlint#GetExecutable'),
|
||||
\ 'command': function('ale_linters#gitcommit#gitlint#GetCommand'),
|
||||
\ 'callback': 'ale_linters#gitcommit#gitlint#Handle',
|
||||
\})
|
||||
|
||||
@@ -34,7 +34,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('glsl', {
|
||||
\ 'name': 'glslang',
|
||||
\ 'executable_callback': ale#VarFunc('glsl_glslang_executable'),
|
||||
\ 'command_callback': 'ale_linters#glsl#glslang#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'glsl_glslang_executable')},
|
||||
\ 'command': function('ale_linters#glsl#glslang#GetCommand'),
|
||||
\ 'callback': 'ale_linters#glsl#glslang#Handle',
|
||||
\})
|
||||
|
||||
@@ -24,7 +24,7 @@ endfunction
|
||||
call ale#linter#Define('glsl', {
|
||||
\ 'name': 'glslls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('glsl_glslls_executable'),
|
||||
\ 'command_callback': 'ale_linters#glsl#glslls#GetCommand',
|
||||
\ 'project_root_callback': 'ale_linters#glsl#glslls#GetProjectRoot',
|
||||
\ 'executable': {b -> ale#Var(b, 'glsl_glslls_executable')},
|
||||
\ 'command': function('ale_linters#glsl#glslls#GetCommand'),
|
||||
\ 'project_root': function('ale_linters#glsl#glslls#GetProjectRoot'),
|
||||
\})
|
||||
|
||||
29
ale_linters/go/bingo.vim
Normal file
29
ale_linters/go/bingo.vim
Normal file
@@ -0,0 +1,29 @@
|
||||
" Author: Jerko Steiner <https://github.com/jeremija>
|
||||
" Description: https://github.com/saibing/bingo
|
||||
|
||||
call ale#Set('go_bingo_executable', 'bingo')
|
||||
call ale#Set('go_bingo_options', '--mode stdio')
|
||||
|
||||
function! ale_linters#go#bingo#GetCommand(buffer) abort
|
||||
return '%e' . ale#Pad(ale#Var(a:buffer, 'go_bingo_options'))
|
||||
endfunction
|
||||
|
||||
function! ale_linters#go#bingo#FindProjectRoot(buffer) abort
|
||||
let l:project_root = ale#path#FindNearestFile(a:buffer, 'go.mod')
|
||||
let l:mods = ':h'
|
||||
|
||||
if empty(l:project_root)
|
||||
let l:project_root = ale#path#FindNearestDirectory(a:buffer, '.git')
|
||||
let l:mods = ':h:h'
|
||||
endif
|
||||
|
||||
return !empty(l:project_root) ? fnamemodify(l:project_root, l:mods) : ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'bingo',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'go_bingo_executable')},
|
||||
\ 'command': function('ale_linters#go#bingo#GetCommand'),
|
||||
\ 'project_root': function('ale_linters#go#bingo#FindProjectRoot'),
|
||||
\})
|
||||
@@ -48,8 +48,8 @@ endfunction
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'gobuild',
|
||||
\ 'aliases': ['go build'],
|
||||
\ 'executable_callback': ale#VarFunc('go_go_executable'),
|
||||
\ 'command_callback': 'ale_linters#go#gobuild#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
|
||||
\ 'command': function('ale_linters#go#gobuild#GetCommand'),
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale_linters#go#gobuild#Handler',
|
||||
\ 'lint_file': 1,
|
||||
|
||||
@@ -49,8 +49,8 @@ endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'golangci-lint',
|
||||
\ 'executable_callback': ale#VarFunc('go_golangci_lint_executable'),
|
||||
\ 'command_callback': 'ale_linters#go#golangci_lint#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'go_golangci_lint_executable')},
|
||||
\ 'command': function('ale_linters#go#golangci_lint#GetCommand'),
|
||||
\ 'callback': 'ale_linters#go#golangci_lint#Handler',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
@@ -15,7 +15,7 @@ endfunction
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'golint',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'executable_callback': ale#VarFunc('go_golint_executable'),
|
||||
\ 'command_callback': 'ale_linters#go#golint#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'go_golint_executable')},
|
||||
\ 'command': function('ale_linters#go#golint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -50,8 +50,8 @@ endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'gometalinter',
|
||||
\ 'executable_callback': ale#VarFunc('go_gometalinter_executable'),
|
||||
\ 'command_callback': 'ale_linters#go#gometalinter#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'go_gometalinter_executable')},
|
||||
\ 'command': function('ale_linters#go#gometalinter#GetCommand'),
|
||||
\ 'callback': 'ale_linters#go#gometalinter#Handler',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
@@ -8,7 +8,7 @@ endfunction
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'gosimple',
|
||||
\ 'executable': 'gosimple',
|
||||
\ 'command_callback': 'ale_linters#go#gosimple#GetCommand',
|
||||
\ 'command': function('ale_linters#go#gosimple#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#go#Handler',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'lint_file': 1,
|
||||
|
||||
@@ -6,14 +6,14 @@ function! ale_linters#go#gotype#GetCommand(buffer) abort
|
||||
return ''
|
||||
endif
|
||||
|
||||
return ale#path#BufferCdString(a:buffer) . ' gotype .'
|
||||
return ale#path#BufferCdString(a:buffer) . ' gotype -e .'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'gotype',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'gotype',
|
||||
\ 'command_callback': 'ale_linters#go#gotype#GetCommand',
|
||||
\ 'command': function('ale_linters#go#gotype#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#go#Handler',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
@@ -20,8 +20,8 @@ call ale#linter#Define('go', {
|
||||
\ 'name': 'govet',
|
||||
\ 'aliases': ['go vet'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('go_go_executable'),
|
||||
\ 'command_callback': 'ale_linters#go#govet#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
|
||||
\ 'command': function('ale_linters#go#govet#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#go#Handler',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
@@ -10,8 +10,8 @@ function! ale_linters#go#langserver#GetCommand(buffer) abort
|
||||
let l:options = substitute(l:options, '-gocodecompletion', '', 'g')
|
||||
let l:options = filter(split(l:options, ' '), 'empty(v:val) != 1')
|
||||
|
||||
if(ale#Var(a:buffer, 'completion_enabled') == 1)
|
||||
call add(l:options, '-gocodecompletion')
|
||||
if ale#Var(a:buffer, 'completion_enabled')
|
||||
call add(l:options, '-gocodecompletion')
|
||||
endif
|
||||
|
||||
let l:options = uniq(sort(l:options))
|
||||
@@ -22,7 +22,7 @@ endfunction
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'golangserver',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#VarFunc('go_langserver_executable'),
|
||||
\ 'command_callback': 'ale_linters#go#langserver#GetCommand',
|
||||
\ 'project_root_callback': 'ale#go#FindProjectRoot',
|
||||
\ 'executable': {b -> ale#Var(b, 'go_langserver_executable')},
|
||||
\ 'command': function('ale_linters#go#langserver#GetCommand'),
|
||||
\ 'project_root': function('ale#go#FindProjectRoot'),
|
||||
\})
|
||||
|
||||
@@ -26,7 +26,7 @@ endfunction
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'staticcheck',
|
||||
\ 'executable': 'staticcheck',
|
||||
\ 'command_callback': 'ale_linters#go#staticcheck#GetCommand',
|
||||
\ 'command': function('ale_linters#go#staticcheck#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#go#Handler',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'lint_file': 1,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
call ale#linter#Define('graphql', {
|
||||
\ 'name': 'eslint',
|
||||
\ 'executable_callback': 'ale#handlers#eslint#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#eslint#GetCommand',
|
||||
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#eslint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#eslint#Handle',
|
||||
\})
|
||||
|
||||
@@ -10,6 +10,6 @@ endfunction
|
||||
call ale#linter#Define('graphql', {
|
||||
\ 'name': 'gqlint',
|
||||
\ 'executable': 'gqlint',
|
||||
\ 'command_callback': 'ale_linters#graphql#gqlint#GetCommand',
|
||||
\ 'command': function('ale_linters#graphql#gqlint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -16,7 +16,7 @@ endfunction
|
||||
call ale#linter#Define('hack', {
|
||||
\ 'name': 'hack',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': 'ale_linters#hack#hack#GetExecutable',
|
||||
\ 'executable': function('ale_linters#hack#hack#GetExecutable'),
|
||||
\ 'command': '%e lsp --from vim-ale',
|
||||
\ 'project_root_callback': 'ale_linters#hack#hack#GetProjectRoot',
|
||||
\ 'project_root': function('ale_linters#hack#hack#GetProjectRoot'),
|
||||
\})
|
||||
|
||||
@@ -9,7 +9,7 @@ function! ale_linters#hack#hhast#GetProjectRoot(buffer) abort
|
||||
let l:hhconfig = ale#path#FindNearestFile(a:buffer, '.hhconfig')
|
||||
|
||||
if empty(l:hhconfig)
|
||||
return ''
|
||||
return ''
|
||||
endif
|
||||
|
||||
let l:root = fnamemodify(l:hhconfig, ':h')
|
||||
@@ -33,8 +33,8 @@ endfunction
|
||||
call ale#linter#Define('hack', {
|
||||
\ 'name': 'hhast',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': 'ale_linters#hack#hhast#GetExecutable',
|
||||
\ 'executable': function('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',
|
||||
\ 'project_root': function('ale_linters#hack#hhast#GetProjectRoot'),
|
||||
\ 'initialization_options': function('ale_linters#hack#hhast#GetInitializationOptions'),
|
||||
\})
|
||||
|
||||
@@ -19,7 +19,7 @@ function! ale_linters#haml#hamllint#GetCommand(buffer) abort
|
||||
" See https://github.com/brigade/haml-lint/blob/master/lib/haml_lint/linter/rubocop.rb#L89
|
||||
" HamlLint::Linter::RuboCop#rubocop_flags
|
||||
if !empty(l:rubocop_config_file_path)
|
||||
if ale#Has('win32')
|
||||
if has('win32')
|
||||
let l:prefix = 'set HAML_LINT_RUBOCOP_CONF=' . ale#Escape(l:rubocop_config_file_path) . ' &&'
|
||||
else
|
||||
let l:prefix = 'HAML_LINT_RUBOCOP_CONF=' . ale#Escape(l:rubocop_config_file_path)
|
||||
@@ -51,7 +51,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('haml', {
|
||||
\ 'name': 'hamllint',
|
||||
\ 'executable_callback': 'ale_linters#haml#hamllint#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#haml#hamllint#GetCommand',
|
||||
\ 'executable': function('ale_linters#haml#hamllint#GetExecutable'),
|
||||
\ 'command': function('ale_linters#haml#hamllint#GetCommand'),
|
||||
\ 'callback': 'ale_linters#haml#hamllint#Handle'
|
||||
\})
|
||||
|
||||
@@ -31,9 +31,9 @@ endfunction
|
||||
|
||||
call ale#linter#Define('handlebars', {
|
||||
\ 'name': 'ember-template-lint',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('handlebars_embertemplatelint', [
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'handlebars_embertemplatelint', [
|
||||
\ 'node_modules/.bin/ember-template-lint',
|
||||
\ ]),
|
||||
\ ])},
|
||||
\ 'command': '%e --json %t',
|
||||
\ 'callback': 'ale_linters#handlebars#embertemplatelint#Handle',
|
||||
\})
|
||||
|
||||
@@ -14,6 +14,6 @@ call ale#linter#Define('haskell', {
|
||||
\ 'aliases': ['cabal-ghc'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'cabal',
|
||||
\ 'command_callback': 'ale_linters#haskell#cabal_ghc#GetCommand',
|
||||
\ 'command': function('ale_linters#haskell#cabal_ghc#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
|
||||
@@ -13,6 +13,6 @@ call ale#linter#Define('haskell', {
|
||||
\ 'name': 'ghc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'ghc',
|
||||
\ 'command_callback': 'ale_linters#haskell#ghc#GetCommand',
|
||||
\ 'command': function('ale_linters#haskell#ghc#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
|
||||
@@ -13,7 +13,7 @@ endfunction
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'ghc_mod',
|
||||
\ 'aliases': ['ghc-mod'],
|
||||
\ 'executable_callback': ale#VarFunc('haskell_ghc_mod_executable'),
|
||||
\ 'command_callback': 'ale_linters#haskell#ghc_mod#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'haskell_ghc_mod_executable')},
|
||||
\ 'command': function('ale_linters#haskell#ghc_mod#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
|
||||
@@ -14,7 +14,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'hdevtools',
|
||||
\ 'executable_callback': ale#VarFunc('haskell_hdevtools_executable'),
|
||||
\ 'command_callback': 'ale_linters#haskell#hdevtools#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'haskell_hdevtools_executable')},
|
||||
\ 'command': function('ale_linters#haskell#hdevtools#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
|
||||
@@ -29,13 +29,13 @@ function! ale_linters#haskell#hie#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_hie_executable')
|
||||
|
||||
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'hie')
|
||||
\ . ' --lsp'
|
||||
\ . ' --lsp'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'hie',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'command_callback': 'ale_linters#haskell#hie#GetCommand',
|
||||
\ 'executable_callback': ale#VarFunc('haskell_hie_executable'),
|
||||
\ 'project_root_callback': 'ale_linters#haskell#hie#GetProjectRoot',
|
||||
\ 'command': function('ale_linters#haskell#hie#GetCommand'),
|
||||
\ 'executable': {b -> ale#Var(b, 'haskell_hie_executable')},
|
||||
\ 'project_root': function('ale_linters#haskell#hie#GetProjectRoot'),
|
||||
\})
|
||||
|
||||
@@ -40,7 +40,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'hlint',
|
||||
\ 'executable_callback': ale#VarFunc('haskell_hlint_executable'),
|
||||
\ 'command_callback': 'ale_linters#haskell#hlint#GetCommand' ,
|
||||
\ 'executable': {b -> ale#Var(b, 'haskell_hlint_executable')},
|
||||
\ 'command': function('ale_linters#haskell#hlint#GetCommand') ,
|
||||
\ 'callback': 'ale_linters#haskell#hlint#Handle',
|
||||
\})
|
||||
|
||||
@@ -16,8 +16,8 @@ call ale#linter#Define('haskell', {
|
||||
\ 'name': 'stack_build',
|
||||
\ 'aliases': ['stack-build'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale#handlers#haskell#GetStackExecutable',
|
||||
\ 'command_callback': 'ale_linters#haskell#stack_build#GetCommand',
|
||||
\ 'executable': function('ale#handlers#haskell#GetStackExecutable'),
|
||||
\ 'command': function('ale_linters#haskell#stack_build#GetCommand'),
|
||||
\ 'lint_file': 1,
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: ghc for Haskell files, using Stack
|
||||
|
||||
call ale#Set('haskell_stack_ghc_options', '-fno-code -v0')
|
||||
|
||||
function! ale_linters#haskell#stack_ghc#GetCommand(buffer) abort
|
||||
return ale#handlers#haskell#GetStackExecutable(a:buffer)
|
||||
\ . ' ghc -- '
|
||||
\ . ale#Var(a:buffer, 'haskell_stack_ghc_options')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'stack_ghc',
|
||||
\ 'aliases': ['stack-ghc'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale#handlers#haskell#GetStackExecutable',
|
||||
\ 'command': 'stack ghc -- -fno-code -v0 %t',
|
||||
\ 'executable': function('ale#handlers#haskell#GetStackExecutable'),
|
||||
\ 'command': function('ale_linters#haskell#stack_ghc#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
" Author: Johannes Wienke <languitar@semipol.de>
|
||||
" Description: alex for help files
|
||||
|
||||
call ale#linter#Define('help', {
|
||||
\ 'name': 'alex',
|
||||
\ 'executable': 'alex',
|
||||
\ 'command': 'alex %s -t',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale#handlers#alex#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
call ale#handlers#alex#DefineLinter('help', '--text')
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
" Author: Johannes Wienke <languitar@semipol.de>
|
||||
" Description: alex for HTML files
|
||||
|
||||
call ale#linter#Define('html', {
|
||||
\ 'name': 'alex',
|
||||
\ 'executable': 'alex',
|
||||
\ 'command': 'alex %s -t',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale#handlers#alex#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
call ale#handlers#alex#DefineLinter('html', '--html')
|
||||
|
||||
@@ -24,9 +24,9 @@ endfunction
|
||||
|
||||
call ale#linter#Define('html', {
|
||||
\ 'name': 'htmlhint',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('html_htmlhint', [
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'html_htmlhint', [
|
||||
\ 'node_modules/.bin/htmlhint',
|
||||
\ ]),
|
||||
\ 'command_callback': 'ale_linters#html#htmlhint#GetCommand',
|
||||
\ ])},
|
||||
\ 'command': function('ale_linters#html#htmlhint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||
\})
|
||||
|
||||
@@ -21,7 +21,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('html', {
|
||||
\ 'name': 'stylelint',
|
||||
\ 'executable_callback': 'ale_linters#html#stylelint#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#html#stylelint#GetCommand',
|
||||
\ 'executable': function('ale_linters#html#stylelint#GetExecutable'),
|
||||
\ 'command': function('ale_linters#html#stylelint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
|
||||
\})
|
||||
|
||||
@@ -63,8 +63,8 @@ endfunction
|
||||
|
||||
call ale#linter#Define('html', {
|
||||
\ 'name': 'tidy',
|
||||
\ 'executable_callback': ale#VarFunc('html_tidy_executable'),
|
||||
\ 'executable': {b -> ale#Var(b, 'html_tidy_executable')},
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'command_callback': 'ale_linters#html#tidy#GetCommand',
|
||||
\ 'command': function('ale_linters#html#tidy#GetCommand'),
|
||||
\ 'callback': 'ale_linters#html#tidy#Handle',
|
||||
\ })
|
||||
|
||||
@@ -49,11 +49,11 @@ function! ale_linters#idris#idris#Handle(buffer, lines) abort
|
||||
let l:errors = matchlist(l:match[5], '\v([wW]arning|[eE]rror) - ?(.*)')
|
||||
|
||||
if len(l:errors) > 0
|
||||
let l:ghc_type = l:errors[1]
|
||||
let l:text = l:errors[2]
|
||||
let l:ghc_type = l:errors[1]
|
||||
let l:text = l:errors[2]
|
||||
else
|
||||
let l:ghc_type = ''
|
||||
let l:text = l:match[5][:0] is# ' ' ? l:match[5][1:] : l:match[5]
|
||||
let l:ghc_type = ''
|
||||
let l:text = l:match[5][:0] is# ' ' ? l:match[5][1:] : l:match[5]
|
||||
endif
|
||||
|
||||
if l:ghc_type is? 'Warning'
|
||||
@@ -75,7 +75,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('idris', {
|
||||
\ 'name': 'idris',
|
||||
\ 'executable_callback': ale#VarFunc('idris_idris_executable'),
|
||||
\ 'command_callback': 'ale_linters#idris#idris#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'idris_idris_executable')},
|
||||
\ 'command': function('ale_linters#idris#idris#GetCommand'),
|
||||
\ 'callback': 'ale_linters#idris#idris#Handle',
|
||||
\})
|
||||
|
||||
@@ -38,8 +38,8 @@ endfunction
|
||||
call ale#linter#Define('ispc', {
|
||||
\ 'name': 'ispc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('ispc_ispc_executable'),
|
||||
\ 'command_callback': 'ale_linters#ispc#ispc#GetCommand',
|
||||
\ 'executable': {b -> ale#Var(b, 'ispc_ispc_executable')},
|
||||
\ 'command': function('ale_linters#ispc#ispc#GetCommand'),
|
||||
\ 'callback': 'ale_linters#ispc#ispc#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user