mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-09 05:54:45 +08:00
Compare commits
190 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be5c7a09ce | ||
|
|
b952dda386 | ||
|
|
231398dddc | ||
|
|
c4579e1809 | ||
|
|
5b986ce5d3 | ||
|
|
0b0cbfa80a | ||
|
|
841acf725c | ||
|
|
3878be9977 | ||
|
|
b43ed6baf5 | ||
|
|
e023e7a2fe | ||
|
|
346c91fb6b | ||
|
|
a97afd3380 | ||
|
|
658ec4b10e | ||
|
|
4339af2bb6 | ||
|
|
5292d2f349 | ||
|
|
81d993086e | ||
|
|
5946a128c3 | ||
|
|
8a8879a28f | ||
|
|
07ebfbeef0 | ||
|
|
a790077136 | ||
|
|
090f8a8f38 | ||
|
|
90d4fb139c | ||
|
|
515dcdef29 | ||
|
|
d090dec8b4 | ||
|
|
ef495ba32d | ||
|
|
010ebc2459 | ||
|
|
b2e6d0dff8 | ||
|
|
69d6ff6020 | ||
|
|
40e69794eb | ||
|
|
d8ea83e344 | ||
|
|
8eb41dc94c | ||
|
|
6fd10f80de | ||
|
|
5204f2dbc2 | ||
|
|
618074a053 | ||
|
|
663fe75d0f | ||
|
|
e71c4a8bea | ||
|
|
dded246aba | ||
|
|
221cb0f8cf | ||
|
|
3ddbe48d84 | ||
|
|
d8a638f38a | ||
|
|
844354cfed | ||
|
|
02c8793c53 | ||
|
|
be547a0111 | ||
|
|
620ec32da1 | ||
|
|
3859ac0c9b | ||
|
|
70177480ba | ||
|
|
a809c4fa3a | ||
|
|
65aa88a7d5 | ||
|
|
f21f52343d | ||
|
|
47577564a2 | ||
|
|
25045641fb | ||
|
|
a300014396 | ||
|
|
e376f0ae44 | ||
|
|
3ab414de1a | ||
|
|
7392f808c0 | ||
|
|
753592ca66 | ||
|
|
e0bd490ed9 | ||
|
|
54a08c5f8c | ||
|
|
5091e2de45 | ||
|
|
638ca42082 | ||
|
|
4634b1be93 | ||
|
|
5731616cd2 | ||
|
|
c76f721b59 | ||
|
|
a640d3b022 | ||
|
|
1d1b5155e6 | ||
|
|
c989ef0fc6 | ||
|
|
9fc01bd246 | ||
|
|
8f6044b8b6 | ||
|
|
49b6805b09 | ||
|
|
0be77c60c5 | ||
|
|
cde50f1091 | ||
|
|
cb56cbb714 | ||
|
|
2bd352370f | ||
|
|
3910b025b2 | ||
|
|
70fdeb7c22 | ||
|
|
5a1ebdb633 | ||
|
|
8bc66cff39 | ||
|
|
6ebd8f355c | ||
|
|
a59d1ddbf3 | ||
|
|
71c2e65d64 | ||
|
|
52c933cd72 | ||
|
|
3d2bddf4af | ||
|
|
677263f115 | ||
|
|
7302bedc5e | ||
|
|
91df9ba2c0 | ||
|
|
4e9420d1f5 | ||
|
|
e2271b769c | ||
|
|
7f42aedaec | ||
|
|
661ed6e40b | ||
|
|
a7614d9502 | ||
|
|
8eb99c3cec | ||
|
|
b6a487ccf9 | ||
|
|
cb8a140141 | ||
|
|
e19a81cb09 | ||
|
|
65e6e50bf8 | ||
|
|
9d24cc4047 | ||
|
|
c4ad92e458 | ||
|
|
18a7d32c4c | ||
|
|
c11d2ae375 | ||
|
|
1a52a2b880 | ||
|
|
18f4d5a6da | ||
|
|
f3da8f45c1 | ||
|
|
b3a9a0e3e8 | ||
|
|
8055a03067 | ||
|
|
f238e15f10 | ||
|
|
574cb11594 | ||
|
|
d9bdbd5a58 | ||
|
|
a33b3f189d | ||
|
|
26195efa0b | ||
|
|
1c5253b928 | ||
|
|
89cc8ca314 | ||
|
|
ff28836616 | ||
|
|
73d031d7ea | ||
|
|
555d23c035 | ||
|
|
8198c2b63c | ||
|
|
b8963f21bf | ||
|
|
9474a9d319 | ||
|
|
963e16870b | ||
|
|
02aad45aa6 | ||
|
|
59fd98b8b2 | ||
|
|
fbc846b4ba | ||
|
|
dd77b6eac5 | ||
|
|
e951056e7b | ||
|
|
2be39d3e1c | ||
|
|
2b34cf098a | ||
|
|
9821b2c414 | ||
|
|
6661ff9794 | ||
|
|
a9823cbfd5 | ||
|
|
03f1c1e81b | ||
|
|
c277cdef8c | ||
|
|
ad1bd424fa | ||
|
|
a170cc806a | ||
|
|
22a0cd6e05 | ||
|
|
a21a75c19e | ||
|
|
8595fcdeb9 | ||
|
|
5239ef9c83 | ||
|
|
edfe65a22c | ||
|
|
e53debe000 | ||
|
|
c2f547b6e3 | ||
|
|
984c4f0658 | ||
|
|
1ea5400e8d | ||
|
|
b60a7224ab | ||
|
|
29ffd5134f | ||
|
|
6833e01f23 | ||
|
|
0aa8640d07 | ||
|
|
e235e5a6a5 | ||
|
|
63e8946fc8 | ||
|
|
c7fbcb3c02 | ||
|
|
d482b8e3b7 | ||
|
|
f9b43a566c | ||
|
|
52eff3bd83 | ||
|
|
7c2a5052a8 | ||
|
|
1d86a724f2 | ||
|
|
f36f38c960 | ||
|
|
301d30229b | ||
|
|
05ce86ea33 | ||
|
|
6e423a94cd | ||
|
|
c09f8f5764 | ||
|
|
33278f0fce | ||
|
|
9958a8d32e | ||
|
|
ed9cdca127 | ||
|
|
fca77266bd | ||
|
|
688212130d | ||
|
|
3bde390c58 | ||
|
|
0cdb653c9c | ||
|
|
40dca63891 | ||
|
|
b8f5a4923c | ||
|
|
f4c5d29c64 | ||
|
|
c7536fb4fd | ||
|
|
3152e5c207 | ||
|
|
d08d2dac79 | ||
|
|
8264e265a8 | ||
|
|
ec178b0b3b | ||
|
|
b36882e72e | ||
|
|
87fb72346a | ||
|
|
2a238fda9e | ||
|
|
54900d5216 | ||
|
|
22db934db9 | ||
|
|
4a0735a195 | ||
|
|
0827cb5483 | ||
|
|
8e3c1dbd11 | ||
|
|
b031531e79 | ||
|
|
e4a6da936d | ||
|
|
70cd1d5a57 | ||
|
|
a767578d44 | ||
|
|
6d732b9fb4 | ||
|
|
710c3ee3d2 | ||
|
|
3bb75a6fde | ||
|
|
8ea9044667 | ||
|
|
cddb26558f |
40
.appveyor.yml
Normal file
40
.appveyor.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
# Disabling building for AppVeyor. We are just testing things.
|
||||||
|
build: false
|
||||||
|
clone_depth: 10
|
||||||
|
# Use the directory C:\testplugin so test directories will mostly work.
|
||||||
|
clone_folder: C:\testplugin
|
||||||
|
|
||||||
|
# Cache the vim and vader directories between builds.
|
||||||
|
cache:
|
||||||
|
- C:\vim -> .appveyor.yml
|
||||||
|
- C:\vader -> .appveyor.yml
|
||||||
|
|
||||||
|
init:
|
||||||
|
# Stop git from changing newlines
|
||||||
|
- git config --global core.autocrlf input
|
||||||
|
|
||||||
|
install:
|
||||||
|
# Download and unpack Vim
|
||||||
|
- ps: >-
|
||||||
|
if (!(Test-Path -Path C:\vim)){
|
||||||
|
Add-Type -A System.IO.Compression.FileSystem
|
||||||
|
Invoke-WebRequest ftp://ftp.vim.org/pub/vim/pc/vim80-586w32.zip `
|
||||||
|
-OutFile C:\vim.zip
|
||||||
|
[IO.Compression.ZipFile]::ExtractToDirectory('C:\vim.zip', 'C:\vim')
|
||||||
|
Invoke-WebRequest ftp://ftp.vim.org/pub/vim/pc/vim80-586rt.zip `
|
||||||
|
-OutFile C:\rt.zip
|
||||||
|
[IO.Compression.ZipFile]::ExtractToDirectory('C:\rt.zip', 'C:\vim')
|
||||||
|
}
|
||||||
|
# Clone Vader and check out the commit we want
|
||||||
|
- ps: >-
|
||||||
|
if (!(Test-Path -Path C:\vader)){
|
||||||
|
git clone https://github.com/junegunn/vader.vim C:\vader 2> $null
|
||||||
|
cd C:\vader
|
||||||
|
git checkout -qf c6243dd81c98350df4dec608fa972df98fa2a3af 2> $null
|
||||||
|
}
|
||||||
|
|
||||||
|
test_script:
|
||||||
|
- cd C:\testplugin
|
||||||
|
- 'C:\vim\vim\vim80\vim.exe -u test\vimrc "+Vader!
|
||||||
|
test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*.vader"'
|
||||||
14
.editorconfig
Normal file
14
.editorconfig
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# EditorConfig is awesome: http://EditorConfig.org
|
||||||
|
|
||||||
|
# Top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Match and apply these rules for all file
|
||||||
|
# types you open in your code editor
|
||||||
|
[*]
|
||||||
|
# Unix-style newlines
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
trim_trailing_whitespace = true
|
||||||
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -6,7 +6,7 @@
|
|||||||
/Makefile export-ignore
|
/Makefile export-ignore
|
||||||
/PULL_REQUEST_TEMPLATE.md export-ignore
|
/PULL_REQUEST_TEMPLATE.md export-ignore
|
||||||
/README.md export-ignore
|
/README.md export-ignore
|
||||||
/custom-checks export-ignore
|
|
||||||
/img export-ignore
|
/img export-ignore
|
||||||
/run-tests export-ignore
|
/run-tests export-ignore
|
||||||
|
/run-tests.bat export-ignore
|
||||||
/test export-ignore
|
/test export-ignore
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
/init.vim
|
/init.vim
|
||||||
/doc/tags
|
/doc/tags
|
||||||
.*
|
.*
|
||||||
|
!.editorconfig
|
||||||
*.obj
|
*.obj
|
||||||
tags
|
tags
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ giving some unfair preference to any particular tool or language.
|
|||||||
|
|
||||||
The "online documentation" file used for this project lives in `doc/ale.txt`.
|
The "online documentation" file used for this project lives in `doc/ale.txt`.
|
||||||
This is the file used for generating `:help` text inside Vim itself. There are
|
This is the file used for generating `:help` text inside Vim itself. There are
|
||||||
some guidlines to follow for this file.
|
some guidelines to follow for this file.
|
||||||
|
|
||||||
1. Keep all text within a column size of 79 characters, inclusive.
|
1. Keep all text within a column size of 79 characters, inclusive.
|
||||||
2. Open a section with 79 `=` or `-` characters, for headings and subheadings.
|
2. Open a section with 79 `=` or `-` characters, for headings and subheadings.
|
||||||
@@ -160,7 +160,7 @@ to look up the default value easily by typing `:echo g:ale_...`.
|
|||||||
Should the principal author of the ALE project and all collaborators with the
|
Should the principal author of the ALE project and all collaborators with the
|
||||||
required access needed to properly administrate the project on GitHub or any
|
required access needed to properly administrate the project on GitHub or any
|
||||||
other website either perish or disappear, whether by tragic traffic accident
|
other website either perish or disappear, whether by tragic traffic accident
|
||||||
or government adduction, etc., action should be taken to ensure that the
|
or government abduction, etc., action should be taken to ensure that the
|
||||||
project continues. If no one is left to administer the project where it is
|
project continues. If no one is left to administer the project where it is
|
||||||
hosted, please fork the project and nominate someone capable to administer it.
|
hosted, please fork the project and nominate someone capable to administer it.
|
||||||
Preferably, in such an event, a single fork of the project will replace the
|
Preferably, in such an event, a single fork of the project will replace the
|
||||||
|
|||||||
166
README.md
166
README.md
@@ -1,4 +1,5 @@
|
|||||||
# Asynchronous Lint Engine [](https://travis-ci.org/w0rp/ale)
|
# Asynchronous Lint Engine [](https://travis-ci.org/w0rp/ale) [](https://ci.appveyor.com/project/w0rp/ale)
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -36,13 +37,14 @@ servers with similar enough protocols, like `tsserver`.
|
|||||||
2. [How can I keep the sign gutter open?](#faq-keep-signs)
|
2. [How can I keep the sign gutter open?](#faq-keep-signs)
|
||||||
3. [How can I change the signs ALE uses?](#faq-change-signs)
|
3. [How can I change the signs ALE uses?](#faq-change-signs)
|
||||||
4. [How can I show errors or warnings in my statusline?](#faq-statusline)
|
4. [How can I show errors or warnings in my statusline?](#faq-statusline)
|
||||||
5. [How can I change the format for echo messages?](#faq-echo-format)
|
5. [How can I show errors or warnings in my lightline?](#faq-lightline)
|
||||||
6. [How can I execute some code when ALE stops linting?](#faq-autocmd)
|
6. [How can I change the format for echo messages?](#faq-echo-format)
|
||||||
7. [How can I navigate between errors quickly?](#faq-navigation)
|
7. [How can I execute some code when ALE stops linting?](#faq-autocmd)
|
||||||
8. [How can I run linters only when I save files?](#faq-lint-on-save)
|
8. [How can I navigate between errors quickly?](#faq-navigation)
|
||||||
9. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
|
9. [How can I run linters only when I save files?](#faq-lint-on-save)
|
||||||
10. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
|
10. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
|
||||||
11. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
11. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
|
||||||
|
12. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
||||||
|
|
||||||
<a name="supported-languages"></a>
|
<a name="supported-languages"></a>
|
||||||
|
|
||||||
@@ -55,88 +57,99 @@ tools will be run in combination, so they can be complementary.
|
|||||||
Keep the table rows sorted alphabetically by the language name,
|
Keep the table rows sorted alphabetically by the language name,
|
||||||
and the tools in the tools column sorted alphabetically by the tool
|
and the tools in the tools column sorted alphabetically by the tool
|
||||||
name. That seems to be the fairest way to arrange this table.
|
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 |
|
| Language | Tools |
|
||||||
| -------- | ----- |
|
| -------- | ----- |
|
||||||
| ASM | [gcc](https://gcc.gnu.org) |
|
| ASM | [gcc](https://gcc.gnu.org) |
|
||||||
| Ansible | [ansible-lint](https://github.com/willthames/ansible-lint) |
|
| Ansible | [ansible-lint](https://github.com/willthames/ansible-lint) |
|
||||||
| AsciiDoc | [proselint](http://proselint.com/)|
|
| AsciiDoc | [proselint](http://proselint.com/) |
|
||||||
| Awk | [gawk](https://www.gnu.org/software/gawk/)|
|
| Awk | [gawk](https://www.gnu.org/software/gawk/)|
|
||||||
| Bash | [-n flag](https://www.gnu.org/software/bash/manual/bash.html#index-set), [shellcheck](https://www.shellcheck.net/) |
|
| Bash | shell [-n flag](https://www.gnu.org/software/bash/manual/bash.html#index-set), [shellcheck](https://www.shellcheck.net/) |
|
||||||
| Bourne Shell | [-n flag](http://linux.die.net/man/1/sh), [shellcheck](https://www.shellcheck.net/) |
|
| Bourne Shell | shell [-n flag](http://linux.die.net/man/1/sh), [shellcheck](https://www.shellcheck.net/) |
|
||||||
| C | [cppcheck](http://cppcheck.sourceforge.net), [gcc](https://gcc.gnu.org/), [clang](http://clang.llvm.org/), [clang-format](https://clang.llvm.org/docs/ClangFormat.html)|
|
| C | [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint), [gcc](https://gcc.gnu.org/), [clang](http://clang.llvm.org/), [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html)|
|
||||||
| C++ (filetype cpp) | [clang](http://clang.llvm.org/), [clangcheck](http://clang.llvm.org/docs/ClangCheck.html), [clangtidy](http://clang.llvm.org/extra/clang-tidy/), [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint), [gcc](https://gcc.gnu.org/), [clang-format](https://clang.llvm.org/docs/ClangFormat.html)|
|
| C++ (filetype cpp) | [clang](http://clang.llvm.org/), [clangcheck](http://clang.llvm.org/docs/ClangCheck.html) !!, [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint) !!, [gcc](https://gcc.gnu.org/), [clang-format](https://clang.llvm.org/docs/ClangFormat.html)|
|
||||||
| C# | [mcs](http://www.mono-project.com/docs/about-mono/languages/csharp/) |
|
| CUDA | [nvcc](http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html) |
|
||||||
|
| C# | [mcs](http://www.mono-project.com/docs/about-mono/languages/csharp/) see:`help ale-cs-mcs` for details, [mcsc](http://www.mono-project.com/docs/about-mono/languages/csharp/) !! see:`help ale-cs-mcsc` for details and configuration|
|
||||||
| Chef | [foodcritic](http://www.foodcritic.io/) |
|
| Chef | [foodcritic](http://www.foodcritic.io/) |
|
||||||
| CMake | [cmakelint](https://github.com/richq/cmake-lint) |
|
| CMake | [cmakelint](https://github.com/richq/cmake-lint) |
|
||||||
| CoffeeScript | [coffee](http://coffeescript.org/), [coffeelint](https://www.npmjs.com/package/coffeelint) |
|
| CoffeeScript | [coffee](http://coffeescript.org/), [coffeelint](https://www.npmjs.com/package/coffeelint) |
|
||||||
| Crystal | [crystal](https://crystal-lang.org/) |
|
| Crystal | [crystal](https://crystal-lang.org/) !! |
|
||||||
| CSS | [csslint](http://csslint.net/), [stylelint](https://github.com/stylelint/stylelint) |
|
| CSS | [csslint](http://csslint.net/), [stylelint](https://github.com/stylelint/stylelint), [prettier](https://github.com/prettier/prettier) |
|
||||||
| Cython (pyrex filetype) | [cython](http://cython.org/) |
|
| Cython (pyrex filetype) | [cython](http://cython.org/) |
|
||||||
| D | [dmd](https://dlang.org/dmd-linux.html) |
|
| D | [dmd](https://dlang.org/dmd-linux.html) |
|
||||||
| Dart | [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) |
|
| Dart | [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) |
|
||||||
| Dockerfile | [hadolint](https://github.com/lukasmartinelli/hadolint) |
|
| Dockerfile | [hadolint](https://github.com/lukasmartinelli/hadolint) |
|
||||||
| Elixir | [credo](https://github.com/rrrene/credo), [dogma](https://github.com/lpil/dogma) |
|
| Elixir | [credo](https://github.com/rrrene/credo), [dogma](https://github.com/lpil/dogma) !! |
|
||||||
| Elm | [elm-make](https://github.com/elm-lang/elm-make) |
|
| Elm | [elm-format](https://github.com/avh4/elm-format), [elm-make](https://github.com/elm-lang/elm-make) |
|
||||||
| Erb | [erb](https://github.com/jeremyevans/erubi), [erubis](https://github.com/kwatch/erubis) |
|
| Erb | [erb](https://github.com/jeremyevans/erubi), [erubis](https://github.com/kwatch/erubis) |
|
||||||
| Erlang | [erlc](http://erlang.org/doc/man/erlc.html), [SyntaxErl](https://github.com/ten0s/syntaxerl) |
|
| Erlang | [erlc](http://erlang.org/doc/man/erlc.html), [SyntaxErl](https://github.com/ten0s/syntaxerl) |
|
||||||
| Fortran | [gcc](https://gcc.gnu.org/) |
|
| Fortran | [gcc](https://gcc.gnu.org/) |
|
||||||
| FusionScript | [fusion-lint](https://github.com/RyanSquared/fusionscript) |
|
| FusionScript | [fusion-lint](https://github.com/RyanSquared/fusionscript) |
|
||||||
| Go | [gofmt -e](https://golang.org/cmd/gofmt/), [go vet](https://golang.org/cmd/vet/), [golint](https://godoc.org/github.com/golang/lint), [gometalinter](https://github.com/alecthomas/gometalinter), [go build](https://golang.org/cmd/go/), [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple), [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) |
|
| GLSL | [glslang](https://github.com/KhronosGroup/glslang) |
|
||||||
|
| Go | [gofmt](https://golang.org/cmd/gofmt/), [go vet](https://golang.org/cmd/vet/), [golint](https://godoc.org/github.com/golang/lint), [gometalinter](https://github.com/alecthomas/gometalinter) !!, [go build](https://golang.org/cmd/go/) !!, [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple), [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) |
|
||||||
| GraphQL | [gqlint](https://github.com/happylinks/gqlint) |
|
| GraphQL | [gqlint](https://github.com/happylinks/gqlint) |
|
||||||
| Haml | [haml-lint](https://github.com/brigade/haml-lint)
|
| Haml | [haml-lint](https://github.com/brigade/haml-lint) |
|
||||||
| Handlebars | [ember-template-lint](https://github.com/rwjblue/ember-template-lint) |
|
| Handlebars | [ember-template-lint](https://github.com/rwjblue/ember-template-lint) |
|
||||||
| Haskell | [ghc](https://www.haskell.org/ghc/), [stack-ghc](https://haskellstack.org/), [stack-build](https://haskellstack.org/), [ghc-mod](https://github.com/DanielG/ghc-mod), [stack-ghc-mod](https://github.com/DanielG/ghc-mod), [hlint](https://hackage.haskell.org/package/hlint), [hdevtools](https://hackage.haskell.org/package/hdevtools) |
|
| Haskell | [ghc](https://www.haskell.org/ghc/), [stack-ghc](https://haskellstack.org/), [stack-build](https://haskellstack.org/) !!, [ghc-mod](https://github.com/DanielG/ghc-mod), [stack-ghc-mod](https://github.com/DanielG/ghc-mod), [hlint](https://hackage.haskell.org/package/hlint), [hdevtools](https://hackage.haskell.org/package/hdevtools) |
|
||||||
| HTML | [HTMLHint](http://htmlhint.com/), [proselint](http://proselint.com/), [tidy](http://www.html-tidy.org/) |
|
| HTML | [HTMLHint](http://htmlhint.com/), [proselint](http://proselint.com/), [tidy](http://www.html-tidy.org/) |
|
||||||
| Idris | [idris](http://www.idris-lang.org/) |
|
| Idris | [idris](http://www.idris-lang.org/) |
|
||||||
| Java | [checkstyle](http://checkstyle.sourceforge.net), [javac](http://www.oracle.com/technetwork/java/javase/downloads/index.html) |
|
| Java | [checkstyle](http://checkstyle.sourceforge.net), [javac](http://www.oracle.com/technetwork/java/javase/downloads/index.html) |
|
||||||
| JavaScript | [eslint](http://eslint.org/), [jscs](http://jscs.info/), [jshint](http://jshint.com/), [flow](https://flowtype.org/), [standard](http://standardjs.com/), [prettier](https://github.com/prettier/prettier) (and `prettier-eslint`, `prettier-standard`), [xo](https://github.com/sindresorhus/xo)
|
| JavaScript | [eslint](http://eslint.org/), [jscs](http://jscs.info/), [jshint](http://jshint.com/), [flow](https://flowtype.org/), [prettier](https://github.com/prettier/prettier), prettier-eslint >= 4.2.0, prettier-standard, [standard](http://standardjs.com/), [xo](https://github.com/sindresorhus/xo)
|
||||||
| JSON | [jsonlint](http://zaa.ch/jsonlint/) |
|
| JSON | [jsonlint](http://zaa.ch/jsonlint/), [prettier](https://github.com/prettier/prettier) |
|
||||||
| Kotlin | [kotlinc](https://kotlinlang.org), [ktlint](https://ktlint.github.io) see `:help ale-integration-kotlin` for configuration instructions
|
| Kotlin | [kotlinc](https://kotlinlang.org) !!, [ktlint](https://ktlint.github.io) !! see `:help ale-integration-kotlin` for configuration instructions |
|
||||||
| LaTeX | [chktex](http://www.nongnu.org/chktex/), [lacheck](https://www.ctan.org/pkg/lacheck), [proselint](http://proselint.com/) |
|
| LaTeX | [chktex](http://www.nongnu.org/chktex/), [lacheck](https://www.ctan.org/pkg/lacheck), [proselint](http://proselint.com/) |
|
||||||
|
| LLVM | [llc](https://llvm.org/docs/CommandGuide/llc.html) |
|
||||||
| Lua | [luacheck](https://github.com/mpeterv/luacheck) |
|
| Lua | [luacheck](https://github.com/mpeterv/luacheck) |
|
||||||
| Markdown | [mdl](https://github.com/mivok/markdownlint), [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) |
|
| Markdown | [mdl](https://github.com/mivok/markdownlint), [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale), [remark-lint](https://github.com/wooorm/remark-lint) !! |
|
||||||
| MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) |
|
| MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) |
|
||||||
| Nim | [nim](https://nim-lang.org/docs/nimc.html) |
|
| Nim | [nim check](https://nim-lang.org/docs/nimc.html) !! |
|
||||||
| nix | [nix-instantiate](http://nixos.org/nix/manual/#sec-nix-instantiate) |
|
| nix | [nix-instantiate](http://nixos.org/nix/manual/#sec-nix-instantiate) |
|
||||||
| nroff | [proselint](http://proselint.com/)|
|
| nroff | [proselint](http://proselint.com/)|
|
||||||
| Objective-C | [clang](http://clang.llvm.org/) |
|
| Objective-C | [clang](http://clang.llvm.org/) |
|
||||||
| Objective-C++ | [clang](http://clang.llvm.org/) |
|
| Objective-C++ | [clang](http://clang.llvm.org/) |
|
||||||
| OCaml | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-integration-ocaml-merlin` for configuration instructions
|
| OCaml | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-ocaml-merlin` for configuration instructions |
|
||||||
| Perl | [perl -c](https://perl.org/), [perl-critic](https://metacpan.org/pod/Perl::Critic) |
|
| Perl | [perl -c](https://perl.org/), [perl-critic](https://metacpan.org/pod/Perl::Critic) |
|
||||||
| PHP | [hack](http://hacklang.org/), [langserver](https://github.com/felixfbecker/php-language-server), [php -l](https://secure.php.net/), [phpcs](https://github.com/squizlabs/PHP_CodeSniffer), [phpmd](https://phpmd.org), [phpstan](https://github.com/phpstan/phpstan), [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer) |
|
| PHP | [hack](http://hacklang.org/), [langserver](https://github.com/felixfbecker/php-language-server), [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) |
|
||||||
| Pod | [proselint](http://proselint.com/)|
|
| Pod | [proselint](http://proselint.com/)|
|
||||||
| Pug | [pug-lint](https://github.com/pugjs/pug-lint) |
|
| Pug | [pug-lint](https://github.com/pugjs/pug-lint) |
|
||||||
| Puppet | [puppet](https://puppet.com), [puppet-lint](https://puppet-lint.com) |
|
| Puppet | [puppet](https://puppet.com), [puppet-lint](https://puppet-lint.com) |
|
||||||
| Python | [autopep8](https://github.com/hhatto/autopep8), [flake8](http://flake8.pycqa.org/en/latest/), [isort](https://github.com/timothycrosley/isort), [mypy](http://mypy-lang.org/), [pycodestyle](https://github.com/PyCQA/pycodestyle), [pylint](https://www.pylint.org/), [yapf](https://github.com/google/yapf) |
|
| Python | [autopep8](https://github.com/hhatto/autopep8), [flake8](http://flake8.pycqa.org/en/latest/), [isort](https://github.com/timothycrosley/isort), [mypy](http://mypy-lang.org/), [pycodestyle](https://github.com/PyCQA/pycodestyle), [pylint](https://www.pylint.org/) !!, [yapf](https://github.com/google/yapf) |
|
||||||
| R | [lintr](https://github.com/jimhester/lintr) |
|
| R | [lintr](https://github.com/jimhester/lintr) |
|
||||||
| ReasonML | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-integration-reason-merlin` for configuration instructions
|
| ReasonML | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-integration-reason-merlin` for configuration instructions |
|
||||||
| reStructuredText | [proselint](http://proselint.com/)|
|
| reStructuredText | [proselint](http://proselint.com/) |
|
||||||
| RPM spec | [rpmlint](https://github.com/rpm-software-management/rpmlint) (disabled by default; see `:help ale-integration-spec`) |
|
| RPM spec | [rpmlint](https://github.com/rpm-software-management/rpmlint) (disabled by default; see `:help ale-integration-spec`) |
|
||||||
| Ruby | [brakeman](http://brakemanscanner.org/), [rails_best_practices](https://github.com/flyerhzm/rails_best_practices), [reek](https://github.com/troessner/reek), [rubocop](https://github.com/bbatsov/rubocop), [ruby](https://www.ruby-lang.org) |
|
| Ruby | [brakeman](http://brakemanscanner.org/) !!, [rails_best_practices](https://github.com/flyerhzm/rails_best_practices) !!, [reek](https://github.com/troessner/reek), [rubocop](https://github.com/bbatsov/rubocop), [ruby](https://www.ruby-lang.org) |
|
||||||
| Rust | cargo (see `:help ale-integration-rust` for configuration instructions), [rls](https://github.com/rust-lang-nursery/rls), [rustc](https://www.rust-lang.org/) |
|
| Rust | cargo !! (see `:help ale-integration-rust` for configuration instructions), [rls](https://github.com/rust-lang-nursery/rls), [rustc](https://www.rust-lang.org/) |
|
||||||
| SASS | [sass-lint](https://www.npmjs.com/package/sass-lint), [stylelint](https://github.com/stylelint/stylelint) |
|
| SASS | [sass-lint](https://www.npmjs.com/package/sass-lint), [stylelint](https://github.com/stylelint/stylelint) |
|
||||||
| SCSS | [sass-lint](https://www.npmjs.com/package/sass-lint), [scss-lint](https://github.com/brigade/scss-lint), [stylelint](https://github.com/stylelint/stylelint) |
|
| SCSS | [sass-lint](https://www.npmjs.com/package/sass-lint), [scss-lint](https://github.com/brigade/scss-lint), [stylelint](https://github.com/stylelint/stylelint), [prettier](https://github.com/prettier/prettier) |
|
||||||
| Scala | [scalac](http://scala-lang.org), [scalastyle](http://www.scalastyle.org) |
|
| Scala | [scalac](http://scala-lang.org), [scalastyle](http://www.scalastyle.org) |
|
||||||
| Slim | [slim-lint](https://github.com/sds/slim-lint)
|
| Slim | [slim-lint](https://github.com/sds/slim-lint) |
|
||||||
| SML | [smlnj](http://www.smlnj.org/) |
|
| SML | [smlnj](http://www.smlnj.org/) |
|
||||||
|
| Solidity | [solium](https://github.com/duaraghav8/Solium) |
|
||||||
| Stylus | [stylelint](https://github.com/stylelint/stylelint) |
|
| Stylus | [stylelint](https://github.com/stylelint/stylelint) |
|
||||||
| SQL | [sqlint](https://github.com/purcell/sqlint) |
|
| SQL | [sqlint](https://github.com/purcell/sqlint) |
|
||||||
| Swift | [swiftlint](https://github.com/realm/SwiftLint), [swiftformat](https://github.com/nicklockwood/SwiftFormat) |
|
| Swift | [swiftlint](https://github.com/realm/SwiftLint), [swiftformat](https://github.com/nicklockwood/SwiftFormat) |
|
||||||
| Tcl | [nagelfar](http://nagelfar.sourceforge.net)|
|
| Tcl | [nagelfar](http://nagelfar.sourceforge.net) !! |
|
||||||
| Texinfo | [proselint](http://proselint.com/)|
|
| Texinfo | [proselint](http://proselint.com/)|
|
||||||
| Text^ | [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) |
|
| Text^ | [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) |
|
||||||
| TypeScript | [eslint](http://eslint.org/), [tslint](https://github.com/palantir/tslint), tsserver, typecheck |
|
| Thrift | [thrift](http://thrift.apache.org/) |
|
||||||
|
| TypeScript | [eslint](http://eslint.org/), [tslint](https://github.com/palantir/tslint), tsserver, typecheck, [prettier](https://github.com/prettier/prettier) |
|
||||||
| Verilog | [iverilog](https://github.com/steveicarus/iverilog), [verilator](http://www.veripool.org/projects/verilator/wiki/Intro) |
|
| Verilog | [iverilog](https://github.com/steveicarus/iverilog), [verilator](http://www.veripool.org/projects/verilator/wiki/Intro) |
|
||||||
| Vim | [vint](https://github.com/Kuniwak/vint) |
|
| Vim | [vint](https://github.com/Kuniwak/vint) |
|
||||||
| Vim help^ | [proselint](http://proselint.com/)|
|
| Vim help^ | [proselint](http://proselint.com/)|
|
||||||
| XHTML | [proselint](http://proselint.com/)|
|
| XHTML | [proselint](http://proselint.com/)|
|
||||||
| XML | [xmllint](http://xmlsoft.org/xmllint.html/)|
|
| XML | [xmllint](http://xmlsoft.org/xmllint.html)|
|
||||||
| YAML | [swaglint](https://github.com/byCedric/swaglint), [yamllint](https://yamllint.readthedocs.io/) |
|
| YAML | [swaglint](https://github.com/byCedric/swaglint), [yamllint](https://yamllint.readthedocs.io/) |
|
||||||
|
|
||||||
* *^ No linters for text or Vim help filetypes are enabled by default.*
|
|
||||||
|
|
||||||
<a name="usage"></a>
|
<a name="usage"></a>
|
||||||
|
|
||||||
## 2. Usage
|
## 2. Usage
|
||||||
@@ -397,9 +410,70 @@ set statusline=%{LinterStatus()}
|
|||||||
|
|
||||||
See `:help ale#statusline#Count()` for more information.
|
See `:help ale#statusline#Count()` for more information.
|
||||||
|
|
||||||
|
<a name="faq-lightline"></a>
|
||||||
|
|
||||||
|
### 5.v. How can I show errors or warnings in my lightline?
|
||||||
|
|
||||||
|
[lightline](https://github.com/itchyny/lightline.vim) does not have built-in
|
||||||
|
support for ALE, nevertheless it's easy to do it yourself:
|
||||||
|
|
||||||
|
```vim
|
||||||
|
" This is regular lightline configuration, we just added
|
||||||
|
" 'linter_warnings', 'linter_errors' and 'linter_ok' to
|
||||||
|
" the active right panel. Feel free to move it anywhere.
|
||||||
|
" `component_expand' and `component_type' are required.
|
||||||
|
"
|
||||||
|
" For more info on how this works, see lightline documentation.
|
||||||
|
let g:lightline = {
|
||||||
|
\ 'active': {
|
||||||
|
\ 'right': [ [ 'lineinfo' ],
|
||||||
|
\ [ 'percent' ],
|
||||||
|
\ [ 'linter_warnings', 'linter_errors', 'linter_ok' ],
|
||||||
|
\ [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
||||||
|
\ },
|
||||||
|
\ 'component_expand': {
|
||||||
|
\ 'linter_warnings': 'LightlineLinterWarnings',
|
||||||
|
\ 'linter_errors': 'LightlineLinterErrors',
|
||||||
|
\ 'linter_ok': 'LightlineLinterOK'
|
||||||
|
\ },
|
||||||
|
\ 'component_type': {
|
||||||
|
\ 'linter_warnings': 'warning',
|
||||||
|
\ 'linter_errors': 'error',
|
||||||
|
\ 'linter_ok': 'ok'
|
||||||
|
\ },
|
||||||
|
\ }
|
||||||
|
|
||||||
|
autocmd User ALELint call lightline#update()
|
||||||
|
|
||||||
|
" ale + lightline
|
||||||
|
function! LightlineLinterWarnings() abort
|
||||||
|
let l:counts = ale#statusline#Count(bufnr(''))
|
||||||
|
let l:all_errors = l:counts.error + l:counts.style_error
|
||||||
|
let l:all_non_errors = l:counts.total - l:all_errors
|
||||||
|
return l:counts.total == 0 ? '' : printf('%d --', all_non_errors)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! LightlineLinterErrors() abort
|
||||||
|
let l:counts = ale#statusline#Count(bufnr(''))
|
||||||
|
let l:all_errors = l:counts.error + l:counts.style_error
|
||||||
|
let l:all_non_errors = l:counts.total - l:all_errors
|
||||||
|
return l:counts.total == 0 ? '' : printf('%d >>', all_errors)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! LightlineLinterOK() abort
|
||||||
|
let l:counts = ale#statusline#Count(bufnr(''))
|
||||||
|
let l:all_errors = l:counts.error + l:counts.style_error
|
||||||
|
let l:all_non_errors = l:counts.total - l:all_errors
|
||||||
|
return l:counts.total == 0 ? '✓' : ''
|
||||||
|
endfunction
|
||||||
|
```
|
||||||
|
|
||||||
|
See `:help ale#statusline#Count()` and [lightline documentation](https://github.com/itchyny/lightline.vim#advanced-configuration)
|
||||||
|
for more information.
|
||||||
|
|
||||||
<a name="faq-echo-format"></a>
|
<a name="faq-echo-format"></a>
|
||||||
|
|
||||||
### 5.v. How can I change the format for echo messages?
|
### 5.vi. How can I change the format for echo messages?
|
||||||
|
|
||||||
There are 3 global options that allow customizing the echoed message.
|
There are 3 global options that allow customizing the echoed message.
|
||||||
|
|
||||||
@@ -424,7 +498,7 @@ Will give you:
|
|||||||
|
|
||||||
<a name="faq-autocmd"></a>
|
<a name="faq-autocmd"></a>
|
||||||
|
|
||||||
### 5.vi. How can I execute some code when ALE stops linting?
|
### 5.vii. How can I execute some code when ALE stops linting?
|
||||||
|
|
||||||
ALE runs its own [autocmd](http://vimdoc.sourceforge.net/htmldoc/autocmd.html)
|
ALE runs its own [autocmd](http://vimdoc.sourceforge.net/htmldoc/autocmd.html)
|
||||||
event whenever has a linter has been successfully executed and processed. This
|
event whenever has a linter has been successfully executed and processed. This
|
||||||
@@ -439,7 +513,7 @@ augroup END
|
|||||||
|
|
||||||
<a name="faq-navigation"></a>
|
<a name="faq-navigation"></a>
|
||||||
|
|
||||||
### 5.vii. How can I navigate between errors quickly?
|
### 5.viii. How can I navigate between errors quickly?
|
||||||
|
|
||||||
ALE offers some commands with `<Plug>` keybinds for moving between warnings and
|
ALE offers some commands with `<Plug>` keybinds for moving between warnings and
|
||||||
errors quickly. You can map the keys Ctrl+j and Ctrl+k to moving between errors
|
errors quickly. You can map the keys Ctrl+j and Ctrl+k to moving between errors
|
||||||
@@ -455,7 +529,7 @@ For more information, consult the online documentation with
|
|||||||
|
|
||||||
<a name="faq-lint-on-save"></a>
|
<a name="faq-lint-on-save"></a>
|
||||||
|
|
||||||
### 5.viii. How can I run linters only when I save files?
|
### 5.ix. How can I run linters only when I save files?
|
||||||
|
|
||||||
ALE offers an option `g:ale_lint_on_save` for enabling running the linters
|
ALE offers an option `g:ale_lint_on_save` for enabling running the linters
|
||||||
when files are saved. This option is enabled by default. If you only
|
when files are saved. This option is enabled by default. If you only
|
||||||
@@ -475,7 +549,7 @@ files, you can set `g:ale_lint_on_save` to `0`.
|
|||||||
|
|
||||||
<a name="faq-quickfix"></a>
|
<a name="faq-quickfix"></a>
|
||||||
|
|
||||||
### 5.ix. How can I use the quickfix list instead of the loclist?
|
### 5.x. How can I use the quickfix list instead of the loclist?
|
||||||
|
|
||||||
The quickfix list can be enabled by turning the `g:ale_set_quickfix`
|
The quickfix list can be enabled by turning the `g:ale_set_quickfix`
|
||||||
option on. If you wish to also disable the loclist, you can disable
|
option on. If you wish to also disable the loclist, you can disable
|
||||||
@@ -502,7 +576,7 @@ let g:ale_keep_list_window_open = 1
|
|||||||
|
|
||||||
<a name="faq-jsx-stylelint-eslint"></a>
|
<a name="faq-jsx-stylelint-eslint"></a>
|
||||||
|
|
||||||
### 5.x. How can I check JSX files with both stylelint and eslint?
|
### 5.xi. How can I check JSX files with both stylelint and eslint?
|
||||||
|
|
||||||
If you configure ALE options correctly in your vimrc file, and install
|
If you configure ALE options correctly in your vimrc file, and install
|
||||||
the right tools, you can check JSX files with stylelint and eslint.
|
the right tools, you can check JSX files with stylelint and eslint.
|
||||||
@@ -535,7 +609,7 @@ no linter will be run twice for the same file.
|
|||||||
|
|
||||||
<a name="faq-my-battery-is-sad"></a>
|
<a name="faq-my-battery-is-sad"></a>
|
||||||
|
|
||||||
### 5.xi. Will this plugin eat all of my laptop battery power?
|
### 5.xii. Will this plugin eat all of my laptop battery power?
|
||||||
|
|
||||||
ALE takes advantage of the power of various tools to check your code. This of
|
ALE takes advantage of the power of various tools to check your code. This of
|
||||||
course means that CPU time will be used to continuously check your code. If you
|
course means that CPU time will be used to continuously check your code. If you
|
||||||
|
|||||||
64
ale_linters/c/clangtidy.vim
Normal file
64
ale_linters/c/clangtidy.vim
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
" Author: vdeurzen <tim@kompiler.org>, w0rp <devw0rp@gmail.com>,
|
||||||
|
" gagbo <gagbobada@gmail.com>, Andrej Radovic <r.andrej@gmail.com>
|
||||||
|
" Description: clang-tidy linter for c files
|
||||||
|
|
||||||
|
call ale#Set('c_clangtidy_executable', 'clang-tidy')
|
||||||
|
" Set this option to check the checks clang-tidy will apply.
|
||||||
|
" The number of checks that can be applied to C files is limited in contrast to
|
||||||
|
" C++
|
||||||
|
"
|
||||||
|
" Consult the check list in clang-tidy's documentation:
|
||||||
|
" http://clang.llvm.org/extra/clang-tidy/checks/list.html
|
||||||
|
|
||||||
|
call ale#Set('c_clangtidy_checks', ['*'])
|
||||||
|
" Set this option to manually set some options for clang-tidy.
|
||||||
|
" This will disable compile_commands.json detection.
|
||||||
|
call ale#Set('c_clangtidy_options', '')
|
||||||
|
call ale#Set('c_build_dir', '')
|
||||||
|
|
||||||
|
function! ale_linters#c#clangtidy#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'c_clangtidy_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:GetBuildDirectory(buffer) abort
|
||||||
|
" Don't include build directory for header files, as compile_commands.json
|
||||||
|
" files don't consider headers to be translation units, and provide no
|
||||||
|
" commands for compiling header files.
|
||||||
|
if expand('#' . a:buffer) =~# '\v\.(h|hpp)$'
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:build_dir = ale#Var(a:buffer, 'c_build_dir')
|
||||||
|
|
||||||
|
" c_build_dir has the priority if defined
|
||||||
|
if !empty(l:build_dir)
|
||||||
|
return l:build_dir
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ale#c#FindCompileCommands(a:buffer)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#c#clangtidy#GetCommand(buffer) abort
|
||||||
|
let l:checks = join(ale#Var(a:buffer, 'c_clangtidy_checks'), ',')
|
||||||
|
let l:build_dir = s:GetBuildDirectory(a:buffer)
|
||||||
|
|
||||||
|
" Get the extra options if we couldn't find a build directory.
|
||||||
|
let l:options = empty(l:build_dir)
|
||||||
|
\ ? ale#Var(a:buffer, 'c_clangtidy_options')
|
||||||
|
\ : ''
|
||||||
|
|
||||||
|
return ale#Escape(ale_linters#c#clangtidy#GetExecutable(a:buffer))
|
||||||
|
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
|
||||||
|
\ . ' %s'
|
||||||
|
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||||
|
\ . (!empty(l:options) ? ' -- ' . l:options : '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('c', {
|
||||||
|
\ 'name': 'clangtidy',
|
||||||
|
\ 'output_stream': 'stdout',
|
||||||
|
\ 'executable_callback': 'ale_linters#c#clangtidy#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#c#clangtidy#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
87
ale_linters/cs/mcsc.vim
Normal file
87
ale_linters/cs/mcsc.vim
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
" general mcs options which are likely to stay constant across
|
||||||
|
" source trees like -pkg:dotnet
|
||||||
|
let g:ale_cs_mcsc_options = get(g:, 'ale_cs_mcsc_options', '')
|
||||||
|
|
||||||
|
" path string pointing the linter to the base path of the
|
||||||
|
" source tree to check
|
||||||
|
let g:ale_cs_mcsc_source = get(g:, 'ale_cs_mcsc_source','.')
|
||||||
|
|
||||||
|
" list of search paths for additional assemblies to consider
|
||||||
|
let g:ale_cs_mcsc_assembly_path = get(g:, 'ale_cs_mcsc_assembly_path',[])
|
||||||
|
|
||||||
|
" list of assemblies to consider
|
||||||
|
let g:ale_cs_mcsc_assemblies = get(g:, 'ale_cs_mcsc_assemblies',[])
|
||||||
|
function! ale_linters#cs#mcsc#GetCommand(buffer) abort
|
||||||
|
|
||||||
|
" if list of assembly search paths is not empty convert it to
|
||||||
|
" appropriate -lib: parameter of mcs
|
||||||
|
let l:path = ale#Var(a:buffer, 'cs_mcsc_assembly_path')
|
||||||
|
|
||||||
|
if !empty(l:path)
|
||||||
|
let l:path = '-lib:"' . join(l:path, '","') .'"'
|
||||||
|
else
|
||||||
|
let l:path =''
|
||||||
|
endif
|
||||||
|
|
||||||
|
" if list of assemblies to link is not empty convert it to the
|
||||||
|
" appropriate -r: parameter of mcs
|
||||||
|
let l:assemblies = ale#Var(a:buffer, 'cs_mcsc_assemblies')
|
||||||
|
|
||||||
|
if !empty(l:assemblies)
|
||||||
|
let l:assemblies = '-r:"' . join(l:assemblies, '","') . '"'
|
||||||
|
else
|
||||||
|
let l:assemblies =''
|
||||||
|
endif
|
||||||
|
|
||||||
|
" register temporary module target file with ale
|
||||||
|
let l:out = tempname()
|
||||||
|
call ale#engine#ManageFile(a:buffer, l:out)
|
||||||
|
|
||||||
|
" assemble linter command string to be executed by ale
|
||||||
|
" implicitly set -unsafe mcs flag set compilation
|
||||||
|
" target to module (-t:module), direct mcs output to
|
||||||
|
" temporary file (-out)
|
||||||
|
"
|
||||||
|
return 'cd "' . ale#Var(a:buffer, 'cs_mcsc_source') . '";'
|
||||||
|
\ . 'mcs -unsafe'
|
||||||
|
\ . ' ' . ale#Var(a:buffer, 'cs_mcsc_options')
|
||||||
|
\ . ' ' . l:path
|
||||||
|
\ . ' ' . l:assemblies
|
||||||
|
\ . ' -out:' . l:out
|
||||||
|
\ . ' -t:module'
|
||||||
|
\ . ' -recurse:"*.cs"'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#cs#mcsc#Handle(buffer, lines) abort
|
||||||
|
" Look for lines like the following.
|
||||||
|
"
|
||||||
|
" Tests.cs(12,29): error CSXXXX: ; expected
|
||||||
|
"
|
||||||
|
" NOTE: pattern also captures file name as linter compiles all
|
||||||
|
" files within the source tree rooted at the specified source
|
||||||
|
" path and not just the file loaded in the buffer
|
||||||
|
let l:pattern = '^\(.\+\.cs\)(\(\d\+\),\(\d\+\)): \(.\+\): \(.\+\)'
|
||||||
|
let l:output = []
|
||||||
|
let l:source = ale#Var(a:buffer, 'cs_mcsc_source')
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'filename': fnamemodify(l:source . '/' . l:match[1], ':p'),
|
||||||
|
\ 'lnum': l:match[2] + 0,
|
||||||
|
\ 'col': l:match[3] + 0,
|
||||||
|
\ 'text': l:match[4] . ': ' . l:match[5],
|
||||||
|
\ 'type': l:match[4] =~# '^error' ? 'E' : 'W',
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('cs',{
|
||||||
|
\ 'name': 'mcsc',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable': 'mcs',
|
||||||
|
\ 'command_callback': 'ale_linters#cs#mcsc#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#cs#mcsc#Handle',
|
||||||
|
\ 'lint_file': 1
|
||||||
|
\})
|
||||||
56
ale_linters/cuda/nvcc.vim
Normal file
56
ale_linters/cuda/nvcc.vim
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
" Author: blahgeek <i@blahgeek.com>
|
||||||
|
" Description: NVCC linter for cuda files
|
||||||
|
|
||||||
|
call ale#Set('cuda_nvcc_executable', 'nvcc')
|
||||||
|
call ale#Set('cuda_nvcc_options', '-std=c++11')
|
||||||
|
|
||||||
|
function! ale_linters#cuda#nvcc#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'cuda_nvcc_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#cuda#nvcc#GetCommand(buffer) abort
|
||||||
|
" Unused: use ale#util#nul_file
|
||||||
|
" let l:output_file = tempname() . '.ii'
|
||||||
|
" call ale#engine#ManageFile(a:buffer, l:output_file)
|
||||||
|
|
||||||
|
return ale#Escape(ale_linters#cuda#nvcc#GetExecutable(a:buffer))
|
||||||
|
\ . ' -cuda '
|
||||||
|
\ . ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer))
|
||||||
|
\ . ale#Var(a:buffer, 'cuda_nvcc_options') . ' %s'
|
||||||
|
\ . ' -o ' . g:ale#util#nul_file
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#cuda#nvcc#HandleNVCCFormat(buffer, lines) abort
|
||||||
|
" Look for lines like the following.
|
||||||
|
"
|
||||||
|
" test.cu(8): error: argument of type "void *" is incompatible with parameter of type "int *"
|
||||||
|
let l:pattern = '\v^([^:\(\)]+):?\(?(\d+)\)?:(\d+)?:?\s*\w*\s*(error|warning): (.+)$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
|
||||||
|
let l:item = {
|
||||||
|
\ 'lnum': str2nr(l:match[2]),
|
||||||
|
\ 'type': l:match[4] =~# 'error' ? 'E' : 'W',
|
||||||
|
\ 'text': l:match[5],
|
||||||
|
\ 'filename': fnamemodify(l:match[1], ':p'),
|
||||||
|
\}
|
||||||
|
|
||||||
|
if !empty(l:match[3])
|
||||||
|
let l:item.col = str2nr(l:match[3])
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(l:output, l:item)
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('cuda', {
|
||||||
|
\ 'name': 'nvcc',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable_callback': 'ale_linters#cuda#nvcc#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#cuda#nvcc#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#cuda#nvcc#HandleNVCCFormat',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
@@ -1,6 +1,15 @@
|
|||||||
" Author: buffalocoder - https://github.com/buffalocoder
|
" Author: buffalocoder - https://github.com/buffalocoder, soywod - https://github.com/soywod
|
||||||
" Description: Elm linting in Ale. Closely follows the Syntastic checker in https://github.com/ElmCast/elm-vim.
|
" Description: Elm linting in Ale. Closely follows the Syntastic checker in https://github.com/ElmCast/elm-vim.
|
||||||
|
|
||||||
|
call ale#Set('elm_make_executable', 'elm-make')
|
||||||
|
call ale#Set('elm_make_use_global', 0)
|
||||||
|
|
||||||
|
function! ale_linters#elm#make#GetExecutable(buffer) abort
|
||||||
|
return ale#node#FindExecutable(a:buffer, 'elm_make', [
|
||||||
|
\ 'node_modules/.bin/elm-make',
|
||||||
|
\])
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#elm#make#Handle(buffer, lines) abort
|
function! ale_linters#elm#make#Handle(buffer, lines) abort
|
||||||
let l:output = []
|
let l:output = []
|
||||||
let l:is_windows = has('win32')
|
let l:is_windows = has('win32')
|
||||||
@@ -52,6 +61,7 @@ endfunction
|
|||||||
" If it doesn't, then this will fail when imports are needed.
|
" 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#GetCommand(buffer) abort
|
||||||
let l:elm_package = ale#path#FindNearestFile(a:buffer, 'elm-package.json')
|
let l:elm_package = ale#path#FindNearestFile(a:buffer, 'elm-package.json')
|
||||||
|
let l:elm_exe = ale_linters#elm#make#GetExecutable(a:buffer)
|
||||||
if empty(l:elm_package)
|
if empty(l:elm_package)
|
||||||
let l:dir_set_cmd = ''
|
let l:dir_set_cmd = ''
|
||||||
else
|
else
|
||||||
@@ -61,16 +71,18 @@ function! ale_linters#elm#make#GetCommand(buffer) abort
|
|||||||
|
|
||||||
" The elm-make compiler, at the time of this writing, uses '/dev/null' as
|
" The elm-make 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,
|
" a sort of flag to tell the compiler not to generate an output file,
|
||||||
" which is why this is hard coded here.
|
" which is why this is hard coded here. It does not use NUL on Windows.
|
||||||
" Source: https://github.com/elm-lang/elm-make/blob/master/src/Flags.hs
|
" Source: https://github.com/elm-lang/elm-make/blob/master/src/Flags.hs
|
||||||
let l:elm_cmd = 'elm-make --report=json --output='.ale#Escape('/dev/null')
|
let l:elm_cmd = ale#Escape(l:elm_exe)
|
||||||
|
\ . ' --report=json'
|
||||||
|
\ . ' --output=/dev/null'
|
||||||
|
|
||||||
return l:dir_set_cmd . ' ' . l:elm_cmd . ' %t'
|
return l:dir_set_cmd . ' ' . l:elm_cmd . ' %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('elm', {
|
call ale#linter#Define('elm', {
|
||||||
\ 'name': 'make',
|
\ 'name': 'make',
|
||||||
\ 'executable': 'elm-make',
|
\ 'executable_callback': 'ale_linters#elm#make#GetExecutable',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'command_callback': 'ale_linters#elm#make#GetCommand',
|
\ 'command_callback': 'ale_linters#elm#make#GetCommand',
|
||||||
\ 'callback': 'ale_linters#elm#make#Handle'
|
\ 'callback': 'ale_linters#elm#make#Handle'
|
||||||
|
|||||||
46
ale_linters/glsl/glslang.vim
Normal file
46
ale_linters/glsl/glslang.vim
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
" Author: Sven-Hendrik Haase <svenstaro@gmail.com>
|
||||||
|
" Description: glslang-based linter for glsl files
|
||||||
|
"
|
||||||
|
" TODO: Once https://github.com/KhronosGroup/glslang/pull/1047 is accepted,
|
||||||
|
" we can use stdin.
|
||||||
|
|
||||||
|
let g:ale_glsl_glslang_executable =
|
||||||
|
\ get(g:, 'ale_glsl_glslang_executable', 'glslangValidator')
|
||||||
|
|
||||||
|
let g:ale_glsl_glslang_options = get(g:, 'ale_glsl_glslang_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#glsl#glslang#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'glsl_glslang_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#glsl#glslang#GetCommand(buffer) abort
|
||||||
|
return ale_linters#glsl#glslang#GetExecutable(a:buffer)
|
||||||
|
\ . ' ' . ale#Var(a:buffer, 'glsl_glslang_options')
|
||||||
|
\ . ' ' . '-C %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#glsl#glslang#Handle(buffer, lines) abort
|
||||||
|
" Matches patterns like the following:
|
||||||
|
"
|
||||||
|
" ERROR: 0:5: 'foo' : undeclared identifier
|
||||||
|
let l:pattern = '^\(.\+\): \(\d\+\):\(\d\+\): \(.\+\)'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': str2nr(l:match[3]),
|
||||||
|
\ 'col': str2nr(l:match[2]),
|
||||||
|
\ 'text': l:match[4],
|
||||||
|
\ 'type': l:match[1] is# 'ERROR' ? 'E' : 'W',
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('glsl', {
|
||||||
|
\ 'name': 'glslang',
|
||||||
|
\ 'executable_callback': 'ale_linters#glsl#glslang#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#glsl#glslang#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#glsl#glslang#Handle',
|
||||||
|
\})
|
||||||
@@ -6,4 +6,5 @@ call ale#linter#Define('go', {
|
|||||||
\ 'executable': 'gosimple',
|
\ 'executable': 'gosimple',
|
||||||
\ 'command': 'gosimple %t',
|
\ 'command': 'gosimple %t',
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
|
\ 'output_stream': 'both'
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -6,4 +6,5 @@ call ale#linter#Define('go', {
|
|||||||
\ 'executable': 'staticcheck',
|
\ 'executable': 'staticcheck',
|
||||||
\ 'command': 'staticcheck %t',
|
\ 'command': 'staticcheck %t',
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
|
\ 'output_stream': 'both'
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
call ale#Set('haskell_stack_build_options', '--fast')
|
call ale#Set('haskell_stack_build_options', '--fast')
|
||||||
|
|
||||||
function ale_linters#haskell#stack_build#GetCommand(buffer) abort
|
function! ale_linters#haskell#stack_build#GetCommand(buffer) abort
|
||||||
let l:flags = ale#Var(a:buffer, 'haskell_stack_build_options')
|
let l:flags = ale#Var(a:buffer, 'haskell_stack_build_options')
|
||||||
|
|
||||||
return 'stack build ' . l:flags
|
return 'stack build ' . l:flags
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ function! ale_linters#java#javac#GetImportPaths(buffer) abort
|
|||||||
\ . 'mvn dependency:build-classpath'
|
\ . 'mvn dependency:build-classpath'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let l:classpath_command = ale#gradle#BuildClasspathCommand(a:buffer)
|
||||||
|
if !empty(l:classpath_command)
|
||||||
|
return l:classpath_command
|
||||||
|
endif
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -14,17 +14,9 @@ endfunction
|
|||||||
|
|
||||||
function! ale_linters#javascript#standard#GetCommand(buffer) abort
|
function! ale_linters#javascript#standard#GetCommand(buffer) abort
|
||||||
let l:executable = ale_linters#javascript#standard#GetExecutable(a:buffer)
|
let l:executable = ale_linters#javascript#standard#GetExecutable(a:buffer)
|
||||||
|
|
||||||
if ale#Has('win32') && l:executable =~? '\.js$'
|
|
||||||
" .js files have to be executed with Node on Windows.
|
|
||||||
let l:head = 'node ' . ale#Escape(l:executable)
|
|
||||||
else
|
|
||||||
let l:head = ale#Escape(l:executable)
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:options = ale#Var(a:buffer, 'javascript_standard_options')
|
let l:options = ale#Var(a:buffer, 'javascript_standard_options')
|
||||||
|
|
||||||
return l:head
|
return ale#node#Executable(a:buffer, l:executable)
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
\ . ' --stdin %s'
|
\ . ' --stdin %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
35
ale_linters/llvm/llc.vim
Normal file
35
ale_linters/llvm/llc.vim
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
" Author: rhysd <https://rhysd.github.io>
|
||||||
|
" Description: Support for checking LLVM IR with llc
|
||||||
|
|
||||||
|
call ale#Set('llvm_llc_executable', 'llc')
|
||||||
|
|
||||||
|
function! ale_linters#llvm#llc#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'llvm_llc_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#llvm#llc#GetCommand(buffer) abort
|
||||||
|
return ale#Escape(ale_linters#llvm#llc#GetExecutable(a:buffer))
|
||||||
|
\ . ' -filetype=null -o='
|
||||||
|
\ . ale#Escape(g:ale#util#nul_file)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#llvm#llc#HandleErrors(buffer, lines) abort
|
||||||
|
" Handle '{path}: {file}:{line}:{col}: error: {message}' format
|
||||||
|
let l:pattern = '\v^[a-zA-Z]?:?[^:]+: [^:]+:(\d+):(\d+): (.+)$'
|
||||||
|
let l:matches = ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
|
||||||
|
return map(l:matches, "{
|
||||||
|
\ 'lnum': str2nr(v:val[1]),
|
||||||
|
\ 'col': str2nr(v:val[2]),
|
||||||
|
\ 'text': v:val[3],
|
||||||
|
\ 'type': 'E',
|
||||||
|
\}")
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('llvm', {
|
||||||
|
\ 'name': 'llc',
|
||||||
|
\ 'executable_callback': 'ale_linters#llvm#llc#GetExecutable',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'command_callback': 'ale_linters#llvm#llc#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#llvm#llc#HandleErrors',
|
||||||
|
\})
|
||||||
@@ -26,6 +26,12 @@ function! ale_linters#lua#luacheck#Handle(buffer, lines) abort
|
|||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
if !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
|
||||||
|
\ && l:match[3] is# 'W'
|
||||||
|
\ && index(range(611, 614), str2nr(l:match[4])) >= 0
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': l:match[1] + 0,
|
\ 'lnum': l:match[1] + 0,
|
||||||
\ 'col': l:match[2] + 0,
|
\ 'col': l:match[2] + 0,
|
||||||
|
|||||||
28
ale_linters/markdown/remark_lint.vim
Normal file
28
ale_linters/markdown/remark_lint.vim
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
" Author rhysd https://rhysd.github.io/
|
||||||
|
" Description: remark-lint for Markdown files
|
||||||
|
|
||||||
|
function! ale_linters#markdown#remark_lint#Handle(buffer, lines) abort
|
||||||
|
" matches: ' 1:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint'
|
||||||
|
let l:pattern = '^ \+\(\d\+\):\(\d\+\) \(warning\|error\) \(.\+\)$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:match[1] + 0,
|
||||||
|
\ 'col': l:match[2] + 0,
|
||||||
|
\ 'type': l:match[3] is# 'error' ? 'E' : 'W',
|
||||||
|
\ 'text': l:match[4],
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('markdown', {
|
||||||
|
\ 'name': 'remark-lint',
|
||||||
|
\ 'executable': 'remark',
|
||||||
|
\ 'command': 'remark --no-stdout --no-color %s',
|
||||||
|
\ 'callback': 'ale_linters#markdown#remark_lint#Handle',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\})
|
||||||
@@ -14,7 +14,7 @@ function! ale_linters#php#phpmd#Handle(buffer, lines) abort
|
|||||||
" Matches against lines like the following:
|
" Matches against lines like the following:
|
||||||
"
|
"
|
||||||
" /path/to/some-filename.php:18 message
|
" /path/to/some-filename.php:18 message
|
||||||
let l:pattern = '^.*:\(\d\+\)\t\(.\+\)$'
|
let l:pattern = '^.*:\(\d\+\)\s\+\(.\+\)$'
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
" Set to change the ruleset
|
" Set to change the ruleset
|
||||||
let g:ale_php_phpstan_executable = get(g:, 'ale_php_phpstan_executable', 'phpstan')
|
let g:ale_php_phpstan_executable = get(g:, 'ale_php_phpstan_executable', 'phpstan')
|
||||||
let g:ale_php_phpstan_level = get(g:, 'ale_php_phpstan_level', '4')
|
let g:ale_php_phpstan_level = get(g:, 'ale_php_phpstan_level', '4')
|
||||||
|
let g:ale_php_phpstan_configuration = get(g:, 'ale_php_phpstan_configuration', '')
|
||||||
|
|
||||||
function! ale_linters#php#phpstan#GetExecutable(buffer) abort
|
function! ale_linters#php#phpstan#GetExecutable(buffer) abort
|
||||||
return ale#Var(a:buffer, 'php_phpstan_executable')
|
return ale#Var(a:buffer, 'php_phpstan_executable')
|
||||||
@@ -12,10 +13,16 @@ endfunction
|
|||||||
function! ale_linters#php#phpstan#GetCommand(buffer) abort
|
function! ale_linters#php#phpstan#GetCommand(buffer) abort
|
||||||
let l:executable = ale_linters#php#phpstan#GetExecutable(a:buffer)
|
let l:executable = ale_linters#php#phpstan#GetExecutable(a:buffer)
|
||||||
|
|
||||||
|
let l:configuration = ale#Var(a:buffer, 'php_phpstan_configuration')
|
||||||
|
let l:configuration_option = !empty(l:configuration)
|
||||||
|
\ ? ' -c ' . l:configuration
|
||||||
|
\ : ''
|
||||||
|
|
||||||
return ale#Escape(l:executable)
|
return ale#Escape(l:executable)
|
||||||
\ . ' analyze -l'
|
\ . ' analyze -l'
|
||||||
\ . ale#Var(a:buffer, 'php_phpstan_level')
|
\ . ale#Var(a:buffer, 'php_phpstan_level')
|
||||||
\ . ' --errorFormat raw'
|
\ . ' --errorFormat raw'
|
||||||
|
\ . l:configuration_option
|
||||||
\ . ' %s'
|
\ . ' %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
" Author: Michel Lang <michellang@gmail.com>, w0rp <devw0rp@gmail.com>
|
" Author: Michel Lang <michellang@gmail.com>, w0rp <devw0rp@gmail.com>
|
||||||
" Description: This file adds support for checking R code with lintr.
|
" Description: This file adds support for checking R code with lintr.
|
||||||
|
|
||||||
|
let g:ale_r_lintr_options =
|
||||||
|
\ get(g:, 'ale_r_lintr_options', 'lintr::with_defaults()')
|
||||||
|
" A reasonable alternative default:
|
||||||
|
" \ get(g:, 'ale_r_lintr_options', 'lintr::with_defaults(object_usage_linter = NULL)')
|
||||||
|
|
||||||
function! ale_linters#r#lintr#GetCommand(buffer) abort
|
function! ale_linters#r#lintr#GetCommand(buffer) abort
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return ale#path#BufferCdString(a:buffer)
|
||||||
\ . 'Rscript -e ' . ale#Escape('lintr::lint(commandArgs(TRUE))') . ' %t'
|
\ . 'Rscript -e ' . ale#Escape('lintr::lint(commandArgs(TRUE)[1], eval(parse(text = commandArgs(TRUE)[2])))') . ' %t' . ' ' . ale#Escape(ale#Var(a:buffer, 'r_lintr_options'))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('r', {
|
call ale#linter#Define('r', {
|
||||||
|
|||||||
@@ -7,23 +7,19 @@ let g:ale_ruby_brakeman_options =
|
|||||||
function! ale_linters#ruby#brakeman#Handle(buffer, lines) abort
|
function! ale_linters#ruby#brakeman#Handle(buffer, lines) abort
|
||||||
let l:output = []
|
let l:output = []
|
||||||
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})
|
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})
|
||||||
|
let l:sep = has('win32') ? '\' : '/'
|
||||||
|
" Brakeman always outputs paths relative to the Rails app root
|
||||||
|
let l:rails_root = ale#ruby#FindRailsRoot(a:buffer)
|
||||||
|
|
||||||
for l:warning in get(l:json, 'warnings', [])
|
for l:warning in get(l:json, 'warnings', [])
|
||||||
" Brakeman always outputs paths relative to the Rails app root
|
|
||||||
let l:rails_root = ale#ruby#FindRailsRoot(a:buffer)
|
|
||||||
let l:warning_file = l:rails_root . '/' . l:warning.file
|
|
||||||
|
|
||||||
if !ale#path#IsBufferPath(a:buffer, l:warning_file)
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:text = l:warning.warning_type . ' ' . l:warning.message . ' (' . l:warning.confidence . ')'
|
let l:text = l:warning.warning_type . ' ' . l:warning.message . ' (' . l:warning.confidence . ')'
|
||||||
let l:line = l:warning.line != v:null ? l:warning.line : 1
|
let l:line = l:warning.line != v:null ? l:warning.line : 1
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': l:line,
|
\ 'filename': l:rails_root . l:sep . l:warning.file,
|
||||||
\ 'type': 'W',
|
\ 'lnum': l:line,
|
||||||
\ 'text': l:text,
|
\ 'type': 'W',
|
||||||
|
\ 'text': l:text,
|
||||||
\})
|
\})
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,21 @@ let g:ale_scalastyle_config_loc =
|
|||||||
\ get(g:, 'ale_scalastyle_config_loc', '')
|
\ get(g:, 'ale_scalastyle_config_loc', '')
|
||||||
|
|
||||||
function! ale_linters#scala#scalastyle#Handle(buffer, lines) abort
|
function! ale_linters#scala#scalastyle#Handle(buffer, lines) abort
|
||||||
|
" Look for help output from scalastyle first, which indicates that no
|
||||||
|
" configuration file was found.
|
||||||
|
for l:line in a:lines[:10]
|
||||||
|
if l:line =~# '-c, --config'
|
||||||
|
return [{
|
||||||
|
\ 'lnum': 1,
|
||||||
|
\ 'text': '(See :help ale-scala-scalastyle)'
|
||||||
|
\ . ' No scalastyle configuration file was found.',
|
||||||
|
\}]
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
" Matches patterns like the following:
|
" Matches patterns like the following:
|
||||||
"
|
"
|
||||||
" warning file=/home/blurble/Doop.scala message=Missing or badly formed ScalaDoc: Extra @param foobles line=190
|
" warning file=/home/blurble/Doop.scala message=Missing or badly formed ScalaDoc: Extra @param foobles line=190
|
||||||
|
|
||||||
let l:patterns = [
|
let l:patterns = [
|
||||||
\ '^\(.\+\) .\+ message=\(.\+\) line=\(\d\+\)$',
|
\ '^\(.\+\) .\+ message=\(.\+\) line=\(\d\+\)$',
|
||||||
\ '^\(.\+\) .\+ message=\(.\+\) line=\(\d\+\) column=\(\d\+\)$',
|
\ '^\(.\+\) .\+ message=\(.\+\) line=\(\d\+\) column=\(\d\+\)$',
|
||||||
|
|||||||
@@ -17,18 +17,10 @@ if !exists('g:ale_sh_shell_default_shell')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
function! ale_linters#sh#shell#GetExecutable(buffer) abort
|
function! ale_linters#sh#shell#GetExecutable(buffer) abort
|
||||||
let l:banglines = getbufline(a:buffer, 1)
|
let l:shell_type = ale#handlers#sh#GetShellType(a:buffer)
|
||||||
|
|
||||||
" Take the shell executable from the hashbang, if we can.
|
if !empty(l:shell_type)
|
||||||
if len(l:banglines) == 1 && l:banglines[0] =~# '^#!'
|
return l:shell_type
|
||||||
" Remove options like -e, etc.
|
|
||||||
let l:line = substitute(l:banglines[0], '--\?[a-zA-Z0-9]\+', '', 'g')
|
|
||||||
|
|
||||||
for l:possible_shell in ['bash', 'tcsh', 'csh', 'zsh', 'sh']
|
|
||||||
if l:line =~# l:possible_shell . '\s*$'
|
|
||||||
return l:possible_shell
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ale#Var(a:buffer, 'sh_shell_default_shell')
|
return ale#Var(a:buffer, 'sh_shell_default_shell')
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
" Description: This file adds support for using the shellcheck linter with
|
" Description: This file adds support for using the shellcheck linter with
|
||||||
" shell scripts.
|
" shell scripts.
|
||||||
|
|
||||||
" This global variable can be set with a string of comma-seperated error
|
" This global variable can be set with a string of comma-separated error
|
||||||
" codes to exclude from shellcheck. For example:
|
" codes to exclude from shellcheck. For example:
|
||||||
"
|
"
|
||||||
" let g:ale_sh_shellcheck_exclusions = 'SC2002,SC2004'
|
" let g:ale_sh_shellcheck_exclusions = 'SC2002,SC2004'
|
||||||
@@ -19,25 +19,35 @@ function! ale_linters#sh#shellcheck#GetExecutable(buffer) abort
|
|||||||
return ale#Var(a:buffer, 'sh_shellcheck_executable')
|
return ale#Var(a:buffer, 'sh_shellcheck_executable')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:GetDialectArgument() abort
|
function! ale_linters#sh#shellcheck#GetDialectArgument(buffer) abort
|
||||||
if exists('b:is_bash') && b:is_bash
|
let l:shell_type = ale#handlers#sh#GetShellType(a:buffer)
|
||||||
return '-s bash'
|
|
||||||
elseif exists('b:is_sh') && b:is_sh
|
if !empty(l:shell_type)
|
||||||
return '-s sh'
|
return l:shell_type
|
||||||
elseif exists('b:is_kornshell') && b:is_kornshell
|
endif
|
||||||
return '-s ksh'
|
|
||||||
|
" If there's no hashbang, try using Vim's buffer variables.
|
||||||
|
if get(b:, 'is_bash')
|
||||||
|
return 'bash'
|
||||||
|
elseif get(b:, 'is_sh')
|
||||||
|
return 'sh'
|
||||||
|
elseif get(b:, 'is_kornshell')
|
||||||
|
return 'ksh'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#sh#shellcheck#GetCommand(buffer) abort
|
function! ale_linters#sh#shellcheck#GetCommand(buffer) abort
|
||||||
|
let l:options = ale#Var(a:buffer, 'sh_shellcheck_options')
|
||||||
let l:exclude_option = ale#Var(a:buffer, 'sh_shellcheck_exclusions')
|
let l:exclude_option = ale#Var(a:buffer, 'sh_shellcheck_exclusions')
|
||||||
|
let l:dialect = ale_linters#sh#shellcheck#GetDialectArgument(a:buffer)
|
||||||
|
|
||||||
return ale_linters#sh#shellcheck#GetExecutable(a:buffer)
|
return ale_linters#sh#shellcheck#GetExecutable(a:buffer)
|
||||||
\ . ' ' . ale#Var(a:buffer, 'sh_shellcheck_options')
|
\ . (!empty(l:dialect) ? ' -s ' . l:dialect : '')
|
||||||
\ . ' ' . (!empty(l:exclude_option) ? '-e ' . l:exclude_option : '')
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
\ . ' ' . s:GetDialectArgument() . ' -f gcc -'
|
\ . (!empty(l:exclude_option) ? ' -e ' . l:exclude_option : '')
|
||||||
|
\ . ' -f gcc -'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('sh', {
|
call ale#linter#Define('sh', {
|
||||||
|
|||||||
@@ -1,5 +1,25 @@
|
|||||||
" Author: Markus Doits - https://github.com/doits
|
" Author: Markus Doits - https://github.com/doits
|
||||||
" Description: slim-lint for Slim files, based on hamllint.vim
|
" Description: slim-lint for Slim files
|
||||||
|
|
||||||
|
function! ale_linters#slim#slimlint#GetCommand(buffer) abort
|
||||||
|
let l:command = 'slim-lint %t'
|
||||||
|
|
||||||
|
let l:rubocop_config = ale#path#FindNearestFile(a:buffer, '.rubocop.yml')
|
||||||
|
|
||||||
|
" Set SLIM_LINT_RUBOCOP_CONF variable as it is needed for slim-lint to
|
||||||
|
" pick up the rubocop config.
|
||||||
|
"
|
||||||
|
" See https://github.com/sds/slim-lint/blob/master/lib/slim_lint/linter/README.md#rubocop
|
||||||
|
if !empty(l:rubocop_config)
|
||||||
|
if ale#Has('win32')
|
||||||
|
let l:command = 'set SLIM_LINT_RUBOCOP_CONF=' . ale#Escape(l:rubocop_config) . ' && ' . l:command
|
||||||
|
else
|
||||||
|
let l:command = 'SLIM_LINT_RUBOCOP_CONF=' . ale#Escape(l:rubocop_config) . ' ' . l:command
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return l:command
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#slim#slimlint#Handle(buffer, lines) abort
|
function! ale_linters#slim#slimlint#Handle(buffer, lines) abort
|
||||||
" Matches patterns like the following:
|
" Matches patterns like the following:
|
||||||
@@ -21,6 +41,6 @@ endfunction
|
|||||||
call ale#linter#Define('slim', {
|
call ale#linter#Define('slim', {
|
||||||
\ 'name': 'slimlint',
|
\ 'name': 'slimlint',
|
||||||
\ 'executable': 'slim-lint',
|
\ 'executable': 'slim-lint',
|
||||||
\ 'command': 'slim-lint %t',
|
\ 'command_callback': 'ale_linters#slim#slimlint#GetCommand',
|
||||||
\ 'callback': 'ale_linters#slim#slimlint#Handle'
|
\ 'callback': 'ale_linters#slim#slimlint#Handle'
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,47 +1,9 @@
|
|||||||
" Author: Paulo Alem <paulo.alem@gmail.com>
|
" Author: Paulo Alem <paulo.alem@gmail.com>, Jake Zimmerman <jake@zimmerman.io>
|
||||||
" Description: Rudimentary SML checking with smlnj compiler
|
" Description: Single-file SML checking with SML/NJ compiler
|
||||||
|
|
||||||
function! ale_linters#sml#smlnj#Handle(buffer, lines) abort
|
|
||||||
" Try to match basic sml errors
|
|
||||||
|
|
||||||
let l:out = []
|
|
||||||
let l:pattern = '^.*\:\([0-9\.]\+\)\ \(\w\+\)\:\ \(.*\)'
|
|
||||||
let l:pattern2 = '^.*\:\([0-9]\+\)\.\?\([0-9]\+\).* \(\(Warning\|Error\): .*\)'
|
|
||||||
|
|
||||||
for l:line in a:lines
|
|
||||||
let l:match2 = matchlist(l:line, l:pattern2)
|
|
||||||
|
|
||||||
if len(l:match2) != 0
|
|
||||||
call add(l:out, {
|
|
||||||
\ 'bufnr': a:buffer,
|
|
||||||
\ 'lnum': l:match2[1] + 0,
|
|
||||||
\ 'col' : l:match2[2] - 1,
|
|
||||||
\ 'text': l:match2[3],
|
|
||||||
\ 'type': l:match2[3] =~# '^Warning' ? 'W' : 'E',
|
|
||||||
\})
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:match = matchlist(l:line, l:pattern)
|
|
||||||
|
|
||||||
if len(l:match) != 0
|
|
||||||
call add(l:out, {
|
|
||||||
\ 'bufnr': a:buffer,
|
|
||||||
\ 'lnum': l:match[1] + 0,
|
|
||||||
\ 'text': l:match[2] . ': ' . l:match[3],
|
|
||||||
\ 'type': l:match[2] is# 'error' ? 'E' : 'W',
|
|
||||||
\})
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return l:out
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call ale#linter#Define('sml', {
|
call ale#linter#Define('sml', {
|
||||||
\ 'name': 'smlnj',
|
\ 'name': 'smlnj',
|
||||||
\ 'executable': 'sml',
|
\ 'executable_callback': 'ale#handlers#sml#GetExecutableSmlnjFile',
|
||||||
\ 'command': 'sml',
|
\ 'command': 'sml',
|
||||||
\ 'callback': 'ale_linters#sml#smlnj#Handle',
|
\ 'callback': 'ale#handlers#sml#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
19
ale_linters/sml/smlnj_cm.vim
Normal file
19
ale_linters/sml/smlnj_cm.vim
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
" Author: Jake Zimmerman <jake@zimmerman.io>
|
||||||
|
" Description: SML checking with SML/NJ Compilation Manager
|
||||||
|
|
||||||
|
function! ale_linters#sml#smlnj_cm#GetCommand(buffer) abort
|
||||||
|
let l:cmfile = ale#handlers#sml#GetCmFile(a:buffer)
|
||||||
|
return 'sml -m ' . l:cmfile . ' < /dev/null'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Using CM requires that we set "lint_file: 1", since it reads the files
|
||||||
|
" from the disk itself.
|
||||||
|
call ale#linter#Define('sml', {
|
||||||
|
\ 'name': 'smlnj-cm',
|
||||||
|
\ 'executable_callback': 'ale#handlers#sml#GetExecutableSmlnjCm',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\ 'command_callback': 'ale_linters#sml#smlnj_cm#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#sml#Handle',
|
||||||
|
\})
|
||||||
|
|
||||||
|
" vim:ts=4:sts=4:sw=4
|
||||||
9
ale_linters/solidity/solium.vim
Normal file
9
ale_linters/solidity/solium.vim
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
" Author: Jeff Sutherland - https://github.com/jdsutherland
|
||||||
|
" Description: Report errors in Solidity code with solium
|
||||||
|
|
||||||
|
call ale#linter#Define('solidity', {
|
||||||
|
\ 'name': 'solium',
|
||||||
|
\ 'executable': 'solium',
|
||||||
|
\ 'command': 'solium --reporter gcc --file %t',
|
||||||
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
|
\})
|
||||||
91
ale_linters/thrift/thrift.vim
Normal file
91
ale_linters/thrift/thrift.vim
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
" Author: Jon Parise <jon@indelible.org>
|
||||||
|
|
||||||
|
call ale#Set('thrift_thrift_executable', 'thrift')
|
||||||
|
call ale#Set('thrift_thrift_generators', ['cpp'])
|
||||||
|
call ale#Set('thrift_thrift_includes', [])
|
||||||
|
call ale#Set('thrift_thrift_options', '-strict')
|
||||||
|
|
||||||
|
function! ale_linters#thrift#thrift#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'thrift_thrift_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#thrift#thrift#GetCommand(buffer) abort
|
||||||
|
let l:generators = ale#Var(a:buffer, 'thrift_thrift_generators')
|
||||||
|
let l:includes = ale#Var(a:buffer, 'thrift_thrift_includes')
|
||||||
|
|
||||||
|
" The thrift compiler requires at least one generator. If none are set,
|
||||||
|
" fall back to our default value to avoid silently failing. We could also
|
||||||
|
" `throw` here, but that seems even less helpful.
|
||||||
|
if empty(l:generators)
|
||||||
|
let l:generators = ['cpp']
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:output_dir = tempname()
|
||||||
|
call mkdir(l:output_dir)
|
||||||
|
call ale#engine#ManageDirectory(a:buffer, l:output_dir)
|
||||||
|
|
||||||
|
return ale#Escape(ale_linters#thrift#thrift#GetExecutable(a:buffer))
|
||||||
|
\ . ' ' . join(map(copy(l:generators), "'--gen ' . v:val"))
|
||||||
|
\ . ' ' . join(map(copy(l:includes), "'-I ' . v:val"))
|
||||||
|
\ . ' ' . ale#Var(a:buffer, 'thrift_thrift_options')
|
||||||
|
\ . ' -out ' . ale#Escape(l:output_dir)
|
||||||
|
\ . ' %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#thrift#thrift#Handle(buffer, lines) abort
|
||||||
|
" Matches lines like the following:
|
||||||
|
"
|
||||||
|
" [SEVERITY:/path/filename.thrift:31] Message text
|
||||||
|
" [ERROR:/path/filename.thrift:31] (last token was ';')
|
||||||
|
let l:pattern = '\v^\[(\u+):(.*):(\d+)\] (.*)$'
|
||||||
|
|
||||||
|
let l:index = 0
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
" Roll our own output-matching loop instead of using ale#util#GetMatches
|
||||||
|
" because we need to support error messages that span multiple lines.
|
||||||
|
while l:index < len(a:lines)
|
||||||
|
let l:line = a:lines[l:index]
|
||||||
|
|
||||||
|
let l:match = matchlist(l:line, l:pattern)
|
||||||
|
if empty(l:match)
|
||||||
|
let l:index += 1
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:severity = l:match[1]
|
||||||
|
if l:severity is# 'WARNING'
|
||||||
|
let l:type = 'W'
|
||||||
|
else
|
||||||
|
let l:type = 'E'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If our text looks like "(last token was ';')", the *next* line
|
||||||
|
" should contain a more descriptive error message.
|
||||||
|
let l:text = l:match[4]
|
||||||
|
if l:text =~# '\(last token was .*\)'
|
||||||
|
let l:index += 1
|
||||||
|
let l:text = get(a:lines, l:index, 'Unknown error ' . l:text)
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:match[3] + 0,
|
||||||
|
\ 'col': 0,
|
||||||
|
\ 'type': l:type,
|
||||||
|
\ 'text': l:text,
|
||||||
|
\})
|
||||||
|
|
||||||
|
let l:index += 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('thrift', {
|
||||||
|
\ 'name': 'thrift',
|
||||||
|
\ 'executable': 'thrift',
|
||||||
|
\ 'output_stream': 'both',
|
||||||
|
\ 'executable_callback': 'ale_linters#thrift#thrift#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#thrift#thrift#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#thrift#thrift#Handle',
|
||||||
|
\})
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
" Author: Prashanth Chandra https://github.com/prashcr
|
" Author: Prashanth Chandra <https://github.com/prashcr>, Jonathan Clem <https://jclem.net>
|
||||||
" Description: tslint for TypeScript files
|
" Description: tslint for TypeScript files
|
||||||
|
|
||||||
call ale#Set('typescript_tslint_executable', 'tslint')
|
call ale#Set('typescript_tslint_executable', 'tslint')
|
||||||
call ale#Set('typescript_tslint_config_path', '')
|
call ale#Set('typescript_tslint_config_path', '')
|
||||||
|
call ale#Set('typescript_tslint_rules_dir', '')
|
||||||
call ale#Set('typescript_tslint_use_global', 0)
|
call ale#Set('typescript_tslint_use_global', 0)
|
||||||
|
call ale#Set('typescript_tslint_ignore_empty_files', 0)
|
||||||
|
|
||||||
function! ale_linters#typescript#tslint#GetExecutable(buffer) abort
|
function! ale_linters#typescript#tslint#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'typescript_tslint', [
|
return ale#node#FindExecutable(a:buffer, 'typescript_tslint', [
|
||||||
@@ -12,6 +14,12 @@ function! ale_linters#typescript#tslint#GetExecutable(buffer) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#typescript#tslint#Handle(buffer, lines) abort
|
function! ale_linters#typescript#tslint#Handle(buffer, lines) abort
|
||||||
|
" Do not output any errors for empty files if the option is on.
|
||||||
|
if ale#Var(a:buffer, 'typescript_tslint_ignore_empty_files')
|
||||||
|
\&& getbufline(a:buffer, 1, '$') == ['']
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
|
||||||
let l:dir = expand('#' . a:buffer . ':p:h')
|
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
@@ -38,15 +46,20 @@ function! ale_linters#typescript#tslint#GetCommand(buffer) abort
|
|||||||
\ 'tslint.json',
|
\ 'tslint.json',
|
||||||
\ ale#Var(a:buffer, 'typescript_tslint_config_path')
|
\ ale#Var(a:buffer, 'typescript_tslint_config_path')
|
||||||
\)
|
\)
|
||||||
|
|
||||||
let l:tslint_config_option = !empty(l:tslint_config_path)
|
let l:tslint_config_option = !empty(l:tslint_config_path)
|
||||||
\ ? ' -c ' . ale#Escape(l:tslint_config_path)
|
\ ? ' -c ' . ale#Escape(l:tslint_config_path)
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
|
let l:tslint_rules_dir = ale#Var(a:buffer, 'typescript_tslint_rules_dir')
|
||||||
|
let l:tslint_rules_option = !empty(l:tslint_rules_dir)
|
||||||
|
\ ? ' -r ' . ale#Escape(l:tslint_rules_dir)
|
||||||
|
\ : ''
|
||||||
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return ale#path#BufferCdString(a:buffer)
|
||||||
\ . ale_linters#typescript#tslint#GetExecutable(a:buffer)
|
\ . ale_linters#typescript#tslint#GetExecutable(a:buffer)
|
||||||
\ . ' --format json'
|
\ . ' --format json'
|
||||||
\ . l:tslint_config_option
|
\ . l:tslint_config_option
|
||||||
|
\ . l:tslint_rules_option
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -38,16 +38,51 @@ function! ale#FileTooLarge() abort
|
|||||||
return l:max > 0 ? (line2byte(line('$') + 1) > l:max) : 0
|
return l:max > 0 ? (line2byte(line('$') + 1) > l:max) : 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
let s:getcmdwintype_exists = exists('*getcmdwintype')
|
||||||
|
|
||||||
" A function for checking various conditions whereby ALE just shouldn't
|
" A function for checking various conditions whereby ALE just shouldn't
|
||||||
" attempt to do anything, say if particular buffer types are open in Vim.
|
" attempt to do anything, say if particular buffer types are open in Vim.
|
||||||
function! ale#ShouldDoNothing(buffer) abort
|
function! ale#ShouldDoNothing(buffer) abort
|
||||||
|
" The checks are split into separate if statements to make it possible to
|
||||||
|
" profile each check individually with Vim's profiling tools.
|
||||||
|
|
||||||
|
" Don't perform any checks when newer NeoVim versions are exiting.
|
||||||
|
if get(v:, 'exiting', v:null) isnot v:null
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
" Do nothing for blacklisted files
|
" Do nothing for blacklisted files
|
||||||
" OR if ALE is running in the sandbox
|
if index(g:ale_filetype_blacklist, getbufvar(a:buffer, '&filetype')) >= 0
|
||||||
return index(g:ale_filetype_blacklist, &filetype) >= 0
|
return 1
|
||||||
\ || (exists('*getcmdwintype') && !empty(getcmdwintype()))
|
endif
|
||||||
\ || ale#util#InSandbox()
|
|
||||||
\ || !ale#Var(a:buffer, 'enabled')
|
" Do nothing if running from command mode
|
||||||
\ || ale#FileTooLarge()
|
if s:getcmdwintype_exists && !empty(getcmdwintype())
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Do nothing if running in the sandbox
|
||||||
|
if ale#util#InSandbox()
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Do nothing if ALE is disabled.
|
||||||
|
if !ale#Var(a:buffer, 'enabled')
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Do nothing if the file is too large.
|
||||||
|
if ale#FileTooLarge()
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Do nothing from CtrlP buffers with CtrlP-funky.
|
||||||
|
if exists(':CtrlPFunky') is 2
|
||||||
|
\&& getbufvar(a:buffer, '&l:statusline') =~# 'CtrlPMode.*funky'
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
return 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" (delay, [linting_flag, buffer_number])
|
" (delay, [linting_flag, buffer_number])
|
||||||
@@ -83,7 +118,7 @@ function! s:ALEQueueImpl(delay, linting_flag, buffer) abort
|
|||||||
" Remember that we want to check files for this buffer.
|
" Remember that we want to check files for this buffer.
|
||||||
" We will remember this until we finally run the linters, via any event.
|
" We will remember this until we finally run the linters, via any event.
|
||||||
if a:linting_flag is# 'lint_file'
|
if a:linting_flag is# 'lint_file'
|
||||||
let s:should_lint_file_for_buffer[bufnr('%')] = 1
|
let s:should_lint_file_for_buffer[a:buffer] = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if s:lint_timer != -1
|
if s:lint_timer != -1
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ function! ale#command#FormatCommand(buffer, command, pipe_file_if_needed) abort
|
|||||||
" with an ugly string.
|
" with an ugly string.
|
||||||
let l:command = substitute(l:command, '%%', '<<PERCENTS>>', 'g')
|
let l:command = substitute(l:command, '%%', '<<PERCENTS>>', 'g')
|
||||||
|
|
||||||
" Replace all %s occurences in the string with the name of the current
|
" Replace all %s occurrences in the string with the name of the current
|
||||||
" file.
|
" file.
|
||||||
if l:command =~# '%s'
|
if l:command =~# '%s'
|
||||||
let l:filename = fnamemodify(bufname(a:buffer), ':p')
|
let l:filename = fnamemodify(bufname(a:buffer), ':p')
|
||||||
|
|||||||
@@ -3,15 +3,6 @@
|
|||||||
|
|
||||||
let s:cursor_timer = -1
|
let s:cursor_timer = -1
|
||||||
let s:last_pos = [0, 0, 0]
|
let s:last_pos = [0, 0, 0]
|
||||||
let s:error_delay_ms = 1000 * 60 * 2
|
|
||||||
|
|
||||||
if !exists('s:dont_queue_until')
|
|
||||||
let s:dont_queue_until = -1
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('s:dont_echo_until')
|
|
||||||
let s:dont_echo_until = -1
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Return a formatted message according to g:ale_echo_msg_format variable
|
" Return a formatted message according to g:ale_echo_msg_format variable
|
||||||
function! s:GetMessage(linter, type, text) abort
|
function! s:GetMessage(linter, type, text) abort
|
||||||
@@ -84,12 +75,12 @@ function! ale#cursor#EchoCursorWarning(...) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:EchoImpl() abort
|
function! s:EchoImpl() abort
|
||||||
if ale#ShouldDoNothing(bufnr(''))
|
" Only echo the warnings in normal mode, otherwise we will get problems.
|
||||||
|
if mode() isnot# 'n'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Only echo the warnings in normal mode, otherwise we will get problems.
|
if ale#ShouldDoNothing(bufnr(''))
|
||||||
if mode() isnot# 'n'
|
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -108,15 +99,8 @@ function! s:EchoImpl() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#cursor#EchoCursorWarningWithDelay() abort
|
function! ale#cursor#EchoCursorWarningWithDelay() abort
|
||||||
return ale#CallWithCooldown(
|
" Only echo the warnings in normal mode, otherwise we will get problems.
|
||||||
\ 'dont_echo_with_delay_until',
|
if mode() isnot# 'n'
|
||||||
\ function('s:EchoWithDelayImpl'),
|
|
||||||
\ [],
|
|
||||||
\)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:EchoWithDelayImpl() abort
|
|
||||||
if ale#ShouldDoNothing(bufnr(''))
|
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -129,18 +113,23 @@ function! s:EchoWithDelayImpl() abort
|
|||||||
" we should echo something. Otherwise we can end up doing processing
|
" we should echo something. Otherwise we can end up doing processing
|
||||||
" the echo message far too frequently.
|
" the echo message far too frequently.
|
||||||
if l:pos != s:last_pos
|
if l:pos != s:last_pos
|
||||||
|
let l:delay = ale#Var(bufnr(''), 'echo_delay')
|
||||||
|
|
||||||
let s:last_pos = l:pos
|
let s:last_pos = l:pos
|
||||||
let s:cursor_timer = timer_start(10, function('ale#cursor#EchoCursorWarning'))
|
let s:cursor_timer = timer_start(
|
||||||
|
\ l:delay,
|
||||||
|
\ function('ale#cursor#EchoCursorWarning')
|
||||||
|
\)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#cursor#ShowCursorDetail() abort
|
function! ale#cursor#ShowCursorDetail() abort
|
||||||
if ale#ShouldDoNothing(bufnr(''))
|
" Only echo the warnings in normal mode, otherwise we will get problems.
|
||||||
|
if mode() isnot# 'n'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Only echo the warnings in normal mode, otherwise we will get problems.
|
if ale#ShouldDoNothing(bufnr(''))
|
||||||
if mode() isnot# 'n'
|
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -286,10 +286,6 @@ function! ale#engine#SetResults(buffer, loclist) abort
|
|||||||
|
|
||||||
if g:ale_set_quickfix || g:ale_set_loclist
|
if g:ale_set_quickfix || g:ale_set_loclist
|
||||||
call ale#list#SetLists(a:buffer, a:loclist)
|
call ale#list#SetLists(a:buffer, a:loclist)
|
||||||
|
|
||||||
if l:linting_is_done
|
|
||||||
call ale#list#CloseWindowIfNeeded(a:buffer)
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists('*ale#statusline#Update')
|
if exists('*ale#statusline#Update')
|
||||||
@@ -379,7 +375,7 @@ function! ale#engine#FixLocList(buffer, linter_name, loclist) abort
|
|||||||
\}
|
\}
|
||||||
|
|
||||||
if has_key(l:old_item, 'filename')
|
if has_key(l:old_item, 'filename')
|
||||||
\&& l:old_item.filename[:len(s:temp_dir) - 1] isnot# s:temp_dir
|
\&& !ale#path#IsTempName(l:old_item.filename)
|
||||||
" Use the filename given.
|
" Use the filename given.
|
||||||
" Temporary files are assumed to be for this buffer,
|
" Temporary files are assumed to be for this buffer,
|
||||||
" and the filename is not included then, because it looks bad
|
" and the filename is not included then, because it looks bad
|
||||||
@@ -577,7 +573,7 @@ function! ale#engine#ProcessChain(buffer, linter, chain_index, input) abort
|
|||||||
|
|
||||||
if has_key(a:linter, 'command_chain')
|
if has_key(a:linter, 'command_chain')
|
||||||
while l:chain_index < len(a:linter.command_chain)
|
while l:chain_index < len(a:linter.command_chain)
|
||||||
" Run a chain of commands, one asychronous command after the other,
|
" Run a chain of commands, one asynchronous command after the other,
|
||||||
" so that many programs can be run in a sequence.
|
" so that many programs can be run in a sequence.
|
||||||
let l:chain_item = a:linter.command_chain[l:chain_index]
|
let l:chain_item = a:linter.command_chain[l:chain_index]
|
||||||
|
|
||||||
@@ -805,6 +801,11 @@ endfunction
|
|||||||
" clear the state of everything, and remove the Dictionary for managing
|
" clear the state of everything, and remove the Dictionary for managing
|
||||||
" the buffer.
|
" the buffer.
|
||||||
function! ale#engine#Cleanup(buffer) abort
|
function! ale#engine#Cleanup(buffer) abort
|
||||||
|
" Don't bother with cleanup code when newer NeoVim versions are exiting.
|
||||||
|
if get(v:, 'exiting', v:null) isnot v:null
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
if !has_key(g:ale_buffer_info, a:buffer)
|
if !has_key(g:ale_buffer_info, a:buffer)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
@@ -840,7 +841,7 @@ function! ale#engine#WaitForJobs(deadline) abort
|
|||||||
|
|
||||||
" Gather all of the jobs from every buffer.
|
" Gather all of the jobs from every buffer.
|
||||||
for l:info in values(g:ale_buffer_info)
|
for l:info in values(g:ale_buffer_info)
|
||||||
call extend(l:job_list, l:info.job_list)
|
call extend(l:job_list, get(l:info, 'job_list', []))
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
" NeoVim has a built-in API for this, so use that.
|
" NeoVim has a built-in API for this, so use that.
|
||||||
@@ -888,7 +889,7 @@ function! ale#engine#WaitForJobs(deadline) abort
|
|||||||
|
|
||||||
" Check again to see if any jobs are running.
|
" Check again to see if any jobs are running.
|
||||||
for l:info in values(g:ale_buffer_info)
|
for l:info in values(g:ale_buffer_info)
|
||||||
for l:job_id in l:info.job_list
|
for l:job_id in get(l:info, 'job_list', [])
|
||||||
if ale#job#IsRunning(l:job_id)
|
if ale#job#IsRunning(l:job_id)
|
||||||
let l:has_new_jobs = 1
|
let l:has_new_jobs = 1
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -1,15 +1,27 @@
|
|||||||
" Author: w0rp <devw0rp@gmail.com>
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
|
|
||||||
|
function! ale#events#QuitEvent(buffer) abort
|
||||||
|
" Remember when ALE is quitting for BufWrite, etc.
|
||||||
|
call setbufvar(a:buffer, 'ale_quitting', ale#util#ClockMilliseconds())
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale#events#QuitRecently(buffer) abort
|
||||||
|
let l:time = getbufvar(a:buffer, 'ale_quitting', 0)
|
||||||
|
|
||||||
|
return l:time && ale#util#ClockMilliseconds() - l:time < 1000
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale#events#SaveEvent(buffer) abort
|
function! ale#events#SaveEvent(buffer) abort
|
||||||
call setbufvar(a:buffer, 'ale_save_event_fired', 1)
|
call setbufvar(a:buffer, 'ale_save_event_fired', 1)
|
||||||
let l:should_lint = ale#Var(a:buffer, 'enabled') && g:ale_lint_on_save
|
let l:should_lint = ale#Var(a:buffer, 'enabled')
|
||||||
|
\ && g:ale_lint_on_save
|
||||||
|
|
||||||
if g:ale_fix_on_save
|
if g:ale_fix_on_save
|
||||||
let l:will_fix = ale#fix#Fix('save_file')
|
let l:will_fix = ale#fix#Fix('save_file')
|
||||||
let l:should_lint = l:should_lint && !l:will_fix
|
let l:should_lint = l:should_lint && !l:will_fix
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if l:should_lint
|
if l:should_lint && !ale#events#QuitRecently(a:buffer)
|
||||||
call ale#Queue(0, 'lint_file', a:buffer)
|
call ale#Queue(0, 'lint_file', a:buffer)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
@@ -24,6 +36,8 @@ function! s:LintOnEnter(buffer) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#events#EnterEvent(buffer) abort
|
function! ale#events#EnterEvent(buffer) abort
|
||||||
|
" When entering a buffer, we are no longer quitting it.
|
||||||
|
call setbufvar(a:buffer, 'ale_quitting', 0)
|
||||||
let l:filetype = getbufvar(a:buffer, '&filetype')
|
let l:filetype = getbufvar(a:buffer, '&filetype')
|
||||||
call setbufvar(a:buffer, 'ale_original_filetype', l:filetype)
|
call setbufvar(a:buffer, 'ale_original_filetype', l:filetype)
|
||||||
|
|
||||||
@@ -33,7 +47,13 @@ endfunction
|
|||||||
function! ale#events#FileTypeEvent(buffer, new_filetype) abort
|
function! ale#events#FileTypeEvent(buffer, new_filetype) abort
|
||||||
let l:filetype = getbufvar(a:buffer, 'ale_original_filetype', '')
|
let l:filetype = getbufvar(a:buffer, 'ale_original_filetype', '')
|
||||||
|
|
||||||
if a:new_filetype isnot# l:filetype
|
" If we're setting the filetype for the first time after it was blank,
|
||||||
|
" and the option for linting on enter is off, then we should set this
|
||||||
|
" filetype as the original filetype. Otherwise ALE will still appear to
|
||||||
|
" lint files because of the BufEnter event, etc.
|
||||||
|
if empty(l:filetype) && !ale#Var(a:buffer, 'lint_on_enter')
|
||||||
|
call setbufvar(a:buffer, 'ale_original_filetype', a:new_filetype)
|
||||||
|
elseif a:new_filetype isnot# l:filetype
|
||||||
call ale#Queue(300, 'lint_file', a:buffer)
|
call ale#Queue(300, 'lint_file', a:buffer)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -56,7 +56,9 @@ function! ale#fix#ApplyQueuedFixes() abort
|
|||||||
|
|
||||||
" If ALE linting is enabled, check for problems with the file again after
|
" If ALE linting is enabled, check for problems with the file again after
|
||||||
" fixing problems.
|
" fixing problems.
|
||||||
if g:ale_enabled && l:should_lint
|
if g:ale_enabled
|
||||||
|
\&& l:should_lint
|
||||||
|
\&& !ale#events#QuitRecently(l:buffer)
|
||||||
call ale#Queue(0, l:data.should_save ? 'lint_file' : '')
|
call ale#Queue(0, l:data.should_save ? 'lint_file' : '')
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
@@ -96,6 +98,11 @@ function! s:HandleExit(job_id, exit_code) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let l:job_info = remove(s:job_info_map, a:job_id)
|
let l:job_info = remove(s:job_info_map, a:job_id)
|
||||||
|
let l:buffer = l:job_info.buffer
|
||||||
|
|
||||||
|
if g:ale_history_enabled
|
||||||
|
call ale#history#SetExitCode(l:buffer, a:job_id, a:exit_code)
|
||||||
|
endif
|
||||||
|
|
||||||
if has_key(l:job_info, 'file_to_read')
|
if has_key(l:job_info, 'file_to_read')
|
||||||
let l:job_info.output = readfile(l:job_info.file_to_read)
|
let l:job_info.output = readfile(l:job_info.file_to_read)
|
||||||
@@ -108,7 +115,7 @@ function! s:HandleExit(job_id, exit_code) abort
|
|||||||
\ : l:job_info.input
|
\ : l:job_info.input
|
||||||
|
|
||||||
call s:RunFixer({
|
call s:RunFixer({
|
||||||
\ 'buffer': l:job_info.buffer,
|
\ 'buffer': l:buffer,
|
||||||
\ 'input': l:input,
|
\ 'input': l:input,
|
||||||
\ 'callback_list': l:job_info.callback_list,
|
\ 'callback_list': l:job_info.callback_list,
|
||||||
\ 'callback_index': l:job_info.callback_index + 1,
|
\ 'callback_index': l:job_info.callback_index + 1,
|
||||||
@@ -209,6 +216,12 @@ function! s:RunJob(options) abort
|
|||||||
let l:job_id = ale#job#Start(l:command, l:job_options)
|
let l:job_id = ale#job#Start(l:command, l:job_options)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let l:status = l:job_id ? 'started' : 'failed'
|
||||||
|
|
||||||
|
if g:ale_history_enabled
|
||||||
|
call ale#history#Add(l:buffer, l:status, l:job_id, l:command)
|
||||||
|
endif
|
||||||
|
|
||||||
if l:job_id == 0
|
if l:job_id == 0
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -27,6 +27,11 @@ let s:default_registry = {
|
|||||||
\ 'suggested_filetypes': ['javascript', 'typescript'],
|
\ 'suggested_filetypes': ['javascript', 'typescript'],
|
||||||
\ 'description': 'Apply eslint --fix to a file.',
|
\ 'description': 'Apply eslint --fix to a file.',
|
||||||
\ },
|
\ },
|
||||||
|
\ 'format': {
|
||||||
|
\ 'function': 'ale#fixers#format#Fix',
|
||||||
|
\ 'suggested_filetypes': ['elm'],
|
||||||
|
\ 'description': 'Apply elm-format to a file.',
|
||||||
|
\ },
|
||||||
\ 'isort': {
|
\ 'isort': {
|
||||||
\ 'function': 'ale#fixers#isort#Fix',
|
\ 'function': 'ale#fixers#isort#Fix',
|
||||||
\ 'suggested_filetypes': ['python'],
|
\ 'suggested_filetypes': ['python'],
|
||||||
@@ -34,7 +39,7 @@ let s:default_registry = {
|
|||||||
\ },
|
\ },
|
||||||
\ 'prettier': {
|
\ 'prettier': {
|
||||||
\ 'function': 'ale#fixers#prettier#Fix',
|
\ 'function': 'ale#fixers#prettier#Fix',
|
||||||
\ 'suggested_filetypes': ['javascript'],
|
\ 'suggested_filetypes': ['javascript', 'typescript', 'json', 'css', 'scss', 'less'],
|
||||||
\ 'description': 'Apply prettier to a file.',
|
\ 'description': 'Apply prettier to a file.',
|
||||||
\ },
|
\ },
|
||||||
\ 'prettier_eslint': {
|
\ 'prettier_eslint': {
|
||||||
@@ -52,6 +57,11 @@ let s:default_registry = {
|
|||||||
\ 'suggested_filetypes': [],
|
\ 'suggested_filetypes': [],
|
||||||
\ 'description': 'Remove all blank lines at the end of a file.',
|
\ 'description': 'Remove all blank lines at the end of a file.',
|
||||||
\ },
|
\ },
|
||||||
|
\ 'trim_whitespace': {
|
||||||
|
\ 'function': 'ale#fixers#generic#TrimWhitespace',
|
||||||
|
\ 'suggested_filetypes': [],
|
||||||
|
\ 'description': 'Remove all trailing whitespace characters at the end of every line.',
|
||||||
|
\ },
|
||||||
\ 'yapf': {
|
\ 'yapf': {
|
||||||
\ 'function': 'ale#fixers#yapf#Fix',
|
\ 'function': 'ale#fixers#yapf#Fix',
|
||||||
\ 'suggested_filetypes': ['python'],
|
\ 'suggested_filetypes': ['python'],
|
||||||
@@ -87,6 +97,16 @@ let s:default_registry = {
|
|||||||
\ 'suggested_filetypes': ['c', 'cpp'],
|
\ 'suggested_filetypes': ['c', 'cpp'],
|
||||||
\ 'description': 'Fix C/C++ files with clang-format.',
|
\ 'description': 'Fix C/C++ files with clang-format.',
|
||||||
\ },
|
\ },
|
||||||
|
\ 'gofmt': {
|
||||||
|
\ 'function': 'ale#fixers#gofmt#Fix',
|
||||||
|
\ 'suggested_filetypes': ['go'],
|
||||||
|
\ 'description': 'Fix Go files with go fmt.',
|
||||||
|
\ },
|
||||||
|
\ 'tslint': {
|
||||||
|
\ 'function': 'ale#fixers#tslint#Fix',
|
||||||
|
\ 'suggested_filetypes': ['typescript'],
|
||||||
|
\ 'description': 'Fix typescript files with tslint --fix.',
|
||||||
|
\ },
|
||||||
\}
|
\}
|
||||||
|
|
||||||
" Reset the function registry to the default entries.
|
" Reset the function registry to the default entries.
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ function! ale#fixers#autopep8#Fix(buffer) abort
|
|||||||
\ ['autopep8'],
|
\ ['autopep8'],
|
||||||
\)
|
\)
|
||||||
|
|
||||||
if !executable(l:executable)
|
if !ale#python#IsExecutable(l:executable)
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
scriptencoding utf-8
|
||||||
" Author: Peter Renström <renstrom.peter@gmail.com>
|
" Author: Peter Renström <renstrom.peter@gmail.com>
|
||||||
" Description: Fixing C/C++ files with clang-format.
|
" Description: Fixing C/C++ files with clang-format.
|
||||||
|
|
||||||
|
|||||||
@@ -1,44 +1,17 @@
|
|||||||
" Author: w0rp <devw0rp@gmail.com>
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
" Description: Fixing files with eslint.
|
" Description: Fixing files with eslint.
|
||||||
|
|
||||||
function! s:FindConfig(buffer) abort
|
|
||||||
for l:filename in [
|
|
||||||
\ '.eslintrc.js',
|
|
||||||
\ '.eslintrc.yaml',
|
|
||||||
\ '.eslintrc.yml',
|
|
||||||
\ '.eslintrc.json',
|
|
||||||
\ '.eslintrc',
|
|
||||||
\ 'package.json',
|
|
||||||
\]
|
|
||||||
let l:config = ale#path#FindNearestFile(a:buffer, l:filename)
|
|
||||||
|
|
||||||
if !empty(l:config)
|
|
||||||
return l:config
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale#fixers#eslint#Fix(buffer) abort
|
function! ale#fixers#eslint#Fix(buffer) abort
|
||||||
let l:executable = ale#handlers#eslint#GetExecutable(a:buffer)
|
let l:executable = ale#handlers#eslint#GetExecutable(a:buffer)
|
||||||
let l:config = s:FindConfig(a:buffer)
|
let l:config = ale#handlers#eslint#FindConfig(a:buffer)
|
||||||
|
|
||||||
if empty(l:config)
|
if empty(l:config)
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ale#Has('win32') && l:executable =~? 'eslint\.js$'
|
|
||||||
" For Windows, if we detect an eslint.js script, we need to execute
|
|
||||||
" it with node, or the file can be opened with a text editor.
|
|
||||||
let l:head = 'node ' . ale#Escape(l:executable)
|
|
||||||
else
|
|
||||||
let l:head = ale#Escape(l:executable)
|
|
||||||
endif
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
\ 'command': l:head
|
\ 'command': ale#node#Executable(a:buffer, l:executable)
|
||||||
\ . ' --config ' . ale#Escape(l:config)
|
\ . ' -c ' . ale#Escape(l:config)
|
||||||
\ . ' --fix %t',
|
\ . ' --fix %t',
|
||||||
\ 'read_temporary_file': 1,
|
\ 'read_temporary_file': 1,
|
||||||
\}
|
\}
|
||||||
|
|||||||
23
autoload/ale/fixers/format.vim
Normal file
23
autoload/ale/fixers/format.vim
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
" Author: soywod <clement.douin@gmail.com>
|
||||||
|
" Description: Integration of elm-format with ALE.
|
||||||
|
|
||||||
|
call ale#Set('elm_format_executable', 'elm-format')
|
||||||
|
call ale#Set('elm_format_use_global', 0)
|
||||||
|
call ale#Set('elm_format_options', '--yes')
|
||||||
|
|
||||||
|
function! ale#fixers#format#GetExecutable(buffer) abort
|
||||||
|
return ale#node#FindExecutable(a:buffer, 'elm_format', [
|
||||||
|
\ 'node_modules/.bin/elm-format',
|
||||||
|
\])
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale#fixers#format#Fix(buffer) abort
|
||||||
|
let l:options = ale#Var(a:buffer, 'elm_format_options')
|
||||||
|
|
||||||
|
return {
|
||||||
|
\ 'command': ale#Escape(ale#fixers#format#GetExecutable(a:buffer))
|
||||||
|
\ . ' %t'
|
||||||
|
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||||
|
\ 'read_temporary_file': 1,
|
||||||
|
\}
|
||||||
|
endfunction
|
||||||
@@ -10,3 +10,16 @@ function! ale#fixers#generic#RemoveTrailingBlankLines(buffer, lines) abort
|
|||||||
|
|
||||||
return a:lines[:l:end_index]
|
return a:lines[:l:end_index]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Remove all whitespaces at the end of lines
|
||||||
|
function! ale#fixers#generic#TrimWhitespace(buffer, lines) abort
|
||||||
|
let l:index = 0
|
||||||
|
let l:lines_new = range(len(a:lines))
|
||||||
|
|
||||||
|
for l:line in a:lines
|
||||||
|
let l:lines_new[l:index] = substitute(l:line, '\s\+$', '', 'g')
|
||||||
|
let l:index = l:index + 1
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:lines_new
|
||||||
|
endfunction
|
||||||
|
|||||||
18
autoload/ale/fixers/gofmt.vim
Normal file
18
autoload/ale/fixers/gofmt.vim
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
" Author: aliou <code@aliou.me>
|
||||||
|
" Description: Integration of gofmt with ALE.
|
||||||
|
|
||||||
|
call ale#Set('go_gofmt_executable', 'gofmt')
|
||||||
|
call ale#Set('go_gofmt_options', '')
|
||||||
|
|
||||||
|
function! ale#fixers#gofmt#Fix(buffer) abort
|
||||||
|
let l:executable = ale#Var(a:buffer, 'go_gofmt_executable')
|
||||||
|
let l:options = ale#Var(a:buffer, 'go_gofmt_options')
|
||||||
|
|
||||||
|
return {
|
||||||
|
\ 'command': ale#Escape(l:executable)
|
||||||
|
\ . ' -l -w'
|
||||||
|
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||||
|
\ . ' %t',
|
||||||
|
\ 'read_temporary_file': 1,
|
||||||
|
\}
|
||||||
|
endfunction
|
||||||
@@ -11,7 +11,7 @@ function! ale#fixers#isort#Fix(buffer) abort
|
|||||||
\ ['isort'],
|
\ ['isort'],
|
||||||
\)
|
\)
|
||||||
|
|
||||||
if !executable(l:executable)
|
if !ale#python#IsExecutable(l:executable)
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,37 @@
|
|||||||
" Author: tunnckoCore (Charlike Mike Reagent) <mameto2011@gmail.com>,
|
" Author: tunnckoCore (Charlike Mike Reagent) <mameto2011@gmail.com>,
|
||||||
" w0rp <devw0rp@gmail.com>
|
" w0rp <devw0rp@gmail.com>, morhetz (Pavel Pertsev) <morhetz@gmail.com>
|
||||||
" Description: Integration of Prettier with ALE.
|
" Description: Integration of Prettier with ALE.
|
||||||
|
|
||||||
call ale#Set('javascript_prettier_executable', 'prettier')
|
call ale#Set('javascript_prettier_executable', 'prettier')
|
||||||
call ale#Set('javascript_prettier_use_global', 0)
|
call ale#Set('javascript_prettier_use_global', 0)
|
||||||
|
call ale#Set('javascript_prettier_use_local_config', 0)
|
||||||
call ale#Set('javascript_prettier_options', '')
|
call ale#Set('javascript_prettier_options', '')
|
||||||
|
|
||||||
|
function! s:FindConfig(buffer) abort
|
||||||
|
for l:filename in [
|
||||||
|
\ '.prettierrc',
|
||||||
|
\ '.prettierrc.json',
|
||||||
|
\ '.prettierrc.yaml',
|
||||||
|
\ '.prettierrc.yml',
|
||||||
|
\ '.prettierrc.js',
|
||||||
|
\ 'prettier.config.js',
|
||||||
|
\ 'package.json',
|
||||||
|
\ ]
|
||||||
|
|
||||||
|
let l:config = ale#path#FindNearestFile(a:buffer, l:filename)
|
||||||
|
|
||||||
|
if !empty(l:config)
|
||||||
|
return l:config
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! ale#fixers#prettier#GetExecutable(buffer) abort
|
function! ale#fixers#prettier#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'javascript_prettier', [
|
return ale#node#FindExecutable(a:buffer, 'javascript_prettier', [
|
||||||
|
\ 'node_modules/.bin/prettier_d',
|
||||||
\ 'node_modules/prettier-cli/index.js',
|
\ 'node_modules/prettier-cli/index.js',
|
||||||
\ 'node_modules/.bin/prettier',
|
\ 'node_modules/.bin/prettier',
|
||||||
\])
|
\])
|
||||||
@@ -15,11 +39,31 @@ endfunction
|
|||||||
|
|
||||||
function! ale#fixers#prettier#Fix(buffer) abort
|
function! ale#fixers#prettier#Fix(buffer) abort
|
||||||
let l:options = ale#Var(a:buffer, 'javascript_prettier_options')
|
let l:options = ale#Var(a:buffer, 'javascript_prettier_options')
|
||||||
|
let l:config = s:FindConfig(a:buffer)
|
||||||
|
let l:use_config = ale#Var(a:buffer, 'javascript_prettier_use_local_config')
|
||||||
|
\ && !empty(l:config)
|
||||||
|
let l:filetype = getbufvar(a:buffer, '&filetype')
|
||||||
|
|
||||||
|
" Append the --parser flag depending on the current filetype (unless it's
|
||||||
|
" already set in g:javascript_prettier_options).
|
||||||
|
if match(l:options, '--parser') == -1
|
||||||
|
if l:filetype is# 'typescript'
|
||||||
|
let l:parser = 'typescript'
|
||||||
|
elseif l:filetype =~# 'css\|scss\|less'
|
||||||
|
let l:parser = 'postcss'
|
||||||
|
elseif l:filetype is# 'json'
|
||||||
|
let l:parser = 'json'
|
||||||
|
else
|
||||||
|
let l:parser = 'babylon'
|
||||||
|
endif
|
||||||
|
let l:options = (!empty(l:options) ? l:options . ' ' : '') . '--parser ' . l:parser
|
||||||
|
endif
|
||||||
|
|
||||||
return {
|
return {
|
||||||
\ 'command': ale#Escape(ale#fixers#prettier#GetExecutable(a:buffer))
|
\ 'command': ale#Escape(ale#fixers#prettier#GetExecutable(a:buffer))
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
\ . ' ' . l:options
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
|
\ . (l:use_config ? ' --config ' . ale#Escape(l:config) : '')
|
||||||
\ . ' --write',
|
\ . ' --write',
|
||||||
\ 'read_temporary_file': 1,
|
\ 'read_temporary_file': 1,
|
||||||
\}
|
\}
|
||||||
|
|||||||
@@ -1,25 +1,39 @@
|
|||||||
" Author: tunnckoCore (Charlike Mike Reagent) <mameto2011@gmail.com>,
|
" Author: tunnckoCore (Charlike Mike Reagent) <mameto2011@gmail.com>,
|
||||||
" w0rp <devw0rp@gmail.com>
|
" w0rp <devw0rp@gmail.com>, morhetz (Pavel Pertsev) <morhetz@gmail.com>
|
||||||
" Description: Integration between Prettier and ESLint.
|
" Description: Integration between Prettier and ESLint.
|
||||||
|
|
||||||
call ale#Set('javascript_prettier_eslint_executable', 'prettier-eslint')
|
function! ale#fixers#prettier_eslint#SetOptionDefaults() abort
|
||||||
call ale#Set('javascript_prettier_eslint_use_global', 0)
|
call ale#Set('javascript_prettier_eslint_executable', 'prettier-eslint')
|
||||||
call ale#Set('javascript_prettier_eslint_options', '')
|
call ale#Set('javascript_prettier_eslint_use_global', 0)
|
||||||
|
call ale#Set('javascript_prettier_eslint_options', '')
|
||||||
|
call ale#Set('javascript_prettier_eslint_legacy', 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#fixers#prettier_eslint#SetOptionDefaults()
|
||||||
|
|
||||||
function! ale#fixers#prettier_eslint#GetExecutable(buffer) abort
|
function! ale#fixers#prettier_eslint#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'javascript_prettier_eslint', [
|
return ale#node#FindExecutable(a:buffer, 'javascript_prettier_eslint', [
|
||||||
\ 'node_modules/prettier-eslint-cli/index.js',
|
\ 'node_modules/prettier-eslint-cli/dist/index.js',
|
||||||
\ 'node_modules/.bin/prettier-eslint',
|
\ 'node_modules/.bin/prettier-eslint',
|
||||||
\])
|
\])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#fixers#prettier_eslint#Fix(buffer, lines) abort
|
function! ale#fixers#prettier_eslint#Fix(buffer) abort
|
||||||
let l:options = ale#Var(a:buffer, 'javascript_prettier_eslint_options')
|
let l:options = ale#Var(a:buffer, 'javascript_prettier_eslint_options')
|
||||||
|
let l:executable = ale#fixers#prettier_eslint#GetExecutable(a:buffer)
|
||||||
|
|
||||||
|
let l:config = !ale#Var(a:buffer, 'javascript_prettier_eslint_legacy')
|
||||||
|
\ ? ale#handlers#eslint#FindConfig(a:buffer)
|
||||||
|
\ : ''
|
||||||
|
let l:eslint_config_option = !empty(l:config)
|
||||||
|
\ ? ' --eslint-config-path ' . ale#Escape(l:config)
|
||||||
|
\ : ''
|
||||||
|
|
||||||
return {
|
return {
|
||||||
\ 'command': ale#Escape(ale#fixers#prettier_eslint#GetExecutable(a:buffer))
|
\ 'command': ale#Escape(l:executable)
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
\ . ' ' . l:options
|
\ . l:eslint_config_option
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
\ . ' --write',
|
\ . ' --write',
|
||||||
\ 'read_temporary_file': 1,
|
\ 'read_temporary_file': 1,
|
||||||
\}
|
\}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||||
" Description: Fixing files with Standard.
|
" Description: Fixing files with Standard.
|
||||||
|
|
||||||
|
call ale#Set('javascript_standard_executable', 'standard')
|
||||||
|
call ale#Set('javascript_standard_use_global', 0)
|
||||||
|
call ale#Set('javascript_standard_options', '')
|
||||||
|
|
||||||
function! ale#fixers#standard#GetExecutable(buffer) abort
|
function! ale#fixers#standard#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'javascript_standard', [
|
return ale#node#FindExecutable(a:buffer, 'javascript_standard', [
|
||||||
\ 'node_modules/standard/bin/cmd.js',
|
\ 'node_modules/standard/bin/cmd.js',
|
||||||
@@ -11,16 +15,8 @@ endfunction
|
|||||||
function! ale#fixers#standard#Fix(buffer) abort
|
function! ale#fixers#standard#Fix(buffer) abort
|
||||||
let l:executable = ale#fixers#standard#GetExecutable(a:buffer)
|
let l:executable = ale#fixers#standard#GetExecutable(a:buffer)
|
||||||
|
|
||||||
if ale#Has('win32') && l:executable =~? 'cmd\.js$'
|
|
||||||
" For Windows, if we detect an standard.js script, we need to execute
|
|
||||||
" it with node, or the file can be opened with a text editor.
|
|
||||||
let l:head = 'node ' . ale#Escape(l:executable)
|
|
||||||
else
|
|
||||||
let l:head = ale#Escape(l:executable)
|
|
||||||
endif
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
\ 'command': l:head
|
\ 'command': ale#node#Executable(a:buffer, l:executable)
|
||||||
\ . ' --fix %t',
|
\ . ' --fix %t',
|
||||||
\ 'read_temporary_file': 1,
|
\ 'read_temporary_file': 1,
|
||||||
\}
|
\}
|
||||||
|
|||||||
@@ -15,16 +15,8 @@ endfunction
|
|||||||
function! ale#fixers#stylelint#Fix(buffer) abort
|
function! ale#fixers#stylelint#Fix(buffer) abort
|
||||||
let l:executable = ale#fixers#stylelint#GetExecutable(a:buffer)
|
let l:executable = ale#fixers#stylelint#GetExecutable(a:buffer)
|
||||||
|
|
||||||
if ale#Has('win32') && l:executable =~? 'stylelint\.js$'
|
|
||||||
" For Windows, if we detect an stylelint.js script, we need to execute
|
|
||||||
" it with node, or the file can be opened with a text editor.
|
|
||||||
let l:head = 'node ' . ale#Escape(l:executable)
|
|
||||||
else
|
|
||||||
let l:head = ale#Escape(l:executable)
|
|
||||||
endif
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
\ 'command': l:head
|
\ 'command': ale#node#Executable(a:buffer, l:executable)
|
||||||
\ . ' --fix %t',
|
\ . ' --fix %t',
|
||||||
\ 'read_temporary_file': 1,
|
\ 'read_temporary_file': 1,
|
||||||
\}
|
\}
|
||||||
|
|||||||
22
autoload/ale/fixers/tslint.vim
Normal file
22
autoload/ale/fixers/tslint.vim
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
" Author: carakan <carakan@gmail.com>
|
||||||
|
" Description: Fixing files with tslint.
|
||||||
|
|
||||||
|
function! ale#fixers#tslint#Fix(buffer) abort
|
||||||
|
let l:executable = ale_linters#typescript#tslint#GetExecutable(a:buffer)
|
||||||
|
|
||||||
|
let l:tslint_config_path = ale#path#ResolveLocalPath(
|
||||||
|
\ a:buffer,
|
||||||
|
\ 'tslint.json',
|
||||||
|
\ ale#Var(a:buffer, 'typescript_tslint_config_path')
|
||||||
|
\)
|
||||||
|
let l:tslint_config_option = !empty(l:tslint_config_path)
|
||||||
|
\ ? ' -c ' . ale#Escape(l:tslint_config_path)
|
||||||
|
\ : ''
|
||||||
|
|
||||||
|
return {
|
||||||
|
\ 'command': ale#node#Executable(a:buffer, l:executable)
|
||||||
|
\ . l:tslint_config_option
|
||||||
|
\ . ' --fix %t',
|
||||||
|
\ 'read_temporary_file': 1,
|
||||||
|
\}
|
||||||
|
endfunction
|
||||||
@@ -11,7 +11,7 @@ function! ale#fixers#yapf#Fix(buffer) abort
|
|||||||
\ ['yapf'],
|
\ ['yapf'],
|
||||||
\)
|
\)
|
||||||
|
|
||||||
if !executable(l:executable)
|
if !ale#python#IsExecutable(l:executable)
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -2,20 +2,30 @@
|
|||||||
" Description: Functions for working with Gradle projects.
|
" Description: Functions for working with Gradle projects.
|
||||||
|
|
||||||
let s:script_path = fnamemodify(resolve(expand('<sfile>:p')), ':h')
|
let s:script_path = fnamemodify(resolve(expand('<sfile>:p')), ':h')
|
||||||
|
let s:init_path = has('win32')
|
||||||
|
\ ? s:script_path . '\gradle\init.gradle'
|
||||||
|
\ : s:script_path . '/gradle/init.gradle'
|
||||||
|
|
||||||
|
function! ale#gradle#GetInitPath() abort
|
||||||
|
return s:init_path
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Given a buffer number, find a Gradle project root.
|
" Given a buffer number, find a Gradle project root.
|
||||||
function! ale#gradle#FindProjectRoot(buffer) abort
|
function! ale#gradle#FindProjectRoot(buffer) abort
|
||||||
let l:gradlew_path = ale#path#FindNearestFile(a:buffer, 'gradlew')
|
let l:gradlew_path = ale#path#FindNearestFile(a:buffer, 'gradlew')
|
||||||
|
|
||||||
if !empty(l:gradlew_path)
|
if !empty(l:gradlew_path)
|
||||||
return fnamemodify(l:gradlew_path, ':h')
|
return fnamemodify(l:gradlew_path, ':h')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:settings_path = ale#path#FindNearestFile(a:buffer, 'settings.gradle')
|
let l:settings_path = ale#path#FindNearestFile(a:buffer, 'settings.gradle')
|
||||||
|
|
||||||
if !empty(l:settings_path)
|
if !empty(l:settings_path)
|
||||||
return fnamemodify(l:settings_path, ':h')
|
return fnamemodify(l:settings_path, ':h')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:build_path = ale#path#FindNearestFile(a:buffer, 'build.gradle')
|
let l:build_path = ale#path#FindNearestFile(a:buffer, 'build.gradle')
|
||||||
|
|
||||||
if !empty(l:build_path)
|
if !empty(l:build_path)
|
||||||
return fnamemodify(l:build_path, ':h')
|
return fnamemodify(l:build_path, ':h')
|
||||||
endif
|
endif
|
||||||
@@ -28,6 +38,7 @@ endfunction
|
|||||||
" command. Returns an empty string if cannot find the executable.
|
" command. Returns an empty string if cannot find the executable.
|
||||||
function! ale#gradle#FindExecutable(buffer) abort
|
function! ale#gradle#FindExecutable(buffer) abort
|
||||||
let l:gradlew_path = ale#path#FindNearestFile(a:buffer, 'gradlew')
|
let l:gradlew_path = ale#path#FindNearestFile(a:buffer, 'gradlew')
|
||||||
|
|
||||||
if !empty(l:gradlew_path)
|
if !empty(l:gradlew_path)
|
||||||
return l:gradlew_path
|
return l:gradlew_path
|
||||||
endif
|
endif
|
||||||
@@ -47,7 +58,9 @@ function! ale#gradle#BuildClasspathCommand(buffer) abort
|
|||||||
|
|
||||||
if !empty(l:executable) && !empty(l:project_root)
|
if !empty(l:executable) && !empty(l:project_root)
|
||||||
return ale#path#CdString(l:project_root)
|
return ale#path#CdString(l:project_root)
|
||||||
\ . l:executable . ' -I ' . s:script_path . '/gradle/init.gradle -q printClasspath'
|
\ . ale#Escape(l:executable)
|
||||||
|
\ . ' -I ' . ale#Escape(s:init_path)
|
||||||
|
\ . ' -q printClasspath'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
|
|||||||
@@ -1,11 +1,33 @@
|
|||||||
" Author: w0rp <devw0rp@gmail.com>
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
" Description: Functions for working with eslint, for checking or fixing files.
|
" Description: Functions for working with eslint, for checking or fixing files.
|
||||||
|
|
||||||
|
let s:sep = has('win32') ? '\' : '/'
|
||||||
|
|
||||||
call ale#Set('javascript_eslint_options', '')
|
call ale#Set('javascript_eslint_options', '')
|
||||||
call ale#Set('javascript_eslint_executable', 'eslint')
|
call ale#Set('javascript_eslint_executable', 'eslint')
|
||||||
call ale#Set('javascript_eslint_use_global', 0)
|
call ale#Set('javascript_eslint_use_global', 0)
|
||||||
call ale#Set('javascript_eslint_suppress_eslintignore', 0)
|
call ale#Set('javascript_eslint_suppress_eslintignore', 0)
|
||||||
|
|
||||||
|
function! ale#handlers#eslint#FindConfig(buffer) abort
|
||||||
|
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
|
||||||
|
for l:basename in [
|
||||||
|
\ '.eslintrc.js',
|
||||||
|
\ '.eslintrc.yaml',
|
||||||
|
\ '.eslintrc.yml',
|
||||||
|
\ '.eslintrc.json',
|
||||||
|
\ '.eslintrc',
|
||||||
|
\]
|
||||||
|
let l:config = ale#path#Simplify(join([l:path, l:basename], s:sep))
|
||||||
|
|
||||||
|
if filereadable(l:config)
|
||||||
|
return l:config
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return ale#path#FindNearestFile(a:buffer, 'package.json')
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale#handlers#eslint#GetExecutable(buffer) abort
|
function! ale#handlers#eslint#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'javascript_eslint', [
|
return ale#node#FindExecutable(a:buffer, 'javascript_eslint', [
|
||||||
\ 'node_modules/.bin/eslint_d',
|
\ 'node_modules/.bin/eslint_d',
|
||||||
@@ -17,17 +39,9 @@ endfunction
|
|||||||
function! ale#handlers#eslint#GetCommand(buffer) abort
|
function! ale#handlers#eslint#GetCommand(buffer) abort
|
||||||
let l:executable = ale#handlers#eslint#GetExecutable(a:buffer)
|
let l:executable = ale#handlers#eslint#GetExecutable(a:buffer)
|
||||||
|
|
||||||
if ale#Has('win32') && l:executable =~? 'eslint\.js$'
|
|
||||||
" For Windows, if we detect an eslint.js script, we need to execute
|
|
||||||
" it with node, or the file can be opened with a text editor.
|
|
||||||
let l:head = 'node ' . ale#Escape(l:executable)
|
|
||||||
else
|
|
||||||
let l:head = ale#Escape(l:executable)
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:options = ale#Var(a:buffer, 'javascript_eslint_options')
|
let l:options = ale#Var(a:buffer, 'javascript_eslint_options')
|
||||||
|
|
||||||
return l:head
|
return ale#node#Executable(a:buffer, l:executable)
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
\ . ' -f unix --stdin --stdin-filename %s'
|
\ . ' -f unix --stdin --stdin-filename %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -1,11 +1,24 @@
|
|||||||
" Author: w0rp <devw0rp@gmail.com>
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
" Description: Error handling for the format GHC outputs.
|
" Description: Error handling for the format GHC outputs.
|
||||||
|
|
||||||
|
" Remember the directory used for temporary files for Vim.
|
||||||
|
let s:temp_dir = fnamemodify(tempname(), ':h')
|
||||||
|
" Build part of a regular expression for matching ALE temporary filenames.
|
||||||
|
let s:temp_regex_prefix =
|
||||||
|
\ '\M'
|
||||||
|
\ . substitute(s:temp_dir, '\\', '\\\\', 'g')
|
||||||
|
\ . '\.\{-}'
|
||||||
|
|
||||||
function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort
|
function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort
|
||||||
" Look for lines like the following.
|
" Look for lines like the following.
|
||||||
"
|
"
|
||||||
"Appoint/Lib.hs:8:1: warning:
|
"Appoint/Lib.hs:8:1: warning:
|
||||||
"Appoint/Lib.hs:8:1:
|
"Appoint/Lib.hs:8:1:
|
||||||
|
let l:basename = expand('#' . a:buffer . ':t')
|
||||||
|
" Build a complete regular expression for replacing temporary filenames
|
||||||
|
" in Haskell error messages with the basename for this file.
|
||||||
|
let l:temp_filename_regex = s:temp_regex_prefix . l:basename
|
||||||
|
|
||||||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+):(.*)?$'
|
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+):(.*)?$'
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
@@ -51,6 +64,9 @@ function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort
|
|||||||
let l:type = 'E'
|
let l:type = 'E'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Replace temporary filenames in problem messages with the basename
|
||||||
|
let l:text = substitute(l:text, l:temp_filename_regex, l:basename, 'g')
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': l:match[2] + 0,
|
\ 'lnum': l:match[2] + 0,
|
||||||
\ 'col': l:match[3] + 0,
|
\ 'col': l:match[3] + 0,
|
||||||
|
|||||||
@@ -7,25 +7,25 @@ if !exists('g:ale_rust_ignore_error_codes')
|
|||||||
let g:ale_rust_ignore_error_codes = []
|
let g:ale_rust_ignore_error_codes = []
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" returns: a list [lnum, col] with the location of the error or []
|
function! s:FindSpan(buffer, span) abort
|
||||||
function! s:FindErrorInExpansion(span, buffer) abort
|
if ale#path#IsBufferPath(a:buffer, a:span.file_name) || a:span.file_name is# '<anon>'
|
||||||
if ale#path#IsBufferPath(a:buffer, a:span.file_name)
|
return a:span
|
||||||
return [a:span.line_start, a:span.line_end, a:span.byte_start, a:span.byte_end]
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !empty(a:span.expansion)
|
" Search inside the expansion of an error, as the problem for this buffer
|
||||||
return s:FindErrorInExpansion(a:span.expansion.span, a:buffer)
|
" could lie inside a nested object.
|
||||||
|
if !empty(get(a:span, 'expansion', v:null))
|
||||||
|
return s:FindSpan(a:buffer, a:span.expansion.span)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return []
|
return {}
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" A handler function which accepts a file name, to make unit testing easier.
|
function! ale#handlers#rust#HandleRustErrors(buffer, lines) abort
|
||||||
function! ale#handlers#rust#HandleRustErrorsForFile(buffer, full_filename, lines) abort
|
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:errorline in a:lines
|
for l:errorline in a:lines
|
||||||
" ignore everything that is not Json
|
" ignore everything that is not JSON
|
||||||
if l:errorline !~# '^{'
|
if l:errorline !~# '^{'
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
@@ -44,11 +44,10 @@ function! ale#handlers#rust#HandleRustErrorsForFile(buffer, full_filename, lines
|
|||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
for l:span in l:error.spans
|
for l:root_span in l:error.spans
|
||||||
if (
|
let l:span = s:FindSpan(a:buffer, l:root_span)
|
||||||
\ l:span.is_primary
|
|
||||||
\ && (ale#path#IsBufferPath(a:buffer, l:span.file_name) || l:span.file_name is# '<anon>')
|
if !empty(l:span)
|
||||||
\)
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': l:span.line_start,
|
\ 'lnum': l:span.line_start,
|
||||||
\ 'end_lnum': l:span.line_end,
|
\ 'end_lnum': l:span.line_end,
|
||||||
@@ -57,29 +56,9 @@ function! ale#handlers#rust#HandleRustErrorsForFile(buffer, full_filename, lines
|
|||||||
\ 'text': empty(l:span.label) ? l:error.message : printf('%s: %s', l:error.message, l:span.label),
|
\ 'text': empty(l:span.label) ? l:error.message : printf('%s: %s', l:error.message, l:span.label),
|
||||||
\ 'type': toupper(l:error.level[0]),
|
\ 'type': toupper(l:error.level[0]),
|
||||||
\})
|
\})
|
||||||
else
|
|
||||||
" when the error is caused in the expansion of a macro, we have
|
|
||||||
" to bury deeper
|
|
||||||
let l:root_cause = s:FindErrorInExpansion(l:span, a:buffer)
|
|
||||||
|
|
||||||
if !empty(l:root_cause)
|
|
||||||
call add(l:output, {
|
|
||||||
\ 'lnum': l:root_cause[0],
|
|
||||||
\ 'end_lnum': l:root_cause[1],
|
|
||||||
\ 'col': l:root_cause[2],
|
|
||||||
\ 'end_col': l:root_cause[3],
|
|
||||||
\ 'text': l:error.message,
|
|
||||||
\ 'type': toupper(l:error.level[0]),
|
|
||||||
\})
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" A handler for output for Rust linters.
|
|
||||||
function! ale#handlers#rust#HandleRustErrors(buffer, lines) abort
|
|
||||||
return ale#handlers#rust#HandleRustErrorsForFile(a:buffer, bufname(a:buffer), a:lines)
|
|
||||||
endfunction
|
|
||||||
|
|||||||
20
autoload/ale/handlers/sh.vim
Normal file
20
autoload/ale/handlers/sh.vim
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
|
|
||||||
|
" Get the shell type for a buffer, based on the hashbang line.
|
||||||
|
function! ale#handlers#sh#GetShellType(buffer) abort
|
||||||
|
let l:bang_line = get(getbufline(a:buffer, 1), 0, '')
|
||||||
|
|
||||||
|
" Take the shell executable from the hashbang, if we can.
|
||||||
|
if l:bang_line[:1] is# '#!'
|
||||||
|
" Remove options like -e, etc.
|
||||||
|
let l:command = substitute(l:bang_line, ' --\?[a-zA-Z0-9]\+', '', 'g')
|
||||||
|
|
||||||
|
for l:possible_shell in ['bash', 'tcsh', 'csh', 'zsh', 'sh']
|
||||||
|
if l:command =~# l:possible_shell . '\s*$'
|
||||||
|
return l:possible_shell
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
92
autoload/ale/handlers/sml.vim
Normal file
92
autoload/ale/handlers/sml.vim
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
" Author: Jake Zimmerman <jake@zimmerman.io>
|
||||||
|
" Description: Shared functions for SML linters
|
||||||
|
|
||||||
|
" The glob to use for finding the .cm file.
|
||||||
|
"
|
||||||
|
" See :help ale-sml-smlnj for more information.
|
||||||
|
call ale#Set('sml_smlnj_cm_file', '*.cm')
|
||||||
|
|
||||||
|
function! ale#handlers#sml#GetCmFile(buffer) abort
|
||||||
|
let l:pattern = ale#Var(a:buffer, 'sml_smlnj_cm_file')
|
||||||
|
let l:as_list = 1
|
||||||
|
|
||||||
|
let l:cmfile = ''
|
||||||
|
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
|
||||||
|
let l:results = glob(l:path . '/' . l:pattern, 0, l:as_list)
|
||||||
|
if len(l:results) > 0
|
||||||
|
" If there is more than one CM file, we take the first one
|
||||||
|
" See :help ale-sml-smlnj for how to configure this.
|
||||||
|
let l:cmfile = l:results[0]
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:cmfile
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Only one of smlnj or smlnj-cm can be enabled at a time.
|
||||||
|
" executable_callback is called before *every* lint attempt
|
||||||
|
function! s:GetExecutable(buffer, source) abort
|
||||||
|
if ale#handlers#sml#GetCmFile(a:buffer) is# ''
|
||||||
|
" No CM file found; only allow single-file mode to be enabled
|
||||||
|
if a:source is# 'smlnj-file'
|
||||||
|
return 'sml'
|
||||||
|
elseif a:source is# 'smlnj-cm'
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
" Found a CM file; only allow cm-file mode to be enabled
|
||||||
|
if a:source is# 'smlnj-file'
|
||||||
|
return ''
|
||||||
|
elseif a:source is# 'smlnj-cm'
|
||||||
|
return 'sml'
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale#handlers#sml#GetExecutableSmlnjCm(buffer) abort
|
||||||
|
return s:GetExecutable(a:buffer, 'smlnj-cm')
|
||||||
|
endfunction
|
||||||
|
function! ale#handlers#sml#GetExecutableSmlnjFile(buffer) abort
|
||||||
|
return s:GetExecutable(a:buffer, 'smlnj-file')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale#handlers#sml#Handle(buffer, lines) abort
|
||||||
|
" Try to match basic sml errors
|
||||||
|
" TODO(jez) We can get better errorfmt strings from Syntastic
|
||||||
|
|
||||||
|
let l:out = []
|
||||||
|
let l:pattern = '^.*\:\([0-9\.]\+\)\ \(\w\+\)\:\ \(.*\)'
|
||||||
|
let l:pattern2 = '^.*\:\([0-9]\+\)\.\?\([0-9]\+\).* \(\(Warning\|Error\): .*\)'
|
||||||
|
|
||||||
|
for l:line in a:lines
|
||||||
|
let l:match2 = matchlist(l:line, l:pattern2)
|
||||||
|
|
||||||
|
if len(l:match2) != 0
|
||||||
|
call add(l:out, {
|
||||||
|
\ 'bufnr': a:buffer,
|
||||||
|
\ 'lnum': l:match2[1] + 0,
|
||||||
|
\ 'col' : l:match2[2] - 1,
|
||||||
|
\ 'text': l:match2[3],
|
||||||
|
\ 'type': l:match2[3] =~# '^Warning' ? 'W' : 'E',
|
||||||
|
\})
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:match = matchlist(l:line, l:pattern)
|
||||||
|
|
||||||
|
if len(l:match) != 0
|
||||||
|
call add(l:out, {
|
||||||
|
\ 'bufnr': a:buffer,
|
||||||
|
\ 'lnum': l:match[1] + 0,
|
||||||
|
\ 'text': l:match[2] . ': ' . l:match[3],
|
||||||
|
\ 'type': l:match[2] is# 'error' ? 'E' : 'W',
|
||||||
|
\})
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:out
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" vim:ts=4:sts=4:sw=4
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
" Author: w0rp <devw0rp@gmail.com>
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
" Deciption: APIs for working with Asynchronous jobs, with an API normalised
|
" Description: APIs for working with Asynchronous jobs, with an API normalised
|
||||||
" between Vim 8 and NeoVim.
|
" between Vim 8 and NeoVim.
|
||||||
"
|
"
|
||||||
" Important functions are described below. They are:
|
" Important functions are described below. They are:
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ let s:default_ale_linters = {
|
|||||||
\ 'csh': ['shell'],
|
\ 'csh': ['shell'],
|
||||||
\ 'go': ['gofmt', 'golint', 'go vet'],
|
\ 'go': ['gofmt', 'golint', 'go vet'],
|
||||||
\ 'help': [],
|
\ 'help': [],
|
||||||
|
\ 'python': ['flake8', 'mypy', 'pylint'],
|
||||||
\ 'rust': ['cargo'],
|
\ 'rust': ['cargo'],
|
||||||
\ 'spec': [],
|
\ 'spec': [],
|
||||||
\ 'text': [],
|
\ 'text': [],
|
||||||
@@ -304,7 +305,7 @@ endfunction
|
|||||||
function! ale#linter#Get(original_filetypes) abort
|
function! ale#linter#Get(original_filetypes) abort
|
||||||
let l:possibly_duplicated_linters = []
|
let l:possibly_duplicated_linters = []
|
||||||
|
|
||||||
" Handle dot-seperated filetypes.
|
" Handle dot-separated filetypes.
|
||||||
for l:original_filetype in split(a:original_filetypes, '\.')
|
for l:original_filetype in split(a:original_filetypes, '\.')
|
||||||
let l:filetype = ale#linter#ResolveFiletype(l:original_filetype)
|
let l:filetype = ale#linter#ResolveFiletype(l:original_filetype)
|
||||||
let l:linter_names = s:GetLinterNames(l:original_filetype)
|
let l:linter_names = s:GetLinterNames(l:original_filetype)
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ function! s:FixList(list) abort
|
|||||||
return l:new_list
|
return l:new_list
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:BufWinId(buffer) abort
|
||||||
|
return exists('*bufwinid') ? bufwinid(str2nr(a:buffer)) : 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:SetListsImpl(timer_id, buffer, loclist) abort
|
function! s:SetListsImpl(timer_id, buffer, loclist) abort
|
||||||
let l:title = expand('#' . a:buffer . ':p')
|
let l:title = expand('#' . a:buffer . ':p')
|
||||||
|
|
||||||
@@ -72,7 +76,7 @@ function! s:SetListsImpl(timer_id, buffer, loclist) abort
|
|||||||
" If windows support is off, bufwinid() may not exist.
|
" If windows support is off, bufwinid() may not exist.
|
||||||
" We'll set result in the current window, which might not be correct,
|
" We'll set result in the current window, which might not be correct,
|
||||||
" but is better than nothing.
|
" but is better than nothing.
|
||||||
let l:win_id = exists('*bufwinid') ? bufwinid(str2nr(a:buffer)) : 0
|
let l:win_id = s:BufWinId(a:buffer)
|
||||||
|
|
||||||
if has('nvim')
|
if has('nvim')
|
||||||
call setloclist(l:win_id, s:FixList(a:loclist), ' ', l:title)
|
call setloclist(l:win_id, s:FixList(a:loclist), ' ', l:title)
|
||||||
@@ -82,13 +86,11 @@ function! s:SetListsImpl(timer_id, buffer, loclist) abort
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:keep_open = ale#Var(a:buffer, 'keep_list_window_open')
|
|
||||||
|
|
||||||
" Open a window to show the problems if we need to.
|
" Open a window to show the problems if we need to.
|
||||||
"
|
"
|
||||||
" We'll check if the current buffer's List is not empty here, so the
|
" We'll check if the current buffer's List is not empty here, so the
|
||||||
" window will only be opened if the current buffer has problems.
|
" window will only be opened if the current buffer has problems.
|
||||||
if s:ShouldOpen(a:buffer) && (l:keep_open || !empty(a:loclist))
|
if s:ShouldOpen(a:buffer) && !empty(a:loclist)
|
||||||
let l:winnr = winnr()
|
let l:winnr = winnr()
|
||||||
let l:mode = mode()
|
let l:mode = mode()
|
||||||
let l:reset_visual_selection = l:mode is? 'v' || l:mode is# "\<c-v>"
|
let l:reset_visual_selection = l:mode is? 'v' || l:mode is# "\<c-v>"
|
||||||
@@ -96,10 +98,10 @@ function! s:SetListsImpl(timer_id, buffer, loclist) abort
|
|||||||
|
|
||||||
if g:ale_set_quickfix
|
if g:ale_set_quickfix
|
||||||
if !ale#list#IsQuickfixOpen()
|
if !ale#list#IsQuickfixOpen()
|
||||||
execute 'copen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
|
silent! execute 'copen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
|
||||||
endif
|
endif
|
||||||
elseif g:ale_set_loclist
|
elseif g:ale_set_loclist
|
||||||
execute 'lopen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
|
silent! execute 'lopen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" If focus changed, restore it (jump to the last window).
|
" If focus changed, restore it (jump to the last window).
|
||||||
@@ -117,10 +119,23 @@ function! s:SetListsImpl(timer_id, buffer, loclist) abort
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" If ALE isn't currently checking for more problems, close the window if
|
||||||
|
" needed now. This check happens inside of this timer function, so
|
||||||
|
" the window can be closed reliably.
|
||||||
|
if !ale#engine#IsCheckingBuffer(a:buffer)
|
||||||
|
call s:CloseWindowIfNeeded(a:buffer)
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#list#SetLists(buffer, loclist) abort
|
function! ale#list#SetLists(buffer, loclist) abort
|
||||||
if get(g:, 'ale_set_lists_synchronously') == 1
|
if get(g:, 'ale_set_lists_synchronously') == 1
|
||||||
|
\|| getbufvar(a:buffer, 'ale_save_event_fired', 0)
|
||||||
|
" Update lists immediately if running a test synchronously, or if the
|
||||||
|
" buffer was saved.
|
||||||
|
"
|
||||||
|
" The lists need to be updated immediately when saving a buffer so
|
||||||
|
" that we can reliably close window automatically, if so configured.
|
||||||
call s:SetListsImpl(-1, a:buffer, a:loclist)
|
call s:SetListsImpl(-1, a:buffer, a:loclist)
|
||||||
else
|
else
|
||||||
call ale#util#StartPartialTimer(
|
call ale#util#StartPartialTimer(
|
||||||
@@ -131,7 +146,7 @@ function! ale#list#SetLists(buffer, loclist) abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:CloseWindowIfNeededImpl(timer_id, buffer) abort
|
function! s:CloseWindowIfNeeded(buffer) abort
|
||||||
if ale#Var(a:buffer, 'keep_list_window_open') || !s:ShouldOpen(a:buffer)
|
if ale#Var(a:buffer, 'keep_list_window_open') || !s:ShouldOpen(a:buffer)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
@@ -143,22 +158,14 @@ function! s:CloseWindowIfNeededImpl(timer_id, buffer) abort
|
|||||||
if empty(getqflist())
|
if empty(getqflist())
|
||||||
cclose
|
cclose
|
||||||
endif
|
endif
|
||||||
elseif g:ale_set_loclist && empty(getloclist(0))
|
else
|
||||||
lclose
|
let l:win_id = s:BufWinId(a:buffer)
|
||||||
|
|
||||||
|
if g:ale_set_loclist && empty(getloclist(l:win_id))
|
||||||
|
lclose
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
" Ignore 'Cannot close last window' errors.
|
" Ignore 'Cannot close last window' errors.
|
||||||
catch /E444/
|
catch /E444/
|
||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#list#CloseWindowIfNeeded(buffer) abort
|
|
||||||
if get(g:, 'ale_set_lists_synchronously') == 1
|
|
||||||
call s:CloseWindowIfNeededImpl(-1, a:buffer)
|
|
||||||
else
|
|
||||||
call ale#util#StartPartialTimer(
|
|
||||||
\ 0,
|
|
||||||
\ function('s:CloseWindowIfNeededImpl'),
|
|
||||||
\ [a:buffer],
|
|
||||||
\)
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|||||||
@@ -242,10 +242,14 @@ function! s:HandleCommandMessage(job_id, message) abort
|
|||||||
call ale#lsp#HandleMessage(l:conn, a:message)
|
call ale#lsp#HandleMessage(l:conn, a:message)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:RegisterProject(conn, project_root) abort
|
function! ale#lsp#RegisterProject(conn, project_root) abort
|
||||||
if !has_key(a:conn.projects, a:project_root)
|
" Empty strings can't be used for Dictionary keys in NeoVim, due to E713.
|
||||||
|
" This appears to be a nonsensical bug in NeoVim.
|
||||||
|
let l:key = empty(a:project_root) ? '<<EMPTY>>' : a:project_root
|
||||||
|
|
||||||
|
if !has_key(a:conn.projects, l:key)
|
||||||
" Tools without project roots are ready right away, like tsserver.
|
" Tools without project roots are ready right away, like tsserver.
|
||||||
let a:conn.projects[a:project_root] = {
|
let a:conn.projects[l:key] = {
|
||||||
\ 'initialized': empty(a:project_root),
|
\ 'initialized': empty(a:project_root),
|
||||||
\ 'init_request_id': 0,
|
\ 'init_request_id': 0,
|
||||||
\ 'message_queue': [],
|
\ 'message_queue': [],
|
||||||
@@ -253,6 +257,12 @@ function! s:RegisterProject(conn, project_root) abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ale#lsp#GetProject(conn, project_root) abort
|
||||||
|
let l:key = empty(a:project_root) ? '<<EMPTY>>' : a:project_root
|
||||||
|
|
||||||
|
return get(a:conn.projects, l:key, {})
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Start a program for LSP servers which run with executables.
|
" Start a program for LSP servers which run with executables.
|
||||||
"
|
"
|
||||||
" The job ID will be returned for for the program if it ran, otherwise
|
" The job ID will be returned for for the program if it ran, otherwise
|
||||||
@@ -285,7 +295,7 @@ function! ale#lsp#StartProgram(executable, command, project_root, callback) abor
|
|||||||
let l:conn.id = l:job_id
|
let l:conn.id = l:job_id
|
||||||
" Add the callback to the List if it's not there already.
|
" Add the callback to the List if it's not there already.
|
||||||
call uniq(sort(add(l:conn.callback_list, a:callback)))
|
call uniq(sort(add(l:conn.callback_list, a:callback)))
|
||||||
call s:RegisterProject(l:conn, a:project_root)
|
call ale#lsp#RegisterProject(l:conn, a:project_root)
|
||||||
|
|
||||||
return l:job_id
|
return l:job_id
|
||||||
endfunction
|
endfunction
|
||||||
@@ -311,7 +321,7 @@ function! ale#lsp#ConnectToAddress(address, project_root, callback) abort
|
|||||||
let l:conn.id = a:address
|
let l:conn.id = a:address
|
||||||
" Add the callback to the List if it's not there already.
|
" Add the callback to the List if it's not there already.
|
||||||
call uniq(sort(add(l:conn.callback_list, a:callback)))
|
call uniq(sort(add(l:conn.callback_list, a:callback)))
|
||||||
call s:RegisterProject(l:conn, a:project_root)
|
call ale#lsp#RegisterProject(l:conn, a:project_root)
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
endfunction
|
endfunction
|
||||||
@@ -344,7 +354,7 @@ function! ale#lsp#Send(conn_id, message, ...) abort
|
|||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:project = get(l:conn.projects, l:project_root, {})
|
let l:project = ale#lsp#GetProject(l:conn, l:project_root)
|
||||||
|
|
||||||
if empty(l:project)
|
if empty(l:project)
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
" Author: w0rp <devw0rp@gmail.com>
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
" Description: Functions for working with Node executables.
|
" Description: Functions for working with Node executables.
|
||||||
|
|
||||||
|
call ale#Set('windows_node_executable_path', 'node.exe')
|
||||||
|
|
||||||
" Given a buffer number, a base variable name, and a list of paths to search
|
" Given a buffer number, a base variable name, and a list of paths to search
|
||||||
" for in ancestor directories, detect the executable path for a Node program.
|
" for in ancestor directories, detect the executable path for a Node program.
|
||||||
"
|
"
|
||||||
@@ -20,3 +22,21 @@ function! ale#node#FindExecutable(buffer, base_var_name, path_list) abort
|
|||||||
|
|
||||||
return ale#Var(a:buffer, a:base_var_name . '_executable')
|
return ale#Var(a:buffer, a:base_var_name . '_executable')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Create a executable string which executes a Node.js script command with a
|
||||||
|
" Node.js executable if needed.
|
||||||
|
"
|
||||||
|
" The executable string should not be escaped before passing it to this
|
||||||
|
" function, the executable string will be escaped when returned by this
|
||||||
|
" function.
|
||||||
|
"
|
||||||
|
" The executable is only prefixed for Windows machines
|
||||||
|
function! ale#node#Executable(buffer, executable) abort
|
||||||
|
if ale#Has('win32') && a:executable =~? '\.js$'
|
||||||
|
let l:node = ale#Var(a:buffer, 'windows_node_executable_path')
|
||||||
|
|
||||||
|
return ale#Escape(l:node) . ' ' . ale#Escape(a:executable)
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ale#Escape(a:executable)
|
||||||
|
endfunction
|
||||||
|
|||||||
@@ -7,6 +7,26 @@ function! ale#path#Simplify(path) abort
|
|||||||
return substitute(simplify(a:path), '^//\+', '/', 'g') " no-custom-checks
|
return substitute(simplify(a:path), '^//\+', '/', 'g') " no-custom-checks
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" This function is mainly used for testing.
|
||||||
|
" Simplify() a path, and change forward slashes to back slashes on Windows.
|
||||||
|
"
|
||||||
|
" If an additional 'add_drive' argument is given, the current drive letter
|
||||||
|
" will be prefixed to any absolute paths on Windows.
|
||||||
|
function! ale#path#Winify(path, ...) abort
|
||||||
|
let l:new_path = ale#path#Simplify(a:path)
|
||||||
|
|
||||||
|
if has('win32')
|
||||||
|
let l:new_path = substitute(l:new_path, '/', '\\', 'g')
|
||||||
|
|
||||||
|
" Add a drive letter to \foo\bar paths, if needed.
|
||||||
|
if a:0 && a:1 is# 'add_drive' && l:new_path[:0] is# '\'
|
||||||
|
let l:new_path = fnamemodify('.', ':p')[:1] . l:new_path
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return l:new_path
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Given a buffer and a filename, find the nearest file by searching upwards
|
" Given a buffer and a filename, find the nearest file by searching upwards
|
||||||
" through the paths relative to the given buffer.
|
" through the paths relative to the given buffer.
|
||||||
function! ale#path#FindNearestFile(buffer, filename) abort
|
function! ale#path#FindNearestFile(buffer, filename) abort
|
||||||
@@ -68,22 +88,12 @@ function! ale#path#IsAbsolute(filename) abort
|
|||||||
return a:filename[:0] is# '/' || a:filename[1:2] is# ':\'
|
return a:filename[:0] is# '/' || a:filename[1:2] is# ':\'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
let s:temp_dir = fnamemodify(tempname(), ':h')
|
||||||
|
|
||||||
" Given a filename, return 1 if the file represents some temporary file
|
" Given a filename, return 1 if the file represents some temporary file
|
||||||
" created by Vim.
|
" created by Vim.
|
||||||
function! ale#path#IsTempName(filename) abort
|
function! ale#path#IsTempName(filename) abort
|
||||||
let l:prefix_list = [
|
return a:filename[:len(s:temp_dir) - 1] is# s:temp_dir
|
||||||
\ $TMPDIR,
|
|
||||||
\ resolve($TMPDIR),
|
|
||||||
\ '/run/user',
|
|
||||||
\]
|
|
||||||
|
|
||||||
for l:prefix in l:prefix_list
|
|
||||||
if a:filename[:len(l:prefix) - 1] is# l:prefix
|
|
||||||
return 1
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return 0
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Given a base directory, which must not have a trailing slash, and a
|
" Given a base directory, which must not have a trailing slash, and a
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
" Author: w0rp <devw0rp@gmail.com>
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
" Description: Functions for integrating with Python linters.
|
" Description: Functions for integrating with Python linters.
|
||||||
|
|
||||||
|
let s:sep = has('win32') ? '\' : '/'
|
||||||
" bin is used for Unix virtualenv directories, and Scripts is for Windows.
|
" bin is used for Unix virtualenv directories, and Scripts is for Windows.
|
||||||
let s:bin_dir = has('unix') ? 'bin' : 'Scripts'
|
let s:bin_dir = has('unix') ? 'bin' : 'Scripts'
|
||||||
let g:ale_virtualenv_dir_names = get(g:, 'ale_virtualenv_dir_names', [
|
let g:ale_virtualenv_dir_names = get(g:, 'ale_virtualenv_dir_names', [
|
||||||
@@ -11,7 +12,6 @@ let g:ale_virtualenv_dir_names = get(g:, 'ale_virtualenv_dir_names', [
|
|||||||
\ 'virtualenv',
|
\ 'virtualenv',
|
||||||
\])
|
\])
|
||||||
|
|
||||||
|
|
||||||
function! ale#python#FindProjectRootIni(buffer) abort
|
function! ale#python#FindProjectRootIni(buffer) abort
|
||||||
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
|
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
|
||||||
if filereadable(l:path . '/MANIFEST.in')
|
if filereadable(l:path . '/MANIFEST.in')
|
||||||
@@ -58,15 +58,26 @@ function! ale#python#FindVirtualenv(buffer) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
for l:dirname in ale#Var(a:buffer, 'virtualenv_dir_names')
|
for l:dirname in ale#Var(a:buffer, 'virtualenv_dir_names')
|
||||||
let l:venv_dir = ale#path#Simplify(l:path . '/' . l:dirname)
|
let l:venv_dir = ale#path#Simplify(
|
||||||
|
\ join([l:path, l:dirname], s:sep)
|
||||||
|
\)
|
||||||
|
let l:script_filename = ale#path#Simplify(
|
||||||
|
\ join([l:venv_dir, s:bin_dir, 'activate'], s:sep)
|
||||||
|
\)
|
||||||
|
|
||||||
if filereadable(ale#path#Simplify(l:venv_dir . '/' . s:bin_dir . '/activate'))
|
if filereadable(l:script_filename)
|
||||||
return l:venv_dir
|
return l:venv_dir
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return ''
|
return $VIRTUAL_ENV
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Run an executable check for Python scripts.
|
||||||
|
" On Windows, 1 will be returned if the file is merely readable.
|
||||||
|
function! ale#python#IsExecutable(path) abort
|
||||||
|
return has('win32') ? filereadable(a:path) : executable(a:path)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Given a buffer number and a command name, find the path to the executable.
|
" Given a buffer number and a command name, find the path to the executable.
|
||||||
@@ -81,9 +92,11 @@ function! ale#python#FindExecutable(buffer, base_var_name, path_list) abort
|
|||||||
|
|
||||||
if !empty(l:virtualenv)
|
if !empty(l:virtualenv)
|
||||||
for l:path in a:path_list
|
for l:path in a:path_list
|
||||||
let l:ve_executable = ale#path#Simplify(l:virtualenv . '/' . s:bin_dir . '/' . l:path)
|
let l:ve_executable = ale#path#Simplify(
|
||||||
|
\ join([l:virtualenv, s:bin_dir, l:path], s:sep)
|
||||||
|
\)
|
||||||
|
|
||||||
if executable(l:ve_executable)
|
if ale#python#IsExecutable(l:ve_executable)
|
||||||
return l:ve_executable
|
return l:ve_executable
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|||||||
@@ -184,16 +184,6 @@ function! s:GroupLoclistItems(buffer, loclist) abort
|
|||||||
return l:grouped_items
|
return l:grouped_items
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#sign#SetSignColumnHighlight(has_problems) abort
|
|
||||||
highlight clear SignColumn
|
|
||||||
|
|
||||||
if a:has_problems
|
|
||||||
highlight link SignColumn ALESignColumnWithErrors
|
|
||||||
else
|
|
||||||
highlight link SignColumn ALESignColumnWithoutErrors
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:UpdateLineNumbers(buffer, current_sign_list, loclist) abort
|
function! s:UpdateLineNumbers(buffer, current_sign_list, loclist) abort
|
||||||
let l:line_map = {}
|
let l:line_map = {}
|
||||||
let l:line_numbers_changed = 0
|
let l:line_numbers_changed = 0
|
||||||
@@ -219,29 +209,47 @@ function! s:UpdateLineNumbers(buffer, current_sign_list, loclist) abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:BuildSignMap(current_sign_list, grouped_items) abort
|
function! s:BuildSignMap(buffer, current_sign_list, grouped_items) abort
|
||||||
|
let l:max_signs = ale#Var(a:buffer, 'max_signs')
|
||||||
|
|
||||||
|
if l:max_signs is 0
|
||||||
|
let l:selected_grouped_items = []
|
||||||
|
elseif type(l:max_signs) is type(0) && l:max_signs > 0
|
||||||
|
let l:selected_grouped_items = a:grouped_items[:l:max_signs - 1]
|
||||||
|
else
|
||||||
|
let l:selected_grouped_items = a:grouped_items
|
||||||
|
endif
|
||||||
|
|
||||||
let l:sign_map = {}
|
let l:sign_map = {}
|
||||||
let l:sign_offset = g:ale_sign_offset
|
let l:sign_offset = g:ale_sign_offset
|
||||||
|
|
||||||
for [l:line, l:sign_id, l:name] in a:current_sign_list
|
for [l:line, l:sign_id, l:name] in a:current_sign_list
|
||||||
let l:sign_map[l:line] = {
|
let l:sign_info = get(l:sign_map, l:line, {
|
||||||
\ 'current_id': l:sign_id,
|
\ 'current_id_list': [],
|
||||||
\ 'current_name': l:name,
|
\ 'current_name_list': [],
|
||||||
\ 'new_id': 0,
|
\ 'new_id': 0,
|
||||||
\ 'new_name': '',
|
\ 'new_name': '',
|
||||||
\ 'items': [],
|
\ 'items': [],
|
||||||
\}
|
\})
|
||||||
|
|
||||||
|
" Increment the sign offset for new signs, by the maximum sign ID.
|
||||||
if l:sign_id > l:sign_offset
|
if l:sign_id > l:sign_offset
|
||||||
let l:sign_offset = l:sign_id
|
let l:sign_offset = l:sign_id
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Remember the sign names and IDs in separate Lists, so they are easy
|
||||||
|
" to work with.
|
||||||
|
call add(l:sign_info.current_id_list, l:sign_id)
|
||||||
|
call add(l:sign_info.current_name_list, l:name)
|
||||||
|
|
||||||
|
let l:sign_map[l:line] = l:sign_info
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
for l:group in a:grouped_items
|
for l:group in l:selected_grouped_items
|
||||||
let l:line = l:group[0].lnum
|
let l:line = l:group[0].lnum
|
||||||
let l:sign_info = get(l:sign_map, l:line, {
|
let l:sign_info = get(l:sign_map, l:line, {
|
||||||
\ 'current_id': 0,
|
\ 'current_id_list': [],
|
||||||
\ 'current_name': '',
|
\ 'current_name_list': [],
|
||||||
\ 'new_id': 0,
|
\ 'new_id': 0,
|
||||||
\ 'new_name': '',
|
\ 'new_name': '',
|
||||||
\ 'items': [],
|
\ 'items': [],
|
||||||
@@ -250,11 +258,18 @@ function! s:BuildSignMap(current_sign_list, grouped_items) abort
|
|||||||
let l:sign_info.new_name = ale#sign#GetSignName(l:group)
|
let l:sign_info.new_name = ale#sign#GetSignName(l:group)
|
||||||
let l:sign_info.items = l:group
|
let l:sign_info.items = l:group
|
||||||
|
|
||||||
if l:sign_info.current_name isnot# l:sign_info.new_name
|
let l:index = index(
|
||||||
|
\ l:sign_info.current_name_list,
|
||||||
|
\ l:sign_info.new_name
|
||||||
|
\)
|
||||||
|
|
||||||
|
if l:index >= 0
|
||||||
|
" We have a sign with this name already, so use the same ID.
|
||||||
|
let l:sign_info.new_id = l:sign_info.current_id_list[l:index]
|
||||||
|
else
|
||||||
|
" This sign name replaces the previous name, so use a new ID.
|
||||||
let l:sign_info.new_id = l:sign_offset + 1
|
let l:sign_info.new_id = l:sign_offset + 1
|
||||||
let l:sign_offset += 1
|
let l:sign_offset += 1
|
||||||
else
|
|
||||||
let l:sign_info.new_id = l:sign_info.current_id
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:sign_map[l:line] = l:sign_info
|
let l:sign_map[l:line] = l:sign_info
|
||||||
@@ -288,7 +303,7 @@ function! ale#sign#GetSignCommands(buffer, was_sign_set, sign_map) abort
|
|||||||
let l:item.sign_id = l:info.new_id
|
let l:item.sign_id = l:info.new_id
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
if l:info.new_id isnot l:info.current_id
|
if index(l:info.current_id_list, l:info.new_id) < 0
|
||||||
call add(l:command_list, 'sign place '
|
call add(l:command_list, 'sign place '
|
||||||
\ . (l:info.new_id)
|
\ . (l:info.new_id)
|
||||||
\ . ' line=' . l:line_str
|
\ . ' line=' . l:line_str
|
||||||
@@ -301,12 +316,14 @@ function! ale#sign#GetSignCommands(buffer, was_sign_set, sign_map) abort
|
|||||||
|
|
||||||
" Remove signs without new IDs.
|
" Remove signs without new IDs.
|
||||||
for l:info in values(a:sign_map)
|
for l:info in values(a:sign_map)
|
||||||
if l:info.current_id && l:info.current_id isnot l:info.new_id
|
for l:current_id in l:info.current_id_list
|
||||||
call add(l:command_list, 'sign unplace '
|
if l:current_id isnot l:info.new_id
|
||||||
\ . (l:info.current_id)
|
call add(l:command_list, 'sign unplace '
|
||||||
\ . ' buffer=' . a:buffer
|
\ . l:current_id
|
||||||
\)
|
\ . ' buffer=' . a:buffer
|
||||||
endif
|
\)
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
" Remove the dummy sign to close the sign column if we need to.
|
" Remove the dummy sign to close the sign column if we need to.
|
||||||
@@ -339,7 +356,11 @@ function! ale#sign#SetSigns(buffer, loclist) abort
|
|||||||
let l:grouped_items = s:GroupLoclistItems(a:buffer, a:loclist)
|
let l:grouped_items = s:GroupLoclistItems(a:buffer, a:loclist)
|
||||||
|
|
||||||
" Build a map of current and new signs, with the lines as the keys.
|
" Build a map of current and new signs, with the lines as the keys.
|
||||||
let l:sign_map = s:BuildSignMap(l:current_sign_list, l:grouped_items)
|
let l:sign_map = s:BuildSignMap(
|
||||||
|
\ a:buffer,
|
||||||
|
\ l:current_sign_list,
|
||||||
|
\ l:grouped_items,
|
||||||
|
\)
|
||||||
|
|
||||||
let l:command_list = ale#sign#GetSignCommands(
|
let l:command_list = ale#sign#GetSignCommands(
|
||||||
\ a:buffer,
|
\ a:buffer,
|
||||||
@@ -347,7 +368,19 @@ function! ale#sign#SetSigns(buffer, loclist) abort
|
|||||||
\ l:sign_map,
|
\ l:sign_map,
|
||||||
\)
|
\)
|
||||||
|
|
||||||
|
" Change the sign column color if the option is on.
|
||||||
|
if g:ale_change_sign_column_color && !empty(a:loclist)
|
||||||
|
highlight clear SignColumn
|
||||||
|
highlight link SignColumn ALESignColumnWithErrors
|
||||||
|
endif
|
||||||
|
|
||||||
for l:command in l:command_list
|
for l:command in l:command_list
|
||||||
silent! execute l:command
|
silent! execute l:command
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
" Reset the sign column color when there are no more errors.
|
||||||
|
if g:ale_change_sign_column_color && empty(a:loclist)
|
||||||
|
highlight clear SignColumn
|
||||||
|
highlight link SignColumn ALESignColumnWithoutErrors
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function! ale#test#SetDirectory(docker_path) abort
|
|||||||
" Try to switch directory, which will fail when running tests directly,
|
" Try to switch directory, which will fail when running tests directly,
|
||||||
" and not through the Docker image.
|
" and not through the Docker image.
|
||||||
silent! execute 'cd ' . fnameescape(a:docker_path)
|
silent! execute 'cd ' . fnameescape(a:docker_path)
|
||||||
let g:dir = getcwd()
|
let g:dir = getcwd() " no-custom-checks
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" When g:dir is defined, switch back to the directory we saved, and then
|
" When g:dir is defined, switch back to the directory we saved, and then
|
||||||
@@ -43,12 +43,12 @@ function! ale#test#SetFilename(path) abort
|
|||||||
let l:dir = get(g:, 'dir', '')
|
let l:dir = get(g:, 'dir', '')
|
||||||
|
|
||||||
if empty(l:dir)
|
if empty(l:dir)
|
||||||
let l:dir = getcwd()
|
let l:dir = getcwd() " no-custom-checks
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:full_path = ale#path#IsAbsolute(a:path)
|
let l:full_path = ale#path#IsAbsolute(a:path)
|
||||||
\ ? a:path
|
\ ? a:path
|
||||||
\ : l:dir . '/' . a:path
|
\ : l:dir . '/' . a:path
|
||||||
|
|
||||||
silent noautocmd execute 'file ' . fnameescape(ale#path#Simplify(l:full_path))
|
silent! noautocmd execute 'file ' . fnameescape(ale#path#Winify(l:full_path))
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
ALE Assembly Integration *ale-asm-options*
|
ALE ASM Integration *ale-asm-options*
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
ALE Awk Integration *ale-awk-options*
|
ALE Awk Integration *ale-awk-options*
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
gawk *ale-awk-gawk*
|
gawk *ale-awk-gawk*
|
||||||
|
|
||||||
g:ale_awk_gawk_executable *g:ale_awk_gawk_executable*
|
g:ale_awk_gawk_executable *g:ale_awk_gawk_executable*
|
||||||
*b:ale_awk_gawk_executable*
|
*b:ale_awk_gawk_executable*
|
||||||
Type: |String|
|
Type: |String|
|
||||||
Default: `'gawk'`
|
Default: `'gawk'`
|
||||||
|
|
||||||
This variable sets executable used for gawk.
|
This variable sets executable used for gawk.
|
||||||
|
|
||||||
|
|
||||||
g:ale_awk_gawk_options *g:ale_awk_gawk_options*
|
g:ale_awk_gawk_options *g:ale_awk_gawk_options*
|
||||||
*b:ale_awk_gawk_options*
|
*b:ale_awk_gawk_options*
|
||||||
Type: |String|
|
Type: |String|
|
||||||
Default: `''`
|
Default: `''`
|
||||||
|
|
||||||
|
|||||||
122
doc/ale-c.txt
122
doc/ale-c.txt
@@ -2,6 +2,37 @@
|
|||||||
ALE C Integration *ale-c-options*
|
ALE C Integration *ale-c-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
Global Options
|
||||||
|
|
||||||
|
g:ale_c_build_dir_names *g:ale_c_build_dir_names*
|
||||||
|
*b:ale_c_build_dir_names*
|
||||||
|
|
||||||
|
Type: |List|
|
||||||
|
Default: `['build', 'bin']`
|
||||||
|
|
||||||
|
A list of directory names to be used when searching upwards from cpp
|
||||||
|
files to discover compilation databases with. For directory named `'foo'`,
|
||||||
|
ALE will search for `'foo/compile_commands.json'` in all directories on and above
|
||||||
|
the directory containing the cpp file to find path to compilation database.
|
||||||
|
This feature is useful for the clang tools wrapped around LibTooling (namely
|
||||||
|
here, clang-tidy)
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_c_build_dir *g:ale_c_build_dir*
|
||||||
|
*b:ale_c_build_dir*
|
||||||
|
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
A path to the directory containing the `compile_commands.json` file to use
|
||||||
|
with c-family linters. Usually setting this option to a non-empty string
|
||||||
|
will override the |g:ale_c_build_dir_names| option to impose a compilation
|
||||||
|
database (it can be useful if multiple builds are in multiple build
|
||||||
|
subdirectories in the project tree).
|
||||||
|
This feature is also most useful for the clang tools linters, wrapped
|
||||||
|
aroung LibTooling (namely clang-tidy here)
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
clang *ale-c-clang*
|
clang *ale-c-clang*
|
||||||
|
|
||||||
@@ -21,6 +52,78 @@ g:ale_c_clang_options *g:ale_c_clang_options*
|
|||||||
This variable can be changed to modify flags given to clang.
|
This variable can be changed to modify flags given to clang.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
clang-format *ale-c-clangformat*
|
||||||
|
|
||||||
|
g:ale_c_clangformat_executable *g:ale_c_clangformat_executable*
|
||||||
|
*b:ale_c_clangformat_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'clang-format'`
|
||||||
|
|
||||||
|
This variable can be changed to use a different executable for clang-format.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_c_clangformat_options *g:ale_c_clangformat_options*
|
||||||
|
*b:ale_c_clangformat_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This variable can be change to modify flags given to clang-format.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
clangtidy *ale-c-clangtidy*
|
||||||
|
|
||||||
|
`clang-tidy` will be run only when files are saved to disk, so that
|
||||||
|
`compile_commands.json` files can be used. It is recommended to use this
|
||||||
|
linter in combination with `compile_commands.json` files.
|
||||||
|
Therefore, `clang-tidy` linter reads the options |g:ale_c_build_dir| and
|
||||||
|
|g:ale_c_build_dir_names|. Also, setting |g:ale_c_build_dir| actually
|
||||||
|
overrides |g:ale_c_build_dir_names|.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_c_clangtidy_checks *g:ale_c_clangtidy_checks*
|
||||||
|
*b:ale_c_clangtidy_checks*
|
||||||
|
Type: |List|
|
||||||
|
Default: `['*']`
|
||||||
|
|
||||||
|
The checks to enable for clang-tidy with the `-checks` argument.
|
||||||
|
|
||||||
|
All options will be joined with commas, and escaped appropriately for
|
||||||
|
the shell. The `-checks` flag can be removed entirely by setting this
|
||||||
|
option to an empty List.
|
||||||
|
|
||||||
|
Not all of clangtidy checks are applicable for C. You should consult the
|
||||||
|
clang documentation for an up-to-date list of compatible checks:
|
||||||
|
http://clang.llvm.org/extra/clang-tidy/checks/list.html
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_c_clangtidy_executable *g:ale_c_clangtidy_executable*
|
||||||
|
*b:ale_c_clangtidy_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'clang-tidy'`
|
||||||
|
|
||||||
|
This variable can be changed to use a different executable for clangtidy.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_c_clangtidy_options *g:ale_c_clangtidy_options*
|
||||||
|
*b:ale_c_clangtidy_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This variable can be changed to modify flags given to clang-tidy.
|
||||||
|
|
||||||
|
- Setting this variable to a non-empty string,
|
||||||
|
- and working in a buffer where no compilation database is found using
|
||||||
|
|g:ale_c_build_dir_names| or |g:ale_c_build_dir|,
|
||||||
|
will cause the `--` argument to be passed to `clang-tidy`, which will mean
|
||||||
|
that detection of `compile_commands.json` files for compile command
|
||||||
|
databases will be disabled.
|
||||||
|
Only set this option if you want to control compiler flags
|
||||||
|
entirely manually, and no `compile_commands.json` file is in one
|
||||||
|
of the |g:ale_c_build_dir_names| directories of the project tree.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
cppcheck *ale-c-cppcheck*
|
cppcheck *ale-c-cppcheck*
|
||||||
|
|
||||||
@@ -59,24 +162,5 @@ g:ale_c_gcc_options *g:ale_c_gcc_options*
|
|||||||
This variable can be change to modify flags given to gcc.
|
This variable can be change to modify flags given to gcc.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
|
||||||
clang-format *ale-c-clangformat*
|
|
||||||
|
|
||||||
g:ale_c_clangformat_executable *g:ale_c_clangformat_executable*
|
|
||||||
*b:ale_c_clangformat_executable*
|
|
||||||
Type: |String|
|
|
||||||
Default: `'clang-format'`
|
|
||||||
|
|
||||||
This variable can be changed to use a different executable for clang-format.
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_c_clangformat_options *g:ale_c_clangformat_options*
|
|
||||||
*b:ale_c_clangformat_options*
|
|
||||||
Type: |String|
|
|
||||||
Default: `''`
|
|
||||||
|
|
||||||
This variable can be change to modify flags given to clang-format.
|
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ ALE Chef Integration *ale-chef-options*
|
|||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
foodcritc *ale-chef-foodcritic*
|
foodcritic *ale-chef-foodcritic*
|
||||||
|
|
||||||
g:ale_chef_foodcritic_options *g:ale_chef_foodcritic_options*
|
g:ale_chef_foodcritic_options *g:ale_chef_foodcritic_options*
|
||||||
*b:ale_chef_foodcritic_options*
|
*b:ale_chef_foodcritic_options*
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ ALE CMake Integration *ale-cmake-options*
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
cmakelint *ale-cmake-cmakelint*
|
cmakelint *ale-cmake-cmakelint*
|
||||||
|
|
||||||
g:ale_cmake_cmakelint_exectuable *g:ale_cmake_cmakelint_executable*
|
g:ale_cmake_cmakelint_executable *g:ale_cmake_cmakelint_executable*
|
||||||
*b:ale_cmake_cmakelint_executable*
|
*b:ale_cmake_cmakelint_executable*
|
||||||
Type: |String|
|
Type: |String|
|
||||||
Default: `'cmakelint'`
|
Default: `'cmakelint'`
|
||||||
|
|||||||
@@ -5,33 +5,9 @@ ALE C++ Integration *ale-cpp-options*
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
Global Options
|
Global Options
|
||||||
|
|
||||||
g:ale_c_build_dir_names *g:ale_c_build_dir_names*
|
The |g:ale_c_build_dir_names| and |g:ale_c_build_dir| also apply to some C++
|
||||||
*b:ale_c_build_dir_names*
|
linters too.
|
||||||
|
|
||||||
Type: |List|
|
|
||||||
Default: `['build', 'bin']`
|
|
||||||
|
|
||||||
A list of directory names to be used when searching upwards from cpp
|
|
||||||
files to discover compilation databases with. For directory named `'foo'`,
|
|
||||||
ALE will search for `'foo/compile_commands.json'` in all directories on and above
|
|
||||||
the directory containing the cpp file to find path to compilation database.
|
|
||||||
This feature is useful for the clang tools wrapped around LibTooling (namely
|
|
||||||
here, clang-tidy)
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_c_build_dir *g:ale_c_build_dir*
|
|
||||||
*b:ale_c_build_dir*
|
|
||||||
|
|
||||||
Type: |String|
|
|
||||||
Default: `''`
|
|
||||||
|
|
||||||
A path to the directory containing the `compile_commands.json` file to use
|
|
||||||
with c-family linters. Usually setting this option to a non-empty string
|
|
||||||
will override the |g:ale_c_build_dir_names| option to impose a compilation
|
|
||||||
database (it can be useful if multiple builds are in multiple build
|
|
||||||
subdirectories in the project tree).
|
|
||||||
This feature is also most useful for the clang tools linters, wrapped
|
|
||||||
aroung LibTooling (namely clang-tidy here)
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
clang *ale-cpp-clang*
|
clang *ale-cpp-clang*
|
||||||
@@ -83,6 +59,13 @@ g:ale_cpp_clangcheck_options *g:ale_cpp_clangcheck_options*
|
|||||||
option.
|
option.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
clang-format *ale-cpp-clangformat*
|
||||||
|
|
||||||
|
See |ale-c-clangformat| for information about the available options.
|
||||||
|
Note that the C options are also used for C++.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
clangtidy *ale-cpp-clangtidy*
|
clangtidy *ale-cpp-clangtidy*
|
||||||
|
|
||||||
@@ -189,12 +172,5 @@ g:ale_cpp_gcc_options *g:ale_cpp_gcc_options*
|
|||||||
This variable can be changed to modify flags given to gcc.
|
This variable can be changed to modify flags given to gcc.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
|
||||||
clang-format *ale-cpp-clangformat*
|
|
||||||
|
|
||||||
See |ale-c-clangformat| for information about the available options.
|
|
||||||
Note that the C options are also used for C++.
|
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
|
|||||||
102
doc/ale-cs.txt
Normal file
102
doc/ale-cs.txt
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
===============================================================================
|
||||||
|
ALE C# Integration *ale-cs-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
mcs *ale-cs-mcs*
|
||||||
|
|
||||||
|
The mcs linter checks the syntax of the '*.cs' file loaded in the current
|
||||||
|
buffer only. It uses the --parse option of the mcs compiler and implicitly
|
||||||
|
sets the -unsafe flag.
|
||||||
|
|
||||||
|
g:ale_cs_mcs_options *g:ale_cs_mcs_options*
|
||||||
|
*b:ale_cs_mcs_options*
|
||||||
|
|
||||||
|
Type: String
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This variable can be changed to pass additional flags given to mcs.
|
||||||
|
|
||||||
|
NOTE: The -unsafe flag is selected implicitly and thus does not need to be
|
||||||
|
explicitly included in the |g:ale_cs_mcs_options| or |b:ale_cs_mcs_options|
|
||||||
|
parameter.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
mcsc *ale-cs-mcsc*
|
||||||
|
|
||||||
|
The mcsc linter uses the mono mcs compiler to generate a temporary module
|
||||||
|
target file (-t:module). The module includes including all '*.cs' files
|
||||||
|
contained in the directory tree rooted at the path defined by the
|
||||||
|
|g:ale_cs_mcsc_source| or |b:ale_cs_mcsc_source| variable.
|
||||||
|
variable and all sub directories.
|
||||||
|
|
||||||
|
The paths to search for additional assembly ('*.dll') files can be
|
||||||
|
specified using the |g:ale_cs_mcsc_assembly_path| or
|
||||||
|
|b:ale_cs_mcsc_assembly_path| variable. The additional assembly files ('*.dll')
|
||||||
|
can be included through the |g:ale_cs_mcsc_assemblies| or
|
||||||
|
|b:ale_cs_mcsc_assemblies| parameter.
|
||||||
|
|
||||||
|
NOTE: mcs compiles sources in multiple phases. It stops compilation after
|
||||||
|
finding errors during the current phase.
|
||||||
|
For example assume a file named 'FileWithTypeError.cs' is edited and saved
|
||||||
|
which contains a Type error. In the same directory tree a file named
|
||||||
|
'FileWithSyntaxError.cs' exists which contains a syntax error
|
||||||
|
(eg.: a missing '{').
|
||||||
|
In that case mcs and thus mcsc linter will stop after the syntax check phase is
|
||||||
|
finished and report the syntax error in the file 'FileWithSyntaxError.cs'. The
|
||||||
|
Type error in the file 'FileWithTypeError.cs is not seen jet.
|
||||||
|
The only possibility to find the error in in 'FileWithTypeError.cs' is to fix
|
||||||
|
the syntax error in 'FileWithSyntaxError.cs' first. After saving mcs will
|
||||||
|
successfully pass the syntax check phase and advance to the next compilation
|
||||||
|
phase at which the Type error hidden in 'FileWithTypeError.cs' is found and
|
||||||
|
now can be indicated by ale.
|
||||||
|
|
||||||
|
g:ale_cs_mcsc_options *g:ale_cs_mcsc_options*
|
||||||
|
*b:ale_cs_mcsc_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This parameter can be used to define additional flags and parameters independent
|
||||||
|
of the source tree to be linted. The specified string is directly passed to
|
||||||
|
mcs compiler without any further change.
|
||||||
|
|
||||||
|
For example, to add the dotnet package which is not added per default
|
||||||
|
|
||||||
|
let g:ale_cs_mcs_options = '-pkg:dotnet'
|
||||||
|
|
||||||
|
NOTE: The mcs -unsafe option is included implicitly per default. Therefore it
|
||||||
|
is not necessary to specify it explicitly through the |g:ale_cs_mcsc_options|
|
||||||
|
or |b:ale_cs_mcsc_options| parameter.
|
||||||
|
|
||||||
|
g:ale_cs_mcsc_source *g:ale_cs_mcsc_source*
|
||||||
|
*b:ale_cs_mcsc_source*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This variable defines the root path of the directory tree searched for the
|
||||||
|
'*.cs' files to be linted. If empty the current working directory is used.
|
||||||
|
|
||||||
|
NOTE: Currently it is not possible to specify sub directories and
|
||||||
|
directory sub trees which shall not be searched for *.cs files.
|
||||||
|
|
||||||
|
g:ale_cs_mcsc_assembly_path *g:ale_cs_mcsc_assembly_path*
|
||||||
|
*b:ale_cs_mcsc_assembly_path*
|
||||||
|
Type: |List|
|
||||||
|
Default: `[]`
|
||||||
|
|
||||||
|
This variable defines a list of path strings to be searched for external
|
||||||
|
assembly ('*.dll') files. The list is passed to the mcs compiler using the
|
||||||
|
'-lib:' flag.
|
||||||
|
|
||||||
|
g:ale_cs_mcsc_assemblies *g:ale_cs_mcsc_assemblies*
|
||||||
|
*b:ale_cs_mcsc_assemblies*
|
||||||
|
Type: |List|
|
||||||
|
Default: `[]`
|
||||||
|
|
||||||
|
This variable defines a list of external assembly (*.dll) files required
|
||||||
|
by the mono mcs compiler to generate a valid module target. The list is
|
||||||
|
passed the mcs compiler using the '-r:' flag.
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
@@ -2,6 +2,12 @@
|
|||||||
ALE CSS Integration *ale-css-options*
|
ALE CSS Integration *ale-css-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
prettier *ale-css-prettier*
|
||||||
|
|
||||||
|
See |ale-javascript-prettier| for information about the available options.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
stylelint *ale-css-stylelint*
|
stylelint *ale-css-stylelint*
|
||||||
|
|
||||||
@@ -13,8 +19,8 @@ g:ale_css_stylelint_executable *g:ale_css_stylelint_executable*
|
|||||||
See |ale-integrations-local-executables|
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
g:ale_css_stylelint_options *g:ale_css_stylelint_options*
|
g:ale_css_stylelint_options *g:ale_css_stylelint_options*
|
||||||
*b:ale_css_stylelint_options*
|
*b:ale_css_stylelint_options*
|
||||||
Type: |String|
|
Type: |String|
|
||||||
Default: `''`
|
Default: `''`
|
||||||
|
|
||||||
|
|||||||
25
doc/ale-cuda.txt
Normal file
25
doc/ale-cuda.txt
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
===============================================================================
|
||||||
|
ALE CUDA Integration *ale-cuda-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
nvcc *ale-cuda-nvcc*
|
||||||
|
|
||||||
|
g:ale_cuda_nvcc_executable *g:ale_cuda_nvcc_executable*
|
||||||
|
*b:ale_cuda_nvcc_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'nvcc'`
|
||||||
|
|
||||||
|
This variable can be changed to use a different executable for nvcc.
|
||||||
|
Currently only nvcc 8.0 is supported.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_cuda_nvcc_options *g:ale_cuda_nvcc_options*
|
||||||
|
*b:ale_cuda_nvcc_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'-std=c++11'`
|
||||||
|
|
||||||
|
This variable can be changed to modify flags given to nvcc.
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
50
doc/ale-elm.txt
Normal file
50
doc/ale-elm.txt
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
===============================================================================
|
||||||
|
ALE Elm Integration *ale-elm-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
elm-format *ale-elm-elm-format*
|
||||||
|
|
||||||
|
g:ale_elm_format_executable *g:ale_elm_format_executable*
|
||||||
|
*b:ale_elm_format_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'elm-format'`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_elm_format_use_global *g:ale_elm_format_use_global*
|
||||||
|
*b:ale_elm_format_use_global*
|
||||||
|
Type: |Number|
|
||||||
|
Default: `0`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_elm_format_options *g:ale_elm_format_options*
|
||||||
|
*b:ale_elm_format_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'--yes'`
|
||||||
|
|
||||||
|
This variable can be set to pass additional options to elm-format.
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
elm-make *ale-elm-elm-make*
|
||||||
|
|
||||||
|
g:ale_elm_make_executable *g:ale_elm_make_executable*
|
||||||
|
*b:ale_elm_make_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'elm-make'`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_elm_make_use_global *g:ale_elm_make_use_global*
|
||||||
|
*b:ale_elm_make_use_global*
|
||||||
|
Type: |Number|
|
||||||
|
Default: `0`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
@@ -3,7 +3,7 @@ ALE FusionScript Integration *ale-fuse-options*
|
|||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
4.12. fusionlint *ale-fuse-fusionlint*
|
fusion-lint *ale-fuse-fusionlint*
|
||||||
|
|
||||||
g:ale_fusion_fusionlint_executable *g:ale_fuse_fusionlint_executable*
|
g:ale_fusion_fusionlint_executable *g:ale_fuse_fusionlint_executable*
|
||||||
*b:ale_fuse_fusionlint_executable*
|
*b:ale_fuse_fusionlint_executable*
|
||||||
|
|||||||
36
doc/ale-glsl.txt
Normal file
36
doc/ale-glsl.txt
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
===============================================================================
|
||||||
|
ALE GLSL Integration *ale-glsl-options*
|
||||||
|
*ale-integration-glsl*
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
Integration Information
|
||||||
|
|
||||||
|
Since Vim does not detect the glsl file types out-of-the-box, you need the
|
||||||
|
runtime files for glsl from here: https://github.com/tikhomirov/vim-glsl
|
||||||
|
|
||||||
|
Note that the current glslang-based linter expects glslangValidator in
|
||||||
|
standard paths. If it's not installed system-wide you can set
|
||||||
|
|g:ale_glsl_glslang_executable| to a specific path.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
glslang *ale-glsl-glslang*
|
||||||
|
|
||||||
|
g:ale_glsl_glslang_executable *g:ale_glsl_glslang_executable*
|
||||||
|
*b:ale_glsl_glslang_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'glslangValidator'`
|
||||||
|
|
||||||
|
This variable can be changed to change the path to glslangValidator.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_glsl_glslang_options *g:ale_glsl_glslang_options*
|
||||||
|
*b:ale_glsl_glslang_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This variable can be set to pass additional options to glslangValidator.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
@@ -20,6 +20,16 @@ the benefit of running a number of linters, more than ALE would by default,
|
|||||||
while ensuring it doesn't run any linters known to be slow or resource
|
while ensuring it doesn't run any linters known to be slow or resource
|
||||||
intensive.
|
intensive.
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
gofmt *ale-go-gofmt*
|
||||||
|
|
||||||
|
g:ale_go_gofmt_options *g:ale_go_gofmt_options*
|
||||||
|
*b:ale_go_gofmt_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This variable can be set to pass additional options to the gofmt fixer.
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
gometalinter *ale-go-gometalinter*
|
gometalinter *ale-go-gometalinter*
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,6 @@
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
ALE Haskell Integration *ale-haskell-options*
|
ALE Haskell Integration *ale-haskell-options*
|
||||||
|
|
||||||
===============================================================================
|
|
||||||
stack-build *ale-haskell-stack-build*
|
|
||||||
|
|
||||||
g:ale_haskell_stack_build_options *g:ale_haskell_stack_build_options*
|
|
||||||
*b:ale_haskell_stack_build_options*
|
|
||||||
Type: |String|
|
|
||||||
Default: `'--fast'`
|
|
||||||
|
|
||||||
We default to using `'--fast'`. Since Stack generates binaries, your
|
|
||||||
programs will be slower unless you separately rebuild them outside of ALE.
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
hdevtools *ale-haskell-hdevtools*
|
hdevtools *ale-haskell-hdevtools*
|
||||||
@@ -30,5 +20,17 @@ g:ale_haskell_hdevtools_options *g:ale_haskell_hdevtools_options*
|
|||||||
|
|
||||||
This variable can be changed to modify flags given to hdevtools.
|
This variable can be changed to modify flags given to hdevtools.
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
stack-build *ale-haskell-stack-build*
|
||||||
|
|
||||||
|
g:ale_haskell_stack_build_options *g:ale_haskell_stack_build_options*
|
||||||
|
*b:ale_haskell_stack_build_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'--fast'`
|
||||||
|
|
||||||
|
We default to using `'--fast'`. Since Stack generates binaries, your
|
||||||
|
programs will be slower unless you separately rebuild them outside of ALE.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
|
|||||||
@@ -60,105 +60,6 @@ g:ale_javascript_eslint_suppress_eslintignore
|
|||||||
the current file due to being covered by `.eslintignore`.
|
the current file due to being covered by `.eslintignore`.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
|
||||||
prettier *ale-javascript-prettier*
|
|
||||||
|
|
||||||
g:ale_javascript_prettier_executable *g:ale_javascript_prettier_executable*
|
|
||||||
*b:ale_javascript_prettier_executable*
|
|
||||||
Type: |String|
|
|
||||||
Default: `'prettier'`
|
|
||||||
|
|
||||||
See |ale-integrations-local-executables|
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_javascript_prettier_options *g:ale_javascript_prettier_options*
|
|
||||||
*b:ale_javascript_prettier_options*
|
|
||||||
Type: |String|
|
|
||||||
Default: `''`
|
|
||||||
|
|
||||||
This variable can be set to pass additional options to prettier.
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_javascript_prettier_use_global *g:ale_javascript_prettier_use_global*
|
|
||||||
*b:ale_javascript_prettier_use_global*
|
|
||||||
Type: |Number|
|
|
||||||
Default: `0`
|
|
||||||
|
|
||||||
See |ale-integrations-local-executables|
|
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
|
||||||
prettier-eslint *ale-javascript-prettier-eslint*
|
|
||||||
|
|
||||||
ALE supports `prettier-eslint` for easy integration with projects, but it is
|
|
||||||
not recommended for new projects. ALE instead recommends configuring
|
|
||||||
|g:ale_fixers| to run `'prettier'` and `'eslint'` in a sequence like so: >
|
|
||||||
|
|
||||||
let g:ale_fixers = {'javascript': ['prettier', 'eslint']}
|
|
||||||
<
|
|
||||||
|
|
||||||
This is because `prettier-eslint` cannot be configured to use the ESLint
|
|
||||||
configuration file for input given via stdin, which is how ALE integrates with
|
|
||||||
the tool.
|
|
||||||
|
|
||||||
g:ale_javascript_prettier_eslint_executable
|
|
||||||
*g:ale_javascript_prettier_eslint_executable*
|
|
||||||
*b:ale_javascript_prettier_eslint_executable*
|
|
||||||
Type: |String|
|
|
||||||
Default: `'prettier-eslint'`
|
|
||||||
|
|
||||||
See |ale-integrations-local-executables|
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_javascript_prettier_eslint_options
|
|
||||||
*g:ale_javascript_prettier_eslint_options*
|
|
||||||
*b:ale_javascript_prettier_eslint_options*
|
|
||||||
Type: |String|
|
|
||||||
Default: `''`
|
|
||||||
|
|
||||||
This variable can be set to pass additional options to prettier-eslint.
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_javascript_prettier_eslint_use_global
|
|
||||||
*g:ale_javascript_prettier_eslint_use_global*
|
|
||||||
*b:ale_javascript_prettier_eslint_use_global*
|
|
||||||
Type: |Number|
|
|
||||||
Default: `0`
|
|
||||||
|
|
||||||
See |ale-integrations-local-executables|
|
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
|
||||||
prettier-standard *ale-javascript-prettier-standard*
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_javascript_prettier_standard_executable
|
|
||||||
*g:ale_javascript_prettier_standard_executable*
|
|
||||||
*b:ale_javascript_prettier_standard_executable*
|
|
||||||
Type: |String|
|
|
||||||
Default: `'prettier-standard'`
|
|
||||||
|
|
||||||
See |ale-integrations-local-executables|
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_javascript_prettier_standard_options
|
|
||||||
*g:ale_javascript_prettier_standard_options*
|
|
||||||
*b:ale_javascript_prettier_standard_options*
|
|
||||||
Type: |String|
|
|
||||||
Default: `''`
|
|
||||||
|
|
||||||
This variable can be set to pass additional options to prettier-standard.
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_javascript_prettier_standard_use_global
|
|
||||||
*g:ale_javascript_prettier_standard_use_global*
|
|
||||||
*b:ale_javascript_prettier_standard_use_global*
|
|
||||||
Type: |Number|
|
|
||||||
Default: `0`
|
|
||||||
|
|
||||||
See |ale-integrations-local-executables|
|
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
flow *ale-javascript-flow*
|
flow *ale-javascript-flow*
|
||||||
|
|
||||||
@@ -216,6 +117,117 @@ g:ale_javascript_jshint_use_global *g:ale_javascript_jshint_use_global*
|
|||||||
See |ale-integrations-local-executables|
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
prettier *ale-javascript-prettier*
|
||||||
|
|
||||||
|
g:ale_javascript_prettier_executable *g:ale_javascript_prettier_executable*
|
||||||
|
*b:ale_javascript_prettier_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'prettier'`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_javascript_prettier_options *g:ale_javascript_prettier_options*
|
||||||
|
*b:ale_javascript_prettier_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This variable can be set to pass additional options to prettier.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_javascript_prettier_use_global *g:ale_javascript_prettier_use_global*
|
||||||
|
*b:ale_javascript_prettier_use_global*
|
||||||
|
Type: |Number|
|
||||||
|
Default: `0`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
g:ale_javascript_prettier_use_local_config
|
||||||
|
*g:ale_javascript_prettier_use_local_config*
|
||||||
|
*b:ale_javascript_prettier_use_local_config*
|
||||||
|
Type: |Number|
|
||||||
|
Default: `0`
|
||||||
|
|
||||||
|
This variable can be set to use the local prettier configuration file.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
prettier-eslint *ale-javascript-prettier-eslint*
|
||||||
|
|
||||||
|
ALE supports `prettier-eslint` >= 4.2.0. Using lower version is not recommended
|
||||||
|
because it cannot be configured to use the ESLint configuration file for input
|
||||||
|
given via stdin. However ALE could be set up on your own risk with older
|
||||||
|
versions with |g:ale_javascript_prettier_eslint_legacy|
|
||||||
|
|
||||||
|
g:ale_javascript_prettier_eslint_executable
|
||||||
|
*g:ale_javascript_prettier_eslint_executable*
|
||||||
|
*b:ale_javascript_prettier_eslint_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'prettier-eslint'`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_javascript_prettier_eslint_options
|
||||||
|
*g:ale_javascript_prettier_eslint_options*
|
||||||
|
*b:ale_javascript_prettier_eslint_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This variable can be set to pass additional options to prettier-eslint.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_javascript_prettier_eslint_use_global
|
||||||
|
*g:ale_javascript_prettier_eslint_use_global*
|
||||||
|
*b:ale_javascript_prettier_eslint_use_global*
|
||||||
|
Type: |Number|
|
||||||
|
Default: `0`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
g:ale_javascript_prettier_eslint_legacy
|
||||||
|
*g:ale_javascript_prettier_eslint_legacy*
|
||||||
|
*b:ale_javascript_prettier_eslint_legacy*
|
||||||
|
Type: |Number|
|
||||||
|
Default: `0`
|
||||||
|
|
||||||
|
Fallback option for `prettier-eslint` < 4.2.0
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
prettier-standard *ale-javascript-prettier-standard*
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_javascript_prettier_standard_executable
|
||||||
|
*g:ale_javascript_prettier_standard_executable*
|
||||||
|
*b:ale_javascript_prettier_standard_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'prettier-standard'`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_javascript_prettier_standard_options
|
||||||
|
*g:ale_javascript_prettier_standard_options*
|
||||||
|
*b:ale_javascript_prettier_standard_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This variable can be set to pass additional options to prettier-standard.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_javascript_prettier_standard_use_global
|
||||||
|
*g:ale_javascript_prettier_standard_use_global*
|
||||||
|
*b:ale_javascript_prettier_standard_use_global*
|
||||||
|
Type: |Number|
|
||||||
|
Default: `0`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
standard *ale-javascript-standard*
|
standard *ale-javascript-standard*
|
||||||
|
|
||||||
|
|||||||
18
doc/ale-json.txt
Normal file
18
doc/ale-json.txt
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
===============================================================================
|
||||||
|
ALE JSON Integration *ale-json-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
jsonlint *ale-json-jsonlint*
|
||||||
|
|
||||||
|
There are no options available.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
prettier *ale-json-prettier*
|
||||||
|
|
||||||
|
See |ale-javascript-prettier| for information about the available options.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
12
doc/ale-less.txt
Normal file
12
doc/ale-less.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
===============================================================================
|
||||||
|
ALE Less Integration *ale-less-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
prettier *ale-less-prettier*
|
||||||
|
|
||||||
|
See |ale-javascript-prettier| for information about the available options.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
19
doc/ale-llvm.txt
Normal file
19
doc/ale-llvm.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
===============================================================================
|
||||||
|
ALE LLVM Integration *ale-llvm-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
llc *ale-llvm-llc*
|
||||||
|
|
||||||
|
g:ale_llvm_llc_executable *g:ale_llvm_llc_executable*
|
||||||
|
*b:ale_llvm_llc_executable*
|
||||||
|
|
||||||
|
Type: |String|
|
||||||
|
Default: "llc"
|
||||||
|
|
||||||
|
The command to use for checking. This variable is useful when llc command
|
||||||
|
has suffix like "llc-5.0".
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
@@ -3,7 +3,7 @@ ALE Lua Integration *ale-lua-options*
|
|||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
4.12. luacheck *ale-lua-luacheck*
|
luacheck *ale-lua-luacheck*
|
||||||
|
|
||||||
g:ale_lua_luacheck_executable *g:ale_lua_luacheck_executable*
|
g:ale_lua_luacheck_executable *g:ale_lua_luacheck_executable*
|
||||||
*b:ale_lua_luacheck_executable*
|
*b:ale_lua_luacheck_executable*
|
||||||
|
|||||||
130
doc/ale-php.txt
130
doc/ale-php.txt
@@ -35,67 +35,6 @@ g:ale_php_langserver_use_global *g:ale_php_langserver_use_global*
|
|||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
phpcs *ale-php-phpcs*
|
|
||||||
|
|
||||||
g:ale_php_phpcs_executable *g:ale_php_phpcs_executable*
|
|
||||||
*b:ale_php_phpcs_executable*
|
|
||||||
Type: |String|
|
|
||||||
Default: `'phpcs'`
|
|
||||||
|
|
||||||
See |ale-integrations-local-executables|
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_php_phpcs_standard *g:ale_php_phpcs_standard*
|
|
||||||
*b:ale_php_phpcs_standard*
|
|
||||||
Type: |String|
|
|
||||||
Default: `''`
|
|
||||||
|
|
||||||
This variable can be set to specify the coding standard used by phpcs. If no
|
|
||||||
coding standard is specified, phpcs will default to checking against the
|
|
||||||
PEAR coding standard, or the standard you have set as the default.
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_php_phpcs_use_global *g:ale_php_phpcs_use_global*
|
|
||||||
*b:ale_php_phpcs_use_global*
|
|
||||||
Type: |Number|
|
|
||||||
Default: `0`
|
|
||||||
|
|
||||||
See |ale-integrations-local-executables|
|
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
phpmd *ale-php-phpmd*
|
|
||||||
|
|
||||||
g:ale_php_phpmd_ruleset *g:ale_php_phpmd_ruleset*
|
|
||||||
*b:ale_php_phpmd_ruleset*
|
|
||||||
Type: |String|
|
|
||||||
Default: `'cleancode,codesize,controversial,design,naming,unusedcode'`
|
|
||||||
|
|
||||||
This variable controls the ruleset used by phpmd. Default is to use all of
|
|
||||||
the available phpmd rulesets
|
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
phpstan *ale-php-phpstan*
|
|
||||||
|
|
||||||
g:ale_php_phpstan_executable *g:ale_php_phpstan_executable*
|
|
||||||
*b:ale_php_phpstan_executable*
|
|
||||||
Type: |String|
|
|
||||||
Default: `'phpstan'`
|
|
||||||
|
|
||||||
This variable sets executable used for phpstan.
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_php_phpstan_level *g:ale_php_phpstan_level*
|
|
||||||
*b:ale_php_phpstan_level*
|
|
||||||
Type: |Number|
|
|
||||||
Default: `4`
|
|
||||||
|
|
||||||
This variable controls the rule levels. 0 is the loosest and 4 is the
|
|
||||||
strictest.
|
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
phpcbf *ale-php-phpcbf*
|
phpcbf *ale-php-phpcbf*
|
||||||
|
|
||||||
g:ale_php_phpcbf_executable *g:ale_php_phpcbf_executable*
|
g:ale_php_phpcbf_executable *g:ale_php_phpcbf_executable*
|
||||||
@@ -124,5 +63,74 @@ g:ale_php_phpcbf_use_global *g:ale_php_phpcbf_use_global*
|
|||||||
See |ale-integrations-local-executables|
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
phpcs *ale-php-phpcs*
|
||||||
|
|
||||||
|
g:ale_php_phpcs_executable *g:ale_php_phpcs_executable*
|
||||||
|
*b:ale_php_phpcs_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'phpcs'`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_php_phpcs_standard *g:ale_php_phpcs_standard*
|
||||||
|
*b:ale_php_phpcs_standard*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This variable can be set to specify the coding standard used by phpcs. If no
|
||||||
|
coding standard is specified, phpcs will default to checking against the
|
||||||
|
PEAR coding standard, or the standard you have set as the default.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_php_phpcs_use_global *g:ale_php_phpcs_use_global*
|
||||||
|
*b:ale_php_phpcs_use_global*
|
||||||
|
Type: |Number|
|
||||||
|
Default: `0`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
phpmd *ale-php-phpmd*
|
||||||
|
|
||||||
|
g:ale_php_phpmd_ruleset *g:ale_php_phpmd_ruleset*
|
||||||
|
*b:ale_php_phpmd_ruleset*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'cleancode,codesize,controversial,design,naming,unusedcode'`
|
||||||
|
|
||||||
|
This variable controls the ruleset used by phpmd. Default is to use all of
|
||||||
|
the available phpmd rulesets
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
phpstan *ale-php-phpstan*
|
||||||
|
|
||||||
|
g:ale_php_phpstan_executable *g:ale_php_phpstan_executable*
|
||||||
|
*b:ale_php_phpstan_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'phpstan'`
|
||||||
|
|
||||||
|
This variable sets executable used for phpstan.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_php_phpstan_level *g:ale_php_phpstan_level*
|
||||||
|
*b:ale_php_phpstan_level*
|
||||||
|
Type: |Number|
|
||||||
|
Default: `4`
|
||||||
|
|
||||||
|
This variable controls the rule levels. 0 is the loosest and 4 is the
|
||||||
|
strictest.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_php_phpstan_configuration *g:ale_php_phpstan_configuration*
|
||||||
|
*b:ale_php_phpstan_configuration*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This variable sets path to phpstan configuration file.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
|
|||||||
20
doc/ale-r.txt
Normal file
20
doc/ale-r.txt
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
===============================================================================
|
||||||
|
ALE R Integration *ale-r-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
lintr *ale-r-lintr*
|
||||||
|
|
||||||
|
g:ale_r_lintr_options *g:ale_r_lintr_options*
|
||||||
|
*b:ale_r_lintr_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'lintr::with_defaults()'`
|
||||||
|
|
||||||
|
This option can be configured to change the options for lintr.
|
||||||
|
|
||||||
|
The value of this option will be run with `eval` for the `lintr::lint`
|
||||||
|
options. Consult the lintr documentation for more information.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
@@ -20,7 +20,7 @@ Integration Information
|
|||||||
while you type.
|
while you type.
|
||||||
3. rls -- If you have `rls` installed, you might prefer using this linter
|
3. rls -- If you have `rls` installed, you might prefer using this linter
|
||||||
over cargo. rls implements the Language Server Protocol for incremental
|
over cargo. rls implements the Language Server Protocol for incremental
|
||||||
compliation of Rust code, and can check Rust files while you type. `rls`
|
compilation of Rust code, and can check Rust files while you type. `rls`
|
||||||
requires Rust files to contained in Cargo projects.
|
requires Rust files to contained in Cargo projects.
|
||||||
|
|
||||||
Only cargo is enabled by default. To switch to using rustc instead of cargo,
|
Only cargo is enabled by default. To switch to using rustc instead of cargo,
|
||||||
|
|||||||
@@ -5,14 +5,28 @@ ALE Scala Integration *ale-scala-options*
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
scalastyle *ale-scala-scalastyle*
|
scalastyle *ale-scala-scalastyle*
|
||||||
|
|
||||||
|
`scalastyle` requires a configuration file for a project to run. When no
|
||||||
|
configuration file can be found, ALE will report a problem saying that a
|
||||||
|
configuration file is required at line 1.
|
||||||
|
|
||||||
|
To disable `scalastyle` globally, use |g:ale_linters| like so: >
|
||||||
|
let g:ale_linters = {'scala': ['scalac']} " Enable only scalac instead
|
||||||
|
<
|
||||||
|
|
||||||
|
See |g:ale_linters| for more information on disabling linters.
|
||||||
|
|
||||||
|
|
||||||
g:ale_scalastyle_config_loc *g:ale_scalastyle_config_loc*
|
g:ale_scalastyle_config_loc *g:ale_scalastyle_config_loc*
|
||||||
|
|
||||||
Type: |String|
|
Type: |String|
|
||||||
Default: `''`
|
Default: `''`
|
||||||
|
|
||||||
A string containing the location of a global fallback config file.
|
A string containing the location of a global fallback configuration file.
|
||||||
By default, ALE will look for a config file named `scalastyle_config.xml` or
|
|
||||||
`scalastyle-config.xml` in the current file's directory or parent directories.
|
By default, ALE will look for a configuration file named
|
||||||
|
`scalastyle_config.xml` or `scalastyle-config.xml` in the current file's
|
||||||
|
directory or parent directories.
|
||||||
|
|
||||||
|
|
||||||
g:ale_scala_scalastyle_options *g:ale_scala_scalastyle_options*
|
g:ale_scala_scalastyle_options *g:ale_scala_scalastyle_options*
|
||||||
|
|
||||||
@@ -21,5 +35,6 @@ g:ale_scala_scalastyle_options *g:ale_scala_scalastyle_options*
|
|||||||
|
|
||||||
A string containing additional options to pass to scalastyle.
|
A string containing additional options to pass to scalastyle.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
@@ -2,6 +2,12 @@
|
|||||||
ALE SCSS Integration *ale-scss-options*
|
ALE SCSS Integration *ale-scss-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
prettier *ale-scss-prettier*
|
||||||
|
|
||||||
|
See |ale-javascript-prettier| for information about the available options.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
stylelint *ale-scss-stylelint*
|
stylelint *ale-scss-stylelint*
|
||||||
|
|
||||||
|
|||||||
36
doc/ale-sml.txt
Normal file
36
doc/ale-sml.txt
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
===============================================================================
|
||||||
|
ALE SML Integration *ale-sml-options*
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
smlnj *ale-sml-smlnj*
|
||||||
|
*ale-sml-smlnj-cm*
|
||||||
|
|
||||||
|
There are two SML/NJ powered checkers:
|
||||||
|
|
||||||
|
- one using Compilation Manager that works on whole projects, but requires you
|
||||||
|
to save before errors show up
|
||||||
|
- one using the SML/NJ REPL that works as you change the text, but might fail
|
||||||
|
if your project can only be built with CM.
|
||||||
|
|
||||||
|
We dynamically select which one to use based whether we find a `*.cm` file at
|
||||||
|
or above the directory of the file being checked. Only one checker (`smlnj`,
|
||||||
|
`smlnj-cm`) will be enabled at a time.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
g:ale_sml_smlnj_cm_file *g:ale_sml_smlnj_cm_file*
|
||||||
|
*b:ale_sml_smlnj_cm_file*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'*.cm'`
|
||||||
|
|
||||||
|
By default, ALE will look for a `*.cm` file in your current directory,
|
||||||
|
searching upwards. It stops when it finds at least one `*.cm` file (taking
|
||||||
|
the first file if there are more than one).
|
||||||
|
|
||||||
|
Change this option (in the buffer or global scope) to control how ALE finds
|
||||||
|
CM files. For example, to always search for a CM file named `sandbox.cm`:
|
||||||
|
>
|
||||||
|
let g:ale_sml_smlnj_cm_file = 'sandbox.cm'
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
16
doc/ale-solidity.txt
Normal file
16
doc/ale-solidity.txt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
===============================================================================
|
||||||
|
ALE Solidity Integration *ale-solidity-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
solium *ale-solidity-solium*
|
||||||
|
|
||||||
|
Use of Solium linter for Solidity source code requires a .soliumrc.json
|
||||||
|
file in project root. This file can be generated by running `solium --init`.
|
||||||
|
See the corresponding solium usage for detailed instructions
|
||||||
|
(https://github.com/duaraghav8/Solium#usage).
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
ALE RPM Spec Integration *ale-spec-options*
|
ALE Spec Integration *ale-spec-options*
|
||||||
*ale-integration-spec*
|
*ale-integration-spec*
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
ALE CSS Integration *ale-stylus-options*
|
ALE Stylus Integration *ale-stylus-options*
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
|
|||||||
46
doc/ale-thrift.txt
Normal file
46
doc/ale-thrift.txt
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
===============================================================================
|
||||||
|
ALE Thrift Integration *ale-thrift-options*
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
thrift *ale-thrift-thrift*
|
||||||
|
|
||||||
|
The `thrift` linter works by compiling the buffer's contents and reporting any
|
||||||
|
errors reported by the parser and the configured code generator(s).
|
||||||
|
|
||||||
|
g:ale_thrift_thrift_executable *g:ale_thrift_thrift_executable*
|
||||||
|
*b:ale_thrift_thrift_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'thrift'`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_thrift_thrift_generators *g:ale_thrift_thrift_generators*
|
||||||
|
*b:ale_thrift_thrift_generators*
|
||||||
|
Type: |List| of |String|s
|
||||||
|
Default: `['cpp']`
|
||||||
|
|
||||||
|
This list must contain one or more named code generators. Generator options
|
||||||
|
can be included as part of each string, e.g. `['py:dynamic']`.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_thrift_thrift_includes *g:ale_thrift_thrift_includes*
|
||||||
|
*b:ale_thrift_thrift_includes*
|
||||||
|
Type: |List| of |String|s
|
||||||
|
Default: `[]`
|
||||||
|
|
||||||
|
This list contains paths that will be searched for thrift `include`
|
||||||
|
directives.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_thrift_thrift_options *g:ale_thrift_thrift_options*
|
||||||
|
*b:ale_thrift_thrift_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'-strict'`
|
||||||
|
|
||||||
|
This variable can be changed to customize the additional command-line
|
||||||
|
arguments that are passed to the thrift compiler.
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
@@ -10,6 +10,12 @@ the two languages are, the `eslint` linter for TypeScript uses the JavaScript
|
|||||||
options for `eslint` too. See: |ale-javascript-eslint|.
|
options for `eslint` too. See: |ale-javascript-eslint|.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
prettier *ale-typescript-prettier*
|
||||||
|
|
||||||
|
See |ale-javascript-prettier| for information about the available options.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
tslint *ale-typescript-tslint*
|
tslint *ale-typescript-tslint*
|
||||||
|
|
||||||
@@ -30,6 +36,26 @@ g:ale_typescript_tslint_config_path *g:ale_typescript_tslint_config_path*
|
|||||||
such path exists, this variable will be used instead.
|
such path exists, this variable will be used instead.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_typescript_tslint_ignore_empty_files
|
||||||
|
*g:ale_typescript_tslint_ignore_empty_files*
|
||||||
|
*b:ale_typescript_tslint_ignore_empty_files*
|
||||||
|
Type: |Number|
|
||||||
|
Default: `0`
|
||||||
|
|
||||||
|
When set to `1`, ALE will not report any problems for empty files with
|
||||||
|
TSLint. ALE will still execute TSLint for the files, but ignore any problems
|
||||||
|
reported. This stops ALE from complaining about newly created files,
|
||||||
|
and files where lines have been added and then removed.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_typescript_tslint_rules_dir *g:ale_typescript_tslint_rules_dir*
|
||||||
|
*b:ale_typescript_tslint_rules_dir*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
If this variable is set, ALE will use it as the rules directory for tslint.
|
||||||
|
|
||||||
|
|
||||||
g:ale_typescript_tslint_use_global *g:ale_typescript_tslint_use_global*
|
g:ale_typescript_tslint_use_global *g:ale_typescript_tslint_use_global*
|
||||||
*b:ale_typescript_tslint_use_global*
|
*b:ale_typescript_tslint_use_global*
|
||||||
Type: |Number|
|
Type: |Number|
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
ALE XML Integration *ale-xml-options*
|
ALE XML Integration *ale-xml-options*
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
xmllint *ale-xml-xmllint*
|
xmllint *ale-xml-xmllint*
|
||||||
|
|
||||||
g:ale_xml_xmllint_executable *g:ale_xml_xmllint_executable*
|
g:ale_xml_xmllint_executable *g:ale_xml_xmllint_executable*
|
||||||
*b:ale_xml_xmllint_executable*
|
*b:ale_xml_xmllint_executable*
|
||||||
Type: |String|
|
Type: |String|
|
||||||
Default: `'xmllint'`
|
Default: `'xmllint'`
|
||||||
|
|
||||||
This variable can be set to change the path to xmllint.
|
This variable can be set to change the path to xmllint.
|
||||||
|
|
||||||
|
|
||||||
g:ale_xml_xmllint_options *g:ale_xml_xmllint_options*
|
g:ale_xml_xmllint_options *g:ale_xml_xmllint_options*
|
||||||
*b:ale_xml_xmllint_options*
|
*b:ale_xml_xmllint_options*
|
||||||
Type: |String|
|
Type: |String|
|
||||||
Default: `''`
|
Default: `''`
|
||||||
|
|
||||||
|
|||||||
561
doc/ale.txt
561
doc/ale.txt
@@ -8,34 +8,49 @@ CONTENTS *ale-contents*
|
|||||||
|
|
||||||
1. Introduction.........................|ale-introduction|
|
1. Introduction.........................|ale-introduction|
|
||||||
2. Supported Languages & Tools..........|ale-support|
|
2. Supported Languages & Tools..........|ale-support|
|
||||||
3. Global Options.......................|ale-options|
|
3. Linting..............................|ale-lint|
|
||||||
3.1 Highlights........................|ale-highlights|
|
|
||||||
4. Fixing Problems......................|ale-fix|
|
4. Fixing Problems......................|ale-fix|
|
||||||
5. Completion...........................|ale-completion|
|
5. Completion...........................|ale-completion|
|
||||||
6. Integration Documentation............|ale-integrations|
|
6. Global Options.......................|ale-options|
|
||||||
|
6.1 Highlights........................|ale-highlights|
|
||||||
|
7. Integration Documentation............|ale-integrations|
|
||||||
asm...................................|ale-asm-options|
|
asm...................................|ale-asm-options|
|
||||||
gcc.................................|ale-asm-gcc|
|
gcc.................................|ale-asm-gcc|
|
||||||
|
awk...................................|ale-awk-options|
|
||||||
|
gawk................................|ale-awk-gawk|
|
||||||
c.....................................|ale-c-options|
|
c.....................................|ale-c-options|
|
||||||
clang...............................|ale-c-clang|
|
clang...............................|ale-c-clang|
|
||||||
|
clang-format........................|ale-c-clangformat|
|
||||||
|
clangtidy...........................|ale-c-clangtidy|
|
||||||
cppcheck............................|ale-c-cppcheck|
|
cppcheck............................|ale-c-cppcheck|
|
||||||
gcc.................................|ale-c-gcc|
|
gcc.................................|ale-c-gcc|
|
||||||
clang-format........................|ale-c-clangformat|
|
|
||||||
chef..................................|ale-chef-options|
|
chef..................................|ale-chef-options|
|
||||||
foodcritic..........................|ale-chef-foodcritic|
|
foodcritic..........................|ale-chef-foodcritic|
|
||||||
|
cmake.................................|ale-cmake-options|
|
||||||
|
cmakelint...........................|ale-cmake-cmakelint|
|
||||||
cpp...................................|ale-cpp-options|
|
cpp...................................|ale-cpp-options|
|
||||||
clang...............................|ale-cpp-clang|
|
clang...............................|ale-cpp-clang|
|
||||||
clangcheck..........................|ale-cpp-clangcheck|
|
clangcheck..........................|ale-cpp-clangcheck|
|
||||||
|
clang-format........................|ale-cpp-clangformat|
|
||||||
clangtidy...........................|ale-cpp-clangtidy|
|
clangtidy...........................|ale-cpp-clangtidy|
|
||||||
cppcheck............................|ale-cpp-cppcheck|
|
cppcheck............................|ale-cpp-cppcheck|
|
||||||
cpplint.............................|ale-cpp-cpplint|
|
cpplint.............................|ale-cpp-cpplint|
|
||||||
gcc.................................|ale-cpp-gcc|
|
gcc.................................|ale-cpp-gcc|
|
||||||
clang-format........................|ale-cpp-clangformat|
|
c#....................................|ale-cs-options|
|
||||||
|
mcs.................................|ale-cs-mcs|
|
||||||
|
mcsc................................|ale-cs-mcsc|
|
||||||
css...................................|ale-css-options|
|
css...................................|ale-css-options|
|
||||||
|
prettier............................|ale-css-prettier|
|
||||||
stylelint...........................|ale-css-stylelint|
|
stylelint...........................|ale-css-stylelint|
|
||||||
cmake.................................|ale-cmake-options|
|
cuda..................................|ale-cuda-options|
|
||||||
cmakelint...........................|ale-cmake-cmakelint|
|
nvcc................................|ale-cuda-nvcc|
|
||||||
dart..................................|ale-dart-options|
|
dart..................................|ale-dart-options|
|
||||||
dartanalyzer........................|ale-dart-dartanalyzer|
|
dartanalyzer........................|ale-dart-dartanalyzer|
|
||||||
|
dockerfile............................|ale-dockerfile-options|
|
||||||
|
hadolint............................|ale-dockerfile-hadolint|
|
||||||
|
elm...................................|ale-elm-options|
|
||||||
|
elm-format..........................|ale-elm-elm-format|
|
||||||
|
elm-make............................|ale-elm-elm-make|
|
||||||
erlang................................|ale-erlang-options|
|
erlang................................|ale-erlang-options|
|
||||||
erlc................................|ale-erlang-erlc|
|
erlc................................|ale-erlang-erlc|
|
||||||
syntaxerl...........................|ale-erlang-syntaxerl|
|
syntaxerl...........................|ale-erlang-syntaxerl|
|
||||||
@@ -44,13 +59,17 @@ CONTENTS *ale-contents*
|
|||||||
gcc.................................|ale-fortran-gcc|
|
gcc.................................|ale-fortran-gcc|
|
||||||
fusionscript..........................|ale-fuse-options|
|
fusionscript..........................|ale-fuse-options|
|
||||||
fusion-lint.........................|ale-fuse-fusionlint|
|
fusion-lint.........................|ale-fuse-fusionlint|
|
||||||
|
glsl..................................|ale-glsl-options|
|
||||||
|
glslang.............................|ale-glsl-glslang|
|
||||||
go....................................|ale-go-options|
|
go....................................|ale-go-options|
|
||||||
|
gofmt...............................|ale-go-gofmt|
|
||||||
gometalinter........................|ale-go-gometalinter|
|
gometalinter........................|ale-go-gometalinter|
|
||||||
graphql...............................|ale-graphql-options|
|
graphql...............................|ale-graphql-options|
|
||||||
gqlint..............................|ale-graphql-gqlint|
|
gqlint..............................|ale-graphql-gqlint|
|
||||||
handlebars............................|ale-handlebars-options|
|
handlebars............................|ale-handlebars-options|
|
||||||
ember-template-lint.................|ale-handlebars-embertemplatelint|
|
ember-template-lint.................|ale-handlebars-embertemplatelint|
|
||||||
haskell...............................|ale-haskell-options|
|
haskell...............................|ale-haskell-options|
|
||||||
|
hdevtools...........................|ale-haskell-hdevtools|
|
||||||
stack-build.........................|ale-haskell-stack-build|
|
stack-build.........................|ale-haskell-stack-build|
|
||||||
html..................................|ale-html-options|
|
html..................................|ale-html-options|
|
||||||
htmlhint............................|ale-html-htmlhint|
|
htmlhint............................|ale-html-htmlhint|
|
||||||
@@ -63,14 +82,23 @@ CONTENTS *ale-contents*
|
|||||||
javascript............................|ale-javascript-options|
|
javascript............................|ale-javascript-options|
|
||||||
eslint..............................|ale-javascript-eslint|
|
eslint..............................|ale-javascript-eslint|
|
||||||
flow................................|ale-javascript-flow|
|
flow................................|ale-javascript-flow|
|
||||||
|
jscs................................|ale-javascript-jscs|
|
||||||
jshint..............................|ale-javascript-jshint|
|
jshint..............................|ale-javascript-jshint|
|
||||||
prettier............................|ale-javascript-prettier|
|
prettier............................|ale-javascript-prettier|
|
||||||
prettier-eslint.....................|ale-javascript-prettier-eslint|
|
prettier-eslint.....................|ale-javascript-prettier-eslint|
|
||||||
prettier-standard...................|ale-javascript-prettier-standard|
|
prettier-standard...................|ale-javascript-prettier-standard|
|
||||||
standard............................|ale-javascript-standard|
|
standard............................|ale-javascript-standard|
|
||||||
xo..................................|ale-javascript-xo|
|
xo..................................|ale-javascript-xo|
|
||||||
|
json..................................|ale-json-options|
|
||||||
|
jsonlint............................|ale-json-jsonlint|
|
||||||
|
prettier............................|ale-json-prettier|
|
||||||
kotlin................................|ale-kotlin-options|
|
kotlin................................|ale-kotlin-options|
|
||||||
kotlinc.............................|ale-kotlin-kotlinc|
|
kotlinc.............................|ale-kotlin-kotlinc|
|
||||||
|
ktlint..............................|ale-kotlin-ktlint|
|
||||||
|
less..................................|ale-less-options|
|
||||||
|
prettier............................|ale-less-prettier|
|
||||||
|
llvm..................................|ale-llvm-options|
|
||||||
|
llc.................................|ale-llvm-llc|
|
||||||
lua...................................|ale-lua-options|
|
lua...................................|ale-lua-options|
|
||||||
luacheck............................|ale-lua-luacheck|
|
luacheck............................|ale-lua-luacheck|
|
||||||
objc..................................|ale-objc-options|
|
objc..................................|ale-objc-options|
|
||||||
@@ -85,12 +113,14 @@ CONTENTS *ale-contents*
|
|||||||
php...................................|ale-php-options|
|
php...................................|ale-php-options|
|
||||||
hack................................|ale-php-hack|
|
hack................................|ale-php-hack|
|
||||||
langserver..........................|ale-php-langserver|
|
langserver..........................|ale-php-langserver|
|
||||||
|
phpcbf..............................|ale-php-phpcbf|
|
||||||
phpcs...............................|ale-php-phpcs|
|
phpcs...............................|ale-php-phpcs|
|
||||||
phpmd...............................|ale-php-phpmd|
|
phpmd...............................|ale-php-phpmd|
|
||||||
phpstan.............................|ale-php-phpstan|
|
phpstan.............................|ale-php-phpstan|
|
||||||
phpcbf..............................|ale-php-phpcbf|
|
|
||||||
pug...................................|ale-pug-options|
|
pug...................................|ale-pug-options|
|
||||||
puglint.............................|ale-pug-puglint|
|
puglint.............................|ale-pug-puglint|
|
||||||
|
puppet................................|ale-puppet-options|
|
||||||
|
puppetlint..........................|ale-puppet-puppetlint|
|
||||||
python................................|ale-python-options|
|
python................................|ale-python-options|
|
||||||
autopep8............................|ale-python-autopep8|
|
autopep8............................|ale-python-autopep8|
|
||||||
flake8..............................|ale-python-flake8|
|
flake8..............................|ale-python-flake8|
|
||||||
@@ -99,6 +129,10 @@ CONTENTS *ale-contents*
|
|||||||
pycodestyle.........................|ale-python-pycodestyle|
|
pycodestyle.........................|ale-python-pycodestyle|
|
||||||
pylint..............................|ale-python-pylint|
|
pylint..............................|ale-python-pylint|
|
||||||
yapf................................|ale-python-yapf|
|
yapf................................|ale-python-yapf|
|
||||||
|
r.....................................|ale-r-options|
|
||||||
|
lintr...............................|ale-r-lintr|
|
||||||
|
reasonml..............................|ale-reasonml-options|
|
||||||
|
merlin..............................|ale-reasonml-merlin|
|
||||||
ruby..................................|ale-ruby-options|
|
ruby..................................|ale-ruby-options|
|
||||||
brakeman............................|ale-ruby-brakeman|
|
brakeman............................|ale-ruby-brakeman|
|
||||||
rails_best_practices................|ale-ruby-rails_best_practices|
|
rails_best_practices................|ale-ruby-rails_best_practices|
|
||||||
@@ -113,10 +147,15 @@ CONTENTS *ale-contents*
|
|||||||
scala.................................|ale-scala-options|
|
scala.................................|ale-scala-options|
|
||||||
scalastyle..........................|ale-scala-scalastyle|
|
scalastyle..........................|ale-scala-scalastyle|
|
||||||
scss..................................|ale-scss-options|
|
scss..................................|ale-scss-options|
|
||||||
|
prettier............................|ale-scss-prettier|
|
||||||
stylelint...........................|ale-scss-stylelint|
|
stylelint...........................|ale-scss-stylelint|
|
||||||
sh....................................|ale-sh-options|
|
sh....................................|ale-sh-options|
|
||||||
shell...............................|ale-sh-shell|
|
shell...............................|ale-sh-shell|
|
||||||
shellcheck..........................|ale-sh-shellcheck|
|
shellcheck..........................|ale-sh-shellcheck|
|
||||||
|
sml...................................|ale-sml-options|
|
||||||
|
smlnj...............................|ale-sml-smlnj|
|
||||||
|
solidity..............................|ale-solidity-options|
|
||||||
|
solium..............................|ale-solidity-solium|
|
||||||
spec..................................|ale-spec-options|
|
spec..................................|ale-spec-options|
|
||||||
rpmlint.............................|ale-spec-rpmlint|
|
rpmlint.............................|ale-spec-rpmlint|
|
||||||
stylus................................|ale-stylus-options|
|
stylus................................|ale-stylus-options|
|
||||||
@@ -126,8 +165,11 @@ CONTENTS *ale-contents*
|
|||||||
tex...................................|ale-tex-options|
|
tex...................................|ale-tex-options|
|
||||||
chktex..............................|ale-tex-chktex|
|
chktex..............................|ale-tex-chktex|
|
||||||
lacheck.............................|ale-tex-lacheck|
|
lacheck.............................|ale-tex-lacheck|
|
||||||
|
thrift................................|ale-thrift-options|
|
||||||
|
thrift..............................|ale-thrift-thrift|
|
||||||
typescript............................|ale-typescript-options|
|
typescript............................|ale-typescript-options|
|
||||||
eslint..............................|ale-typescript-eslint|
|
eslint..............................|ale-typescript-eslint|
|
||||||
|
prettier............................|ale-typescript-prettier|
|
||||||
tslint..............................|ale-typescript-tslint|
|
tslint..............................|ale-typescript-tslint|
|
||||||
tsserver............................|ale-typescript-tsserver|
|
tsserver............................|ale-typescript-tsserver|
|
||||||
verilog/systemverilog.................|ale-verilog-options|
|
verilog/systemverilog.................|ale-verilog-options|
|
||||||
@@ -140,10 +182,10 @@ CONTENTS *ale-contents*
|
|||||||
yaml..................................|ale-yaml-options|
|
yaml..................................|ale-yaml-options|
|
||||||
swaglint............................|ale-yaml-swaglint|
|
swaglint............................|ale-yaml-swaglint|
|
||||||
yamllint............................|ale-yaml-yamllint|
|
yamllint............................|ale-yaml-yamllint|
|
||||||
7. Commands/Keybinds....................|ale-commands|
|
8. Commands/Keybinds....................|ale-commands|
|
||||||
8. API..................................|ale-api|
|
9. API..................................|ale-api|
|
||||||
9. Special Thanks.......................|ale-special-thanks|
|
10. Special Thanks......................|ale-special-thanks|
|
||||||
10. Contact.............................|ale-contact|
|
11. Contact.............................|ale-contact|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
1. Introduction *ale-introduction*
|
1. Introduction *ale-introduction*
|
||||||
@@ -174,80 +216,251 @@ for the current buffer.
|
|||||||
|
|
||||||
The following languages and tools are supported.
|
The following languages and tools are supported.
|
||||||
|
|
||||||
* ASM: 'gcc'
|
Notes:
|
||||||
* Ansible: 'ansible-lint'
|
|
||||||
* Asciidoc: 'proselint'
|
`^` No linters for text or Vim help filetypes are enabled by default.
|
||||||
* Bash: 'shell' (-n flag), 'shellcheck'
|
`!!` These linters check only files on disk. See |ale-lint-file-linters|
|
||||||
* Bourne Shell: 'shell' (-n flag), 'shellcheck'
|
|
||||||
* C: 'cppcheck', 'gcc', 'clang', 'clang-format'
|
* ASM: `gcc`
|
||||||
* C++ (filetype cpp): 'clang', 'clangtidy', 'cppcheck', 'cpplint', 'gcc', 'clang-format'
|
* Ansible: `ansible-lint`
|
||||||
* C#: 'mcs'
|
* AsciiDoc: `proselint`
|
||||||
* Chef: 'foodcritic'
|
* Awk: `gawk`
|
||||||
* CMake: 'cmakelint'
|
* Bash: `shell` (-n flag), `shellcheck`
|
||||||
* CoffeeScript: 'coffee', 'coffelint'
|
* Bourne Shell: `shell` (-n flag), `shellcheck`
|
||||||
* Crystal: 'crystal'
|
* C: `cppcheck`, `cpplint`!!, `gcc`, `clang`, `clangtidy`!!, `clang-format`
|
||||||
* CSS: 'csslint', 'stylelint'
|
* C++ (filetype cpp): `clang`, `clangcheck`!!, `clangtidy`!!, `cppcheck`, `cpplint`!!, `gcc`, `clang-format`
|
||||||
* Cython (pyrex filetype): 'cython'
|
* CUDA: `nvcc`!!
|
||||||
* D: 'dmd'
|
* C#: `mcs`, `mcsc`!!
|
||||||
* Dart: 'dartanalyzer'
|
* Chef: `foodcritic`
|
||||||
* Dockerfile: 'hadolint'
|
* CMake: `cmakelint`
|
||||||
* Elixir: 'credo', 'dogma'
|
* CoffeeScript: `coffee`, `coffeelint`
|
||||||
* Elm: 'elm-make'
|
* Crystal: `crystal`!!
|
||||||
* Erlang: 'erlc'
|
* CSS: `csslint`, `stylelint`, `prettier`
|
||||||
* Fortran: 'gcc'
|
* Cython (pyrex filetype): `cython`
|
||||||
* Go: 'gofmt', 'go vet', 'golint', 'go build', 'gosimple', 'staticcheck'
|
* D: `dmd`
|
||||||
* FusionScript: 'fusion-lint'
|
* Dart: `dartanalyzer`
|
||||||
* Haml: 'hamllint'
|
* Dockerfile: `hadolint`
|
||||||
* Handlebars: 'ember-template-lint'
|
* Elixir: `credo`, `dogma`!!
|
||||||
* Haskell: 'ghc', 'stack-ghc', 'stack-build', 'ghc-mod', 'stack-ghc-mod', 'hlint', 'hdevtools'
|
* Elm: `elm-format, elm-make`
|
||||||
* HTML: 'HTMLHint', 'proselint', 'tidy'
|
* Erb: `erb`, `erubis`
|
||||||
* Idris: 'idris'
|
* Erlang: `erlc`, `SyntaxErl`
|
||||||
* Java: 'javac'
|
* Fortran: `gcc`
|
||||||
* JavaScript: 'eslint', 'jscs', 'jshint', 'flow', 'prettier', 'prettier-eslint', 'xo'
|
* FusionScript: `fusion-lint`
|
||||||
* JSON: 'jsonlint'
|
* GLSL: glslang
|
||||||
* Kotlin: 'kotlinc'
|
* Go: `gofmt`, `go vet`, `golint`, `gometalinter`!!, `go build`!!, `gosimple`, `staticcheck`
|
||||||
* LaTeX (tex): 'chktex', 'lacheck', 'proselint'
|
* GraphQL: `gqlint`
|
||||||
* Lua: 'luacheck'
|
* Haml: `haml-lint`
|
||||||
* Markdown: 'mdl', 'proselint', 'vale'
|
* Handlebars: `ember-template-lint`
|
||||||
* MATLAB: 'mlint'
|
* Haskell: `ghc`, `stack-ghc`, `stack-build`!!, `ghc-mod`, `stack-ghc-mod`, `hlint`, `hdevtools`
|
||||||
* nim: 'nim check'
|
* HTML: `HTMLHint`, `proselint`, `tidy`
|
||||||
* nix: 'nix-instantiate'
|
* Idris: `idris`
|
||||||
* nroff: 'proselint'
|
* Java: `checkstyle`, `javac`
|
||||||
* Objective-C: 'clang'
|
* JavaScript: `eslint`, `jscs`, `jshint`, `flow`, `prettier`, `prettier-eslint` >= 4.2.0, `prettier-standard`, `standard`, `xo`
|
||||||
* Objective-C++: 'clang'
|
* JSON: `jsonlint`, `prettier`
|
||||||
* OCaml: 'merlin' (see |ale-ocaml-merlin|)
|
* Kotlin: `kotlinc`, `ktlint`
|
||||||
* Perl: 'perl' (-c flag), 'perlcritic'
|
* LaTeX (tex): `chktex`, `lacheck`, `proselint`
|
||||||
* PHP: 'hack', 'langserver', 'php' (-l flag), 'phpcs', 'phpmd', 'phpstan', 'phpcbf'
|
* LLVM: `llc`
|
||||||
* Pod: 'proselint'
|
* Lua: `luacheck`
|
||||||
* Pug: 'pug-lint'
|
* Markdown: `mdl`, `proselint`, `vale`, `remark-lint`
|
||||||
* Puppet: 'puppet', 'puppet-lint'
|
* MATLAB: `mlint`
|
||||||
* Python: 'autopep8', 'flake8', 'isort', 'mypy', 'pylint', 'yapf'
|
* Nim: `nim check`!!
|
||||||
* R: 'lintr'
|
* nix: `nix-instantiate`
|
||||||
* ReasonML: 'merlin'
|
* nroff: `proselint`
|
||||||
* reStructuredText: 'proselint'
|
* Objective-C: `clang`
|
||||||
* RPM spec: 'spec'
|
* Objective-C++: `clang`
|
||||||
* Rust: 'cargo', 'rls', 'rustc' (see |ale-integration-rust|)
|
* OCaml: `merlin` (see |ale-ocaml-merlin|)
|
||||||
* Ruby: 'reek', 'rubocop'
|
* Perl: `perl -c`, `perl-critic`
|
||||||
* SASS: 'sasslint', 'stylelint'
|
* PHP: `hack`, `langserver`, `php -l`, `phpcs`, `phpmd`, `phpstan`, `phpcbf`
|
||||||
* SCSS: 'sasslint', 'scsslint', 'stylelint'
|
* Pod: `proselint`
|
||||||
* Scala: 'scalac', 'scalastyle'
|
* Pug: `pug-lint`
|
||||||
* Slim: 'slim-lint'
|
* Puppet: `puppet`, `puppet-lint`
|
||||||
* SML: 'smlnj'
|
* Python: `autopep8`, `flake8`, `isort`, `mypy`, `pycodestyle`, `pylint`!!, `yapf`
|
||||||
* Stylus: 'stylelint'
|
* R: `lintr`
|
||||||
* SQL: 'sqlint'
|
* ReasonML: `merlin`
|
||||||
* Swift: 'swiftlint', 'swiftformat'
|
* reStructuredText: `proselint`
|
||||||
* Texinfo: 'proselint'
|
* RPM spec: `rpmlint`
|
||||||
* Text: 'proselint', 'vale'
|
* Ruby: `brakeman`, `rails_best_practices`!!, `reek`, `rubocop`, `ruby`
|
||||||
* TypeScript: 'eslint', 'tslint', 'tsserver', 'typecheck'
|
* Rust: `cargo`!!, `rls`, `rustc` (see |ale-integration-rust|)
|
||||||
* Verilog: 'iverilog', 'verilator'
|
* SASS: `sass-lint`, `stylelint`
|
||||||
* Vim: 'vint'
|
* SCSS: `sass-lint`, `scss-lint`, `stylelint`, `prettier`
|
||||||
* Vim help: 'proselint'
|
* Scala: `scalac`, `scalastyle`
|
||||||
* XHTML: 'proselint'
|
* Slim: `slim-lint`
|
||||||
* XML: 'xmllint'
|
* SML: `smlnj`
|
||||||
* YAML: 'swaglint', 'yamllint'
|
* Solidity: `solium`
|
||||||
|
* Stylus: `stylelint`
|
||||||
|
* SQL: `sqlint`
|
||||||
|
* Swift: `swiftlint`, `swiftformat`
|
||||||
|
* Tcl: `nagelfar`!!
|
||||||
|
* Texinfo: `proselint`
|
||||||
|
* Text^: `proselint`, `vale`
|
||||||
|
* Thrift: `thrift`
|
||||||
|
* TypeScript: `eslint`, `tslint`, `tsserver`, `typecheck`, `prettier`
|
||||||
|
* Verilog: `iverilog`, `verilator`
|
||||||
|
* Vim: `vint`
|
||||||
|
* Vim help^: `proselint`
|
||||||
|
* XHTML: `proselint`
|
||||||
|
* XML: `xmllint`
|
||||||
|
* YAML: `swaglint`, `yamllint`
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
3. Global Options *ale-options*
|
3. Linting *ale-lint*
|
||||||
|
|
||||||
|
ALE's primary focus is on checking for problems with your code with various
|
||||||
|
programs via some Vim code for integrating with those programs, referred to
|
||||||
|
as 'linters.' ALE supports a wide array of programs for linting by default,
|
||||||
|
but additional programs can be added easily by defining files in |runtimepath|
|
||||||
|
with the filename pattern `ale_linters/<filetype>/<filename>.vim`. For more
|
||||||
|
information on defining new linters, see the extensive documentation
|
||||||
|
for |ale#linter#Define()|.
|
||||||
|
|
||||||
|
Without any configuration, ALE will attempt to check all of the code for every
|
||||||
|
file you open in Vim with all available tools by default. To see what ALE
|
||||||
|
is doing, and what options have been set, try using the |:ALEInfo| command.
|
||||||
|
|
||||||
|
Most of the linters ALE runs will check the Vim buffer you are editing instead
|
||||||
|
of the file on disk. This allows you to check your code for errors before you
|
||||||
|
have even saved your changes. ALE will check your code in the following
|
||||||
|
circumstances, which can be configured with the associated options.
|
||||||
|
|
||||||
|
* When you modify a buffer. - |g:ale_lint_on_text_changed|
|
||||||
|
* When you open a new or modified buffer. - |g:ale_lint_on_enter|
|
||||||
|
* When you save a buffer. - |g:ale_lint_on_save|
|
||||||
|
* When the filetype changes for a buffer. - |g:ale_lint_on_filetype_changed|
|
||||||
|
* If ALE is used to check code manually. - |:ALELint|
|
||||||
|
|
||||||
|
In addition to the above options, ALE can also check buffers for errors when
|
||||||
|
you leave insert mode with |g:ale_lint_on_insert_leave|, which is off by
|
||||||
|
default. It is worth reading the documentation for every option.
|
||||||
|
|
||||||
|
*ale-lint-file-linters*
|
||||||
|
|
||||||
|
Some programs must be run against files which have been saved to disk, and
|
||||||
|
simply do not support reading temporary files or stdin, either of which are
|
||||||
|
required for ALE to be able to check for errors as you type. The programs
|
||||||
|
which behave this way are documented in the lists and tables of supported
|
||||||
|
programs. ALE will only lint files with these programs in the following
|
||||||
|
circumstances.
|
||||||
|
|
||||||
|
* When you open a new or modified buffer. - |g:ale_lint_on_enter|
|
||||||
|
* When you save a buffer. - |g:ale_lint_on_save|
|
||||||
|
* When the filetype changes for a buffer. - |g:ale_lint_on_filetype_changed|
|
||||||
|
* If ALE is used to check code manually. - |:ALELint|
|
||||||
|
|
||||||
|
ALE will report problems with your code in the following ways, listed with
|
||||||
|
their relevant options.
|
||||||
|
|
||||||
|
* By updating loclist. (On by default) - |g:ale_set_loclist|
|
||||||
|
* By updating quickfix. (Off by default) - |g:ale_set_quickfix|
|
||||||
|
* By setting error highlights. - |g:ale_set_highlights|
|
||||||
|
* By creating signs in the sign column. - |g:ale_set_signs|
|
||||||
|
* By echoing messages based on your cursor. - |g:ale_echo_cursor|
|
||||||
|
* By showing balloons for your mouse cursor - |g:ale_set_balloons|
|
||||||
|
|
||||||
|
Please consult the documentation for each option, which can reveal some other
|
||||||
|
ways of tweaking the behaviour of each way of displaying problems. You can
|
||||||
|
disable or enable whichever options you prefer.
|
||||||
|
|
||||||
|
Most settings can be configured for each buffer. (|b:| instead of |g:|),
|
||||||
|
including disabling ALE for certain buffers with |b:ale_enabled|. The
|
||||||
|
|g:ale_pattern_options| setting can be used to configure files differently
|
||||||
|
based on regular expressions for filenames. For configuring entire projects,
|
||||||
|
the buffer-local options can be used with external plugins for reading Vim
|
||||||
|
project configuration files.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
4. Fixing Problems *ale-fix*
|
||||||
|
|
||||||
|
ALE can fix problems with files with the |ALEFix| command. When |ALEFix| is
|
||||||
|
run, the variable |g:ale_fixers| will be read for getting a |List| of commands
|
||||||
|
for filetypes, split on `.`, and the functions named in |g:ale_fixers| will be
|
||||||
|
executed for fixing the errors.
|
||||||
|
|
||||||
|
The |ALEFixSuggest| command can be used to suggest tools that be used to
|
||||||
|
fix problems for the current buffer.
|
||||||
|
|
||||||
|
The values for `g:ale_fixers` can be a list of |String|, |Funcref|, or
|
||||||
|
|lambda| values. String values must either name a function, or a short name
|
||||||
|
for a function set in the ALE fixer registry.
|
||||||
|
|
||||||
|
Each function for fixing errors must accept either one argument `(buffer)` or
|
||||||
|
two arguments `(buffer, lines)`, representing the buffer being fixed and the
|
||||||
|
lines to fix. The functions must return either `0`, for changing nothing, a
|
||||||
|
|List| for new lines to set, or a |Dictionary| for describing a command to be
|
||||||
|
run in the background.
|
||||||
|
|
||||||
|
Functions receiving a variable number of arguments will not receive the second
|
||||||
|
argument `lines`. Functions should name two arguments if the `lines` argument
|
||||||
|
is desired. This is required to avoid unnecessary copying of the lines of
|
||||||
|
the buffers being checked.
|
||||||
|
|
||||||
|
When a |Dictionary| is returned for an |ALEFix| callback, the following keys
|
||||||
|
are supported for running the commands.
|
||||||
|
|
||||||
|
`command` A |String| for the command to run. This key is required.
|
||||||
|
|
||||||
|
When `%t` is included in a command string, a temporary
|
||||||
|
file will be created, containing the lines from the file
|
||||||
|
after previous adjustment have been done.
|
||||||
|
|
||||||
|
`read_temporary_file` When set to `1`, ALE will read the contents of the
|
||||||
|
temporary file created for `%t`. This option can be used
|
||||||
|
for commands which need to modify some file on disk in
|
||||||
|
order to fix files.
|
||||||
|
|
||||||
|
*ale-fix-configuration*
|
||||||
|
|
||||||
|
Synchronous functions and asynchronous jobs will be run in a sequence for
|
||||||
|
fixing files, and can be combined. For example:
|
||||||
|
>
|
||||||
|
let g:ale_fixers = {
|
||||||
|
\ 'javascript': [
|
||||||
|
\ 'DoSomething',
|
||||||
|
\ 'eslint',
|
||||||
|
\ {buffer, lines -> filter(lines, 'v:val !=~ ''^\s*//''')},
|
||||||
|
\ ],
|
||||||
|
\}
|
||||||
|
|
||||||
|
ALEFix
|
||||||
|
<
|
||||||
|
The above example will call a function called `DoSomething` which could act
|
||||||
|
upon some lines immediately, then run `eslint` from the ALE registry, and
|
||||||
|
then call a lambda function which will remove every single line comment
|
||||||
|
from the file.
|
||||||
|
|
||||||
|
For convenience, a plug mapping is defined for |ALEFix|, so you can set up a
|
||||||
|
keybind easily for fixing files. >
|
||||||
|
|
||||||
|
" Bind F8 to fixing problems with ALE
|
||||||
|
nmap <F8> <Plug>(ale_fix)
|
||||||
|
<
|
||||||
|
Files can be fixed automatically with the following options, which are all off
|
||||||
|
by default.
|
||||||
|
|
||||||
|
|g:ale_fix_on_save| - Fix files when they are saved.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
5. Completion *ale-completion*
|
||||||
|
|
||||||
|
ALE offers some limited support for automatic completion of code while you
|
||||||
|
type. Completion is only supported via Language Server Protocol servers which
|
||||||
|
ALE can connect to for linting, which can offer good built-in support for
|
||||||
|
suggesting completion information. ALE will only suggest symbols for
|
||||||
|
completion for LSP linters that are enabled.
|
||||||
|
|
||||||
|
NOTE: At the moment, only `tsserver` for TypeScript code is supported for
|
||||||
|
completion.
|
||||||
|
|
||||||
|
Suggestions will be made while you type after completion is enabled.
|
||||||
|
Completion can be enabled by setting |g:ale_completion_enabled| to `1`. The
|
||||||
|
delay for completion can be configured with |g:ale_completion_delay|. ALE will
|
||||||
|
only suggest so many possible matches for completion. The maximum number of
|
||||||
|
items can be controlled with |g:ale_completion_max_suggestions|.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
6. Global Options *ale-options*
|
||||||
|
|
||||||
g:airline#extensions#ale#enabled *g:airline#extensions#ale#enabled*
|
g:airline#extensions#ale#enabled *g:airline#extensions#ale#enabled*
|
||||||
|
|
||||||
@@ -330,6 +543,18 @@ g:ale_echo_cursor *g:ale_echo_cursor*
|
|||||||
The format of the message can be customizable in |g:ale_echo_msg_format|.
|
The format of the message can be customizable in |g:ale_echo_msg_format|.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_echo_delay *g:ale_echo_delay*
|
||||||
|
*b:ale_echo_delay*
|
||||||
|
Type: |Number|
|
||||||
|
Default: `10`
|
||||||
|
|
||||||
|
Given any integer, this option controls the number of milliseconds before
|
||||||
|
ALE will echo a message for a problem near the cursor.
|
||||||
|
|
||||||
|
The value can be increased to decrease the amount of processing ALE will do
|
||||||
|
for files displaying a large number of problems.
|
||||||
|
|
||||||
|
|
||||||
g:ale_echo_msg_error_str *g:ale_echo_msg_error_str*
|
g:ale_echo_msg_error_str *g:ale_echo_msg_error_str*
|
||||||
|
|
||||||
Type: |String|
|
Type: |String|
|
||||||
@@ -401,7 +626,7 @@ g:ale_fixers *g:ale_fixers*
|
|||||||
A mapping from filetypes to |List| values for functions for fixing errors.
|
A mapping from filetypes to |List| values for functions for fixing errors.
|
||||||
See |ale-fix| for more information.
|
See |ale-fix| for more information.
|
||||||
|
|
||||||
This variable can be overriden with variables in each buffer.
|
This variable can be overridden with variables in each buffer.
|
||||||
|
|
||||||
|
|
||||||
g:ale_fix_on_save *g:ale_fix_on_save*
|
g:ale_fix_on_save *g:ale_fix_on_save*
|
||||||
@@ -512,6 +737,10 @@ g:ale_lint_on_filetype_changed *g:ale_lint_on_filetype_changed*
|
|||||||
changed quickly several times in a row, but resulting in only one lint
|
changed quickly several times in a row, but resulting in only one lint
|
||||||
cycle.
|
cycle.
|
||||||
|
|
||||||
|
If |g:ale_lint_on_enter| is set to `0`, then ALE will not lint a file when
|
||||||
|
the filetype is initially set. Otherwise ALE would still lint files when
|
||||||
|
buffers are opened, and the option for doing so is turned off.
|
||||||
|
|
||||||
|
|
||||||
g:ale_lint_on_save *g:ale_lint_on_save*
|
g:ale_lint_on_save *g:ale_lint_on_save*
|
||||||
|
|
||||||
@@ -644,6 +873,23 @@ g:ale_max_buffer_history_size *g:ale_max_buffer_history_size*
|
|||||||
History can be disabled completely with |g:ale_history_enabled|.
|
History can be disabled completely with |g:ale_history_enabled|.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_max_signs *g:ale_max_signs*
|
||||||
|
*b:ale_max_signs*
|
||||||
|
Type: |Number|
|
||||||
|
Default: `-1`
|
||||||
|
|
||||||
|
When set to any positive integer, ALE will not render any more than the
|
||||||
|
given number of signs for any one buffer.
|
||||||
|
|
||||||
|
When set to `0`, no signs will be set, but sign processing will still be
|
||||||
|
done, so existing signs can be removed.
|
||||||
|
|
||||||
|
When set to any other value, no limit will be imposed on the number of signs
|
||||||
|
set.
|
||||||
|
|
||||||
|
For disabling sign processing, see |g:ale_set_signs|.
|
||||||
|
|
||||||
|
|
||||||
g:ale_maximum_file_size *g:ale_maximum_file_size*
|
g:ale_maximum_file_size *g:ale_maximum_file_size*
|
||||||
*b:ale_maximum_file_size*
|
*b:ale_maximum_file_size*
|
||||||
Type: |Number|
|
Type: |Number|
|
||||||
@@ -791,6 +1037,8 @@ g:ale_set_signs *g:ale_set_signs*
|
|||||||
When multiple problems exist on the same line, the signs will take
|
When multiple problems exist on the same line, the signs will take
|
||||||
precedence in the order above, from highest to lowest.
|
precedence in the order above, from highest to lowest.
|
||||||
|
|
||||||
|
To limit the number of signs ALE will set, see |g:ale_max_signs|.
|
||||||
|
|
||||||
|
|
||||||
g:ale_sign_column_always *g:ale_sign_column_always*
|
g:ale_sign_column_always *g:ale_sign_column_always*
|
||||||
|
|
||||||
@@ -862,10 +1110,10 @@ g:ale_type_map *g:ale_type_map*
|
|||||||
Type: |Dictionary|
|
Type: |Dictionary|
|
||||||
Default: `{}`
|
Default: `{}`
|
||||||
|
|
||||||
This option can be set re-map problem types for linters. Each key in
|
This option can be set re-map problem types for linters. Each key in the
|
||||||
the |Dictionary| should be the name of a linter, and each value must be
|
|Dictionary| should be the name of a linter, and each value must be a
|
||||||
a |Dictionary| mapping error types from one type to another. The
|
|Dictionary| mapping problem types from one type to another. The following
|
||||||
following types are supported:
|
types are supported:
|
||||||
|
|
||||||
`'E'` - `{'type': 'E'}`
|
`'E'` - `{'type': 'E'}`
|
||||||
`'ES'` - `{'type': 'E', 'sub_type': 'style'}`
|
`'ES'` - `{'type': 'E', 'sub_type': 'style'}`
|
||||||
@@ -873,13 +1121,13 @@ g:ale_type_map *g:ale_type_map*
|
|||||||
`'WS'` - `{'type': 'W', 'sub_type': 'style'}`
|
`'WS'` - `{'type': 'W', 'sub_type': 'style'}`
|
||||||
`'I'` - `{'type': 'I'}`
|
`'I'` - `{'type': 'I'}`
|
||||||
|
|
||||||
For example, if you want to turn flake8 errors into warnings, you can do
|
For example, if you want to turn flake8 errors into warnings, you can write
|
||||||
the following: >
|
the following: >
|
||||||
|
|
||||||
let g:ale_type_map = {'flake8': {'ES': 'WS', 'E': 'W'}}
|
let g:ale_type_map = {'flake8': {'ES': 'WS', 'E': 'W'}}
|
||||||
<
|
<
|
||||||
If you wanted to turn style errors and warnings into regular errors and
|
If you wanted to turn style errors and warnings into regular errors and
|
||||||
warnings, you can use the following: >
|
warnings, you can write the following: >
|
||||||
|
|
||||||
let g:ale_type_map = {'flake8': {'ES': 'E', 'WS': 'W'}}
|
let g:ale_type_map = {'flake8': {'ES': 'E', 'WS': 'W'}}
|
||||||
<
|
<
|
||||||
@@ -918,8 +1166,24 @@ b:ale_warn_about_trailing_whitespace *b:ale_warn_about_trailing_whitespace*
|
|||||||
This option may be configured on a per buffer basis.
|
This option may be configured on a per buffer basis.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_windows_node_executable_path *g:ale_windows_node_executable_path*
|
||||||
|
*b:ale_windows_node_executable_path*
|
||||||
|
|
||||||
|
Type: |String|
|
||||||
|
Default: `'node.exe'`
|
||||||
|
|
||||||
|
This variable is used as the path to the executable to use for executing
|
||||||
|
scripts with Node.js on Windows.
|
||||||
|
|
||||||
|
For Windows, any file with a `.js` file extension needs to be executed with
|
||||||
|
the node executable explicitly. Otherwise, Windows could try and open the
|
||||||
|
scripts with other applications, like a text editor. Therefore, these
|
||||||
|
scripts are executed with whatever executable is configured with this
|
||||||
|
setting.
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
3.1. Highlights *ale-highlights*
|
6.1. Highlights *ale-highlights*
|
||||||
|
|
||||||
ALEError *ALEError*
|
ALEError *ALEError*
|
||||||
|
|
||||||
@@ -1013,98 +1277,7 @@ ALEWarningSign *ALEWarningSign*
|
|||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
4. Fixing Problems *ale-fix*
|
7. Integration Documentation *ale-integrations*
|
||||||
|
|
||||||
ALE can fix problems with files with the |ALEFix| command. When |ALEFix| is
|
|
||||||
run, the variable |g:ale_fixers| will be read for getting a |List| of commands
|
|
||||||
for filetypes, split on `.`, and the functions named in |g:ale_fixers| will be
|
|
||||||
executed for fixing the errors.
|
|
||||||
|
|
||||||
The |ALEFixSuggest| command can be used to suggest tools that be used to
|
|
||||||
fix problems for the current buffer.
|
|
||||||
|
|
||||||
The values for `g:ale_fixers` can be a list of |String|, |Funcref|, or
|
|
||||||
|lambda| values. String values must either name a function, or a short name
|
|
||||||
for a function set in the ALE fixer registry.
|
|
||||||
|
|
||||||
Each function for fixing errors must accept either one argument `(buffer)` or
|
|
||||||
two arguments `(buffer, lines)`, representing the buffer being fixed and the
|
|
||||||
lines to fix. The functions must return either `0`, for changing nothing, a
|
|
||||||
|List| for new lines to set, or a |Dictionary| for describing a command to be
|
|
||||||
run in the background.
|
|
||||||
|
|
||||||
Functions receiving a variable number of arguments will not receive the second
|
|
||||||
argument `lines`. Functions should name two arguments if the `lines` argument
|
|
||||||
is desired. This is required to avoid unnecessary copying of the lines of
|
|
||||||
the buffers being checked.
|
|
||||||
|
|
||||||
When a |Dictionary| is returned for an |ALEFix| callback, the following keys
|
|
||||||
are supported for running the commands.
|
|
||||||
|
|
||||||
`command` A |String| for the command to run. This key is required.
|
|
||||||
|
|
||||||
When `%t` is included in a command string, a temporary
|
|
||||||
file will be created, containing the lines from the file
|
|
||||||
after previous adjustment have been done.
|
|
||||||
|
|
||||||
`read_temporary_file` When set to `1`, ALE will read the contents of the
|
|
||||||
temporary file created for `%t`. This option can be used
|
|
||||||
for commands which need to modify some file on disk in
|
|
||||||
order to fix files.
|
|
||||||
|
|
||||||
*ale-fix-configuration*
|
|
||||||
|
|
||||||
Synchronous functions and asynchronous jobs will be run in a sequence for
|
|
||||||
fixing files, and can be combined. For example:
|
|
||||||
>
|
|
||||||
let g:ale_fixers = {
|
|
||||||
\ 'javascript': [
|
|
||||||
\ 'DoSomething',
|
|
||||||
\ 'eslint',
|
|
||||||
\ {buffer, lines -> filter(lines, 'v:val !=~ ''^\s*//''')},
|
|
||||||
\ ],
|
|
||||||
\}
|
|
||||||
|
|
||||||
ALEFix
|
|
||||||
<
|
|
||||||
The above example will call a function called `DoSomething` which could act
|
|
||||||
upon some lines immediately, then run `eslint` from the ALE registry, and
|
|
||||||
then call a lambda function which will remove every single line comment
|
|
||||||
from the file.
|
|
||||||
|
|
||||||
For convenience, a plug mapping is defined for |ALEFix|, so you can set up a
|
|
||||||
keybind easily for fixing files. >
|
|
||||||
|
|
||||||
" Bind F8 to fixing problems with ALE
|
|
||||||
nmap <F8> <Plug>(ale_fix)
|
|
||||||
<
|
|
||||||
Files can be fixed automatically with the following options, which are all off
|
|
||||||
by default.
|
|
||||||
|
|
||||||
|g:ale_fix_on_save| - Fix files when they are saved.
|
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
|
||||||
5. Completion *ale-completion*
|
|
||||||
|
|
||||||
ALE offers some limited support for automatic completion of code while you
|
|
||||||
type. Completion is only supported via Language Server Protocol servers which
|
|
||||||
ALE can connect to for linting, which can offer good built-in support for
|
|
||||||
suggesting completion information. ALE will only suggest symbols for
|
|
||||||
completion for LSP linters that are enabled.
|
|
||||||
|
|
||||||
NOTE: At the moment, only `tsserver` for TypeScript code is supported for
|
|
||||||
completion.
|
|
||||||
|
|
||||||
Suggestions will be made while you type after completion is enabled.
|
|
||||||
Completion can be enabled by setting |g:ale_completion_enabled| to `1`. The
|
|
||||||
delay for completion can be configured with |g:ale_completion_delay|. ALE will
|
|
||||||
only suggest so many possible matches for completion. The maximum number of
|
|
||||||
items can be controlled with |g:ale_completion_max_suggestions|.
|
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
|
||||||
6. Integration Documentation *ale-integrations*
|
|
||||||
|
|
||||||
Linter and fixer options are documented in individual help files. See the
|
Linter and fixer options are documented in individual help files. See the
|
||||||
table of contents at |ale-contents|.
|
table of contents at |ale-contents|.
|
||||||
@@ -1137,7 +1310,7 @@ ALE will use to search for Python executables.
|
|||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
7. Commands/Keybinds *ale-commands*
|
8. Commands/Keybinds *ale-commands*
|
||||||
|
|
||||||
ALEFix *ALEFix*
|
ALEFix *ALEFix*
|
||||||
|
|
||||||
@@ -1153,6 +1326,7 @@ ALEFixSuggest *ALEFixSuggest*
|
|||||||
See |ale-fix| for more information.
|
See |ale-fix| for more information.
|
||||||
|
|
||||||
|
|
||||||
|
*:ALELint*
|
||||||
ALELint *ALELint*
|
ALELint *ALELint*
|
||||||
|
|
||||||
Run ALE once for the current buffer. This command can be used to run ALE
|
Run ALE once for the current buffer. This command can be used to run ALE
|
||||||
@@ -1222,6 +1396,7 @@ ALEDetail *ALEDetail*
|
|||||||
A plug mapping `<Plug>(ale_detail)` is defined for this command.
|
A plug mapping `<Plug>(ale_detail)` is defined for this command.
|
||||||
|
|
||||||
|
|
||||||
|
*:ALEInfo*
|
||||||
ALEInfo *ALEInfo*
|
ALEInfo *ALEInfo*
|
||||||
ALEInfoToClipboard *ALEInfoToClipboard*
|
ALEInfoToClipboard *ALEInfoToClipboard*
|
||||||
|
|
||||||
@@ -1240,7 +1415,7 @@ ALEInfoToClipboard *ALEInfoToClipboard*
|
|||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
8. API *ale-api*
|
9. API *ale-api*
|
||||||
|
|
||||||
ale#Queue(delay, [linting_flag, buffer_number]) *ale#Queue()*
|
ale#Queue(delay, [linting_flag, buffer_number]) *ale#Queue()*
|
||||||
|
|
||||||
@@ -1370,7 +1545,7 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()*
|
|||||||
the end of the file will be moved to the end.
|
the end of the file will be moved to the end.
|
||||||
`col` - The column number is optional and will
|
`col` - The column number is optional and will
|
||||||
default to `0`. Any strings will be automatically
|
default to `0`. Any strings will be automatically
|
||||||
coverted to number using `str2nr()`.
|
converted to number using `str2nr()`.
|
||||||
`end_col` - An optional end column number.
|
`end_col` - An optional end column number.
|
||||||
This key can be set to specify the column problems
|
This key can be set to specify the column problems
|
||||||
end on, for improved highlighting.
|
end on, for improved highlighting.
|
||||||
@@ -1521,7 +1696,7 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()*
|
|||||||
`project_callback` and `language_callback` arguments
|
`project_callback` and `language_callback` arguments
|
||||||
must also be defined.
|
must also be defined.
|
||||||
|
|
||||||
LSP linters handle diagonstics automatically, so
|
LSP linters handle diagnostics automatically, so
|
||||||
the `callback` argument must not be defined.
|
the `callback` argument must not be defined.
|
||||||
|
|
||||||
`project_callback` A |String| or |Funcref| for a callback function
|
`project_callback` A |String| or |Funcref| for a callback function
|
||||||
@@ -1610,12 +1785,12 @@ ale#linter#Get(filetype) *ale#linter#Get()*
|
|||||||
Return all of linters configured for a given filetype as a |List| of
|
Return all of linters configured for a given filetype as a |List| of
|
||||||
|Dictionary| values in the format specified by |ale#linter#Define()|.
|
|Dictionary| values in the format specified by |ale#linter#Define()|.
|
||||||
|
|
||||||
Filetypes may be dot-seperated to invoke linters for multiple filetypes:
|
Filetypes may be dot-separated to invoke linters for multiple filetypes:
|
||||||
for instance, the filetype `javascript.jsx` will return linters for both the
|
for instance, the filetype `javascript.jsx` will return linters for both the
|
||||||
`javascript` and `jsx` filetype.
|
`javascript` and `jsx` filetype.
|
||||||
|
|
||||||
Aliases may be defined in as described in |g:ale_linter_aliases|. Aliases
|
Aliases may be defined in as described in |g:ale_linter_aliases|. Aliases
|
||||||
are applied after dot-seperated filetypes are broken up into their
|
are applied after dot-separated filetypes are broken up into their
|
||||||
components.
|
components.
|
||||||
|
|
||||||
|
|
||||||
@@ -1648,13 +1823,13 @@ ALELint *ALELint-autocmd*
|
|||||||
echoing messges.
|
echoing messges.
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
9. Special Thanks *ale-special-thanks*
|
10. Special Thanks *ale-special-thanks*
|
||||||
|
|
||||||
Special thanks to Mark Grealish (https://www.bhalash.com/) for providing ALE's
|
Special thanks to Mark Grealish (https://www.bhalash.com/) for providing ALE's
|
||||||
snazzy looking ale glass logo. Cheers, Mark!
|
snazzy looking ale glass logo. Cheers, Mark!
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
10. Contact *ale-contact*
|
11. Contact *ale-contact*
|
||||||
|
|
||||||
If you like this plugin, and wish to get in touch, check out the GitHub
|
If you like this plugin, and wish to get in touch, check out the GitHub
|
||||||
page for issues and more at https://github.com/w0rp/ale
|
page for issues and more at https://github.com/w0rp/ale
|
||||||
@@ -1662,10 +1837,8 @@ page for issues and more at https://github.com/w0rp/ale
|
|||||||
If you wish to contact the author of this plugin directly, please feel
|
If you wish to contact the author of this plugin directly, please feel
|
||||||
free to send an email to devw0rp@gmail.com.
|
free to send an email to devw0rp@gmail.com.
|
||||||
|
|
||||||
|
|
||||||
Please drink responsibly, or not at all, which is ironically the preference
|
Please drink responsibly, or not at all, which is ironically the preference
|
||||||
of w0rp, who is teetotal.
|
of w0rp, who is teetotal.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
|
|||||||
@@ -118,6 +118,9 @@ call ale#Set('list_window_size', 10)
|
|||||||
" This flag can be set to 0 to disable setting signs.
|
" This flag can be set to 0 to disable setting signs.
|
||||||
" This is enabled by default only if the 'signs' feature exists.
|
" This is enabled by default only if the 'signs' feature exists.
|
||||||
let g:ale_set_signs = get(g:, 'ale_set_signs', has('signs'))
|
let g:ale_set_signs = get(g:, 'ale_set_signs', has('signs'))
|
||||||
|
" This flag can be set to some integer to control the maximum number of signs
|
||||||
|
" that ALE will set.
|
||||||
|
let g:ale_max_signs = get(g:, 'ale_max_signs', -1)
|
||||||
|
|
||||||
" This flag can be set to 1 to enable changing the sign column colors when
|
" This flag can be set to 1 to enable changing the sign column colors when
|
||||||
" there are errors.
|
" there are errors.
|
||||||
@@ -152,6 +155,8 @@ let g:ale_echo_msg_warning_str = get(g:, 'ale_echo_msg_warning_str', 'Warning')
|
|||||||
|
|
||||||
" This flag can be set to 0 to disable echoing when the cursor moves.
|
" This flag can be set to 0 to disable echoing when the cursor moves.
|
||||||
let g:ale_echo_cursor = get(g:, 'ale_echo_cursor', 1)
|
let g:ale_echo_cursor = get(g:, 'ale_echo_cursor', 1)
|
||||||
|
" Controls the milliseconds delay before echoing a message.
|
||||||
|
let g:ale_echo_delay = get(g:, 'ale_echo_delay', 10)
|
||||||
|
|
||||||
" This flag can be set to 0 to disable balloon support.
|
" This flag can be set to 0 to disable balloon support.
|
||||||
call ale#Set('set_balloons', has('balloon_eval'))
|
call ale#Set('set_balloons', has('balloon_eval'))
|
||||||
@@ -378,6 +383,7 @@ augroup ALECleanupGroup
|
|||||||
autocmd!
|
autocmd!
|
||||||
" Clean up buffers automatically when they are unloaded.
|
" Clean up buffers automatically when they are unloaded.
|
||||||
autocmd BufUnload * call ale#engine#Cleanup(str2nr(expand('<abuf>')))
|
autocmd BufUnload * call ale#engine#Cleanup(str2nr(expand('<abuf>')))
|
||||||
|
autocmd QuitPre * call ale#events#QuitEvent(str2nr(expand('<abuf>')))
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" Backwards Compatibility
|
" Backwards Compatibility
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user