Compare commits

..

15 Commits

Author SHA1 Message Date
w0rp
a94f7aaa7e Fix #964 - Remove signs when multiple signs end up on a single line 2017-10-03 10:03:10 +01:00
w0rp
21c4b9033a Merge pull request #951 from rzane/eslint-fix-config-option
ESLint --config option causes it to not detect node_modules?
2017-09-25 21:40:18 +01:00
w0rp
f382afbe23 Fix #924 - Make changing the sign column color work again 2017-09-12 21:24:39 +01:00
w0rp
4da8c3607d Fix #921 - Capture both output streams for gosimple and staticcheck 2017-09-12 19:54:37 +01:00
w0rp
c3844db973 Fix #923 Use package.json as a last resort for eslint --fix 2017-09-12 09:16:20 +01:00
w0rp
8a374a69a3 Fix #922 - Prefer nearer ESLint configuration files with lower precedence filenames for eslint --fix 2017-09-11 21:54:59 +01:00
w0rp
68bae8a1d1 Fix #920 - Shut up about E776 2017-09-10 20:18:52 +01:00
w0rp
b8dcdc984b Fix #912 - Close lists automatically when g:ale_open_list is set to 'on_save' again 2017-09-08 20:11:28 +01:00
w0rp
c6d3d646ac Fix #907 - Stop LSP integration breaking with empty string keys in NeoVim 2017-09-04 00:15:59 +01:00
w0rp
c8de2d9766 Fix #899 - Make the quickfix and loclist windows close again 2017-09-03 19:51:38 +01:00
w0rp
6d50074984 Fix #891 - Do not check ctrlp-funky windows 2017-09-03 18:29:15 +01:00
w0rp
6b87dd24ee Fix #895 - Run Node.js scripts with node.exe instead of node on Windows 2017-08-31 13:13:33 +01:00
w0rp
11fafbfd66 Fix #888 - Disable pycodestyle by default 2017-08-30 09:15:14 +01:00
w0rp
06c3ee61e4 Add a missing scriptencoding line 2017-08-29 16:56:56 +01:00
w0rp
5a88395bbb #869 - Detect the shell dialect from the hashbang for shellcheck 2017-08-29 16:54:24 +01:00
265 changed files with 1434 additions and 5769 deletions

View File

@@ -1,40 +0,0 @@
---
# 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"'

View File

@@ -1,14 +0,0 @@
# 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
View File

@@ -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
View File

@@ -1,6 +1,5 @@
/init.vim /init.vim
/doc/tags /doc/tags
.* .*
!.editorconfig
*.obj *.obj
tags tags

View File

@@ -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 guidelines to follow for this file. some guidlines 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 abduction, etc., action should be taken to ensure that the or government adduction, 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
View File

@@ -1,5 +1,4 @@
# Asynchronous Lint Engine [![Travis CI Build Status](https://travis-ci.org/w0rp/ale.svg?branch=master)](https://travis-ci.org/w0rp/ale) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/w0rp/ale?svg=true)](https://ci.appveyor.com/project/w0rp/ale) # Asynchronous Lint Engine [![Build Status](https://travis-ci.org/w0rp/ale.svg?branch=master)](https://travis-ci.org/w0rp/ale)
![ALE Logo by Mark Grealish - https://www.bhalash.com/](img/logo.jpg?raw=true) ![ALE Logo by Mark Grealish - https://www.bhalash.com/](img/logo.jpg?raw=true)
@@ -37,14 +36,13 @@ 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 show errors or warnings in my lightline?](#faq-lightline) 5. [How can I change the format for echo messages?](#faq-echo-format)
6. [How can I change the format for echo messages?](#faq-echo-format) 6. [How can I execute some code when ALE stops linting?](#faq-autocmd)
7. [How can I execute some code when ALE stops linting?](#faq-autocmd) 7. [How can I navigate between errors quickly?](#faq-navigation)
8. [How can I navigate between errors quickly?](#faq-navigation) 8. [How can I run linters only when I save files?](#faq-lint-on-save)
9. [How can I run linters only when I save files?](#faq-lint-on-save) 9. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
10. [How can I use the quickfix list instead of the loclist?](#faq-quickfix) 10. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
11. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint) 11. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
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>
@@ -57,99 +55,88 @@ 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 | shell [-n flag](https://www.gnu.org/software/bash/manual/bash.html#index-set), [shellcheck](https://www.shellcheck.net/) | | Bash | [-n flag](https://www.gnu.org/software/bash/manual/bash.html#index-set), [shellcheck](https://www.shellcheck.net/) |
| Bourne Shell | shell [-n flag](http://linux.die.net/man/1/sh), [shellcheck](https://www.shellcheck.net/) | | Bourne Shell | [-n flag](http://linux.die.net/man/1/sh), [shellcheck](https://www.shellcheck.net/) |
| 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 | [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++ (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)|
| 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/) |
| 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), [prettier](https://github.com/prettier/prettier) | | CSS | [csslint](http://csslint.net/), [stylelint](https://github.com/stylelint/stylelint) |
| 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-format](https://github.com/avh4/elm-format), [elm-make](https://github.com/elm-lang/elm-make) | | Elm | [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) |
| GLSL | [glslang](https://github.com/KhronosGroup/glslang) | | 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) |
| 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/), [prettier](https://github.com/prettier/prettier), prettier-eslint >= 4.2.0, prettier-standard, [standard](http://standardjs.com/), [xo](https://github.com/sindresorhus/xo) | 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)
| JSON | [jsonlint](http://zaa.ch/jsonlint/), [prettier](https://github.com/prettier/prettier) | | JSON | [jsonlint](http://zaa.ch/jsonlint/) |
| 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), [remark-lint](https://github.com/wooorm/remark-lint) !! | | Markdown | [mdl](https://github.com/mivok/markdownlint), [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) |
| MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) | | MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) |
| Nim | [nim check](https://nim-lang.org/docs/nimc.html) !! | | Nim | [nim](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-ocaml-merlin` for configuration instructions | | OCaml | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-integration-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), [prettier](https://github.com/prettier/prettier) | | SCSS | [sass-lint](https://www.npmjs.com/package/sass-lint), [scss-lint](https://github.com/brigade/scss-lint), [stylelint](https://github.com/stylelint/stylelint) |
| 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) |
| Thrift | [thrift](http://thrift.apache.org/) | | TypeScript | [eslint](http://eslint.org/), [tslint](https://github.com/palantir/tslint), tsserver, typecheck |
| 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
@@ -410,70 +397,9 @@ 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.vi. How can I change the format for echo messages? ### 5.v. 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.
@@ -498,7 +424,7 @@ Will give you:
<a name="faq-autocmd"></a> <a name="faq-autocmd"></a>
### 5.vii. How can I execute some code when ALE stops linting? ### 5.vi. 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
@@ -513,7 +439,7 @@ augroup END
<a name="faq-navigation"></a> <a name="faq-navigation"></a>
### 5.viii. How can I navigate between errors quickly? ### 5.vii. 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
@@ -529,7 +455,7 @@ For more information, consult the online documentation with
<a name="faq-lint-on-save"></a> <a name="faq-lint-on-save"></a>
### 5.ix. How can I run linters only when I save files? ### 5.viii. 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
@@ -549,7 +475,7 @@ files, you can set `g:ale_lint_on_save` to `0`.
<a name="faq-quickfix"></a> <a name="faq-quickfix"></a>
### 5.x. How can I use the quickfix list instead of the loclist? ### 5.ix. 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
@@ -576,7 +502,7 @@ let g:ale_keep_list_window_open = 1
<a name="faq-jsx-stylelint-eslint"></a> <a name="faq-jsx-stylelint-eslint"></a>
### 5.xi. How can I check JSX files with both stylelint and eslint? ### 5.x. 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.
@@ -609,7 +535,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.xii. Will this plugin eat all of my laptop battery power? ### 5.xi. 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

View File

@@ -1,64 +0,0 @@
" 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,
\})

View File

@@ -1,87 +0,0 @@
" 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
\})

View File

@@ -1,56 +0,0 @@
" 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,
\})

View File

@@ -1,15 +1,6 @@
" Author: buffalocoder - https://github.com/buffalocoder, soywod - https://github.com/soywod " Author: buffalocoder - https://github.com/buffalocoder
" 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')
@@ -61,7 +52,6 @@ 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
@@ -71,18 +61,16 @@ 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. It does not use NUL on Windows. " which is why this is hard coded here.
" 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 = ale#Escape(l:elm_exe) let l:elm_cmd = 'elm-make --report=json --output='.ale#Escape('/dev/null')
\ . ' --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_callback': 'ale_linters#elm#make#GetExecutable', \ 'executable': 'elm-make',
\ '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'

View File

@@ -17,7 +17,7 @@ function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
" error.erl:4: variable 'B' is unbound " error.erl:4: variable 'B' is unbound
" error.erl:3: Warning: function main/0 is unused " error.erl:3: Warning: function main/0 is unused
" error.erl:4: Warning: variable 'A' is unused " error.erl:4: Warning: variable 'A' is unused
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+): (Warning: )?(.+)$' let l:pattern = '\v^([^:]+):(\d+): (Warning: )?(.+)$'
" parse_transforms are a special case. The error message does not indicate a location: " parse_transforms are a special case. The error message does not indicate a location:
" error.erl: undefined parse transform 'some_parse_transform' " error.erl: undefined parse transform 'some_parse_transform'

View File

@@ -1,46 +0,0 @@
" 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',
\})

View File

@@ -4,8 +4,7 @@
call ale#linter#Define('go', { call ale#linter#Define('go', {
\ 'name': 'gosimple', \ 'name': 'gosimple',
\ 'executable': 'gosimple', \ 'executable': 'gosimple',
\ 'command': 'gosimple %s', \ 'command': 'gosimple %t',
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\ 'output_stream': 'both', \ 'output_stream': 'both'
\ 'lint_file': 1,
\}) \})

View File

@@ -4,8 +4,7 @@
call ale#linter#Define('go', { call ale#linter#Define('go', {
\ 'name': 'staticcheck', \ 'name': 'staticcheck',
\ 'executable': 'staticcheck', \ 'executable': 'staticcheck',
\ 'command': 'staticcheck %s', \ 'command': 'staticcheck %t',
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\ 'output_stream': 'both', \ 'output_stream': 'both'
\ 'lint_file': 1,
\}) \})

View File

@@ -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

View File

@@ -14,11 +14,6 @@ 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
@@ -49,10 +44,7 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths) abort
" Create .class files in a temporary directory, which we will delete later. " Create .class files in a temporary directory, which we will delete later.
let l:class_file_directory = ale#engine#CreateDirectory(a:buffer) let l:class_file_directory = ale#engine#CreateDirectory(a:buffer)
" Always run javac from the directory the file is in, so we can resolve return 'javac -Xlint'
" relative paths correctly.
return ale#path#BufferCdString(a:buffer)
\ . 'javac -Xlint'
\ . ' ' . l:cp_option \ . ' ' . l:cp_option
\ . ' ' . l:sp_option \ . ' ' . l:sp_option
\ . ' -d ' . ale#Escape(l:class_file_directory) \ . ' -d ' . ale#Escape(l:class_file_directory)
@@ -66,15 +58,14 @@ function! ale_linters#java#javac#Handle(buffer, lines) abort
" Main.java:13: warning: [deprecation] donaught() in Testclass has been deprecated " Main.java:13: warning: [deprecation] donaught() in Testclass has been deprecated
" Main.java:16: error: ';' expected " Main.java:16: error: ';' expected
let l:directory = expand('#' . a:buffer . ':p:h') let l:pattern = '\v^.*:(\d+): (.+):(.+)$'
let l:pattern = '\v^(.*):(\d+): (.+):(.+)$'
let l:col_pattern = '\v^(\s*\^)$' let l:col_pattern = '\v^(\s*\^)$'
let l:symbol_pattern = '\v^ +symbol: *(class|method) +([^ ]+)' let l:symbol_pattern = '\v^ +symbol: *(class|method) +([^ ]+)'
let l:output = [] let l:output = []
for l:match in ale#util#GetMatches(a:lines, [l:pattern, l:col_pattern, l:symbol_pattern]) for l:match in ale#util#GetMatches(a:lines, [l:pattern, l:col_pattern, l:symbol_pattern])
if empty(l:match[2]) && empty(l:match[3]) if empty(l:match[2]) && empty(l:match[3])
let l:output[-1].col = len(l:match[1]) let l:output[-1].col = len(l:match[1])
elseif empty(l:match[3]) elseif empty(l:match[3])
" Add symbols to 'cannot find symbol' errors. " Add symbols to 'cannot find symbol' errors.
if l:output[-1].text is# 'error: cannot find symbol' if l:output[-1].text is# 'error: cannot find symbol'
@@ -82,10 +73,9 @@ function! ale_linters#java#javac#Handle(buffer, lines) abort
endif endif
else else
call add(l:output, { call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:directory, l:match[1]), \ 'lnum': l:match[1] + 0,
\ 'lnum': l:match[2] + 0, \ 'text': l:match[2] . ':' . l:match[3],
\ 'text': l:match[3] . ':' . l:match[4], \ 'type': l:match[2] is# 'error' ? 'E' : 'W',
\ 'type': l:match[3] is# 'error' ? 'E' : 'W',
\}) \})
endif endif
endfor endfor

View File

@@ -1,35 +0,0 @@
" 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',
\})

View File

@@ -26,12 +26,6 @@ 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,

View File

@@ -1,28 +0,0 @@
" 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',
\})

View File

@@ -30,6 +30,6 @@ call ale#linter#Define('php', {
\ 'name': 'php', \ 'name': 'php',
\ 'executable': 'php', \ 'executable': 'php',
\ 'output_stream': 'stdout', \ 'output_stream': 'stdout',
\ 'command': 'php -l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 --', \ 'command': 'php -l -d error_reporting=E_ALL -d display_errors=1 --',
\ 'callback': 'ale_linters#php#php#Handle', \ 'callback': 'ale_linters#php#php#Handle',
\}) \})

View File

@@ -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\+\)\s\+\(.\+\)$' let l:pattern = '^.*:\(\d\+\)\t\(.\+\)$'
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)

View File

@@ -4,7 +4,6 @@
" 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')
@@ -13,16 +12,10 @@ 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

View File

@@ -1,14 +1,9 @@
" 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)[1], eval(parse(text = commandArgs(TRUE)[2])))') . ' %t' . ' ' . ale#Escape(ale#Var(a:buffer, 'r_lintr_options')) \ . 'Rscript -e ' . ale#Escape('lintr::lint(commandArgs(TRUE))') . ' %t'
endfunction endfunction
call ale#linter#Define('r', { call ale#linter#Define('r', {

View File

@@ -7,19 +7,23 @@ 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, {
\ 'filename': l:rails_root . l:sep . l:warning.file, \ 'lnum': l:line,
\ 'lnum': l:line, \ 'type': 'W',
\ 'type': 'W', \ 'text': l:text,
\ 'text': l:text,
\}) \})
endfor endfor

View File

@@ -26,6 +26,6 @@ call ale#linter#Define('rust', {
\ 'executable_callback': 'ale_linters#rust#cargo#GetCargoExecutable', \ 'executable_callback': 'ale_linters#rust#cargo#GetCargoExecutable',
\ 'command_callback': 'ale_linters#rust#cargo#GetCommand', \ 'command_callback': 'ale_linters#rust#cargo#GetCommand',
\ 'callback': 'ale#handlers#rust#HandleRustErrors', \ 'callback': 'ale#handlers#rust#HandleRustErrors',
\ 'output_stream': 'both', \ 'output_stream': 'stdout',
\ 'lint_file': 1, \ 'lint_file': 1,
\}) \})

View File

@@ -8,21 +8,10 @@ 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\+\)$',

View File

@@ -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-separated error " This global variable can be set with a string of comma-seperated 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'
@@ -23,20 +23,15 @@ function! ale_linters#sh#shellcheck#GetDialectArgument(buffer) abort
let l:shell_type = ale#handlers#sh#GetShellType(a:buffer) let l:shell_type = ale#handlers#sh#GetShellType(a:buffer)
if !empty(l:shell_type) if !empty(l:shell_type)
" Use the dash dialect for /bin/ash, etc.
if l:shell_type is# 'ash'
return 'dash'
endif
return l:shell_type return l:shell_type
endif endif
" If there's no hashbang, try using Vim's buffer variables. " If there's no hashbang, try using Vim's buffer variables.
if getbufvar(a:buffer, 'is_bash', 0) if get(b:, 'is_bash')
return 'bash' return 'bash'
elseif getbufvar(a:buffer, 'is_sh', 0) elseif get(b:, 'is_sh')
return 'sh' return 'sh'
elseif getbufvar(a:buffer, 'is_kornshell', 0) elseif get(b:, 'is_kornshell')
return 'ksh' return 'ksh'
endif endif
@@ -49,9 +44,9 @@ function! ale_linters#sh#shellcheck#GetCommand(buffer) abort
let l:dialect = ale_linters#sh#shellcheck#GetDialectArgument(a:buffer) 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)
\ . (!empty(l:dialect) ? ' -s ' . l:dialect : '')
\ . (!empty(l:options) ? ' ' . l:options : '') \ . (!empty(l:options) ? ' ' . l:options : '')
\ . (!empty(l:exclude_option) ? ' -e ' . l:exclude_option : '') \ . (!empty(l:exclude_option) ? ' -e ' . l:exclude_option : '')
\ . (!empty(l:dialect) ? ' -s ' . l:dialect : '')
\ . ' -f gcc -' \ . ' -f gcc -'
endfunction endfunction

View File

@@ -1,25 +1,5 @@
" Author: Markus Doits - https://github.com/doits " Author: Markus Doits - https://github.com/doits
" Description: slim-lint for Slim files " Description: slim-lint for Slim files, based on hamllint.vim
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:
@@ -41,6 +21,6 @@ endfunction
call ale#linter#Define('slim', { call ale#linter#Define('slim', {
\ 'name': 'slimlint', \ 'name': 'slimlint',
\ 'executable': 'slim-lint', \ 'executable': 'slim-lint',
\ 'command_callback': 'ale_linters#slim#slimlint#GetCommand', \ 'command': 'slim-lint %t',
\ 'callback': 'ale_linters#slim#slimlint#Handle' \ 'callback': 'ale_linters#slim#slimlint#Handle'
\}) \})

View File

@@ -1,9 +1,47 @@
" Author: Paulo Alem <paulo.alem@gmail.com>, Jake Zimmerman <jake@zimmerman.io> " Author: Paulo Alem <paulo.alem@gmail.com>
" Description: Single-file SML checking with SML/NJ compiler " Description: Rudimentary SML checking with smlnj 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_callback': 'ale#handlers#sml#GetExecutableSmlnjFile', \ 'executable': 'sml',
\ 'command': 'sml', \ 'command': 'sml',
\ 'callback': 'ale#handlers#sml#Handle', \ 'callback': 'ale_linters#sml#smlnj#Handle',
\}) \})

View File

@@ -1,19 +0,0 @@
" 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

View File

@@ -1,9 +0,0 @@
" 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',
\})

View File

@@ -1,91 +0,0 @@
" 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',
\})

View File

@@ -1,11 +1,9 @@
" Author: Prashanth Chandra <https://github.com/prashcr>, Jonathan Clem <https://jclem.net> " Author: Prashanth Chandra https://github.com/prashcr
" 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', [
@@ -14,20 +12,10 @@ 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 = []
for l:error in ale#util#FuzzyJSONDecode(a:lines, []) for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
if get(l:error, 'ruleName', '') is# 'no-implicit-dependencies'
continue
endif
call add(l:output, { call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:dir, l:error.name), \ 'filename': ale#path#GetAbsPath(l:dir, l:error.name),
\ 'type': (get(l:error, 'ruleSeverity', '') is# 'WARNING' ? 'W' : 'E'), \ 'type': (get(l:error, 'ruleSeverity', '') is# 'WARNING' ? 'W' : 'E'),
@@ -50,20 +38,15 @@ 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

View File

@@ -38,57 +38,17 @@ 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
if index(g:ale_filetype_blacklist, getbufvar(a:buffer, '&filetype')) >= 0 " OR if ALE is running in the sandbox
return 1 return index(g:ale_filetype_blacklist, &filetype) >= 0
endif \ || (exists('*getcmdwintype') && !empty(getcmdwintype()))
\ || ale#util#InSandbox()
" Do nothing if running from command mode \ || !ale#Var(a:buffer, 'enabled')
if s:getcmdwintype_exists && !empty(getcmdwintype()) \ || ale#FileTooLarge()
return 1 \ || getbufvar(a:buffer, '&l:statusline') =~# 'CtrlPMode.*funky'
endif
let l:filename = fnamemodify(bufname(a:buffer), ':t')
if l:filename is# '.'
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])
@@ -124,7 +84,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[a:buffer] = 1 let s:should_lint_file_for_buffer[bufnr('%')] = 1
endif endif
if s:lint_timer != -1 if s:lint_timer != -1

View File

@@ -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 occurrences in the string with the name of the current " Replace all %s occurences 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')

View File

@@ -282,23 +282,7 @@ function! s:TimerHandler(...) abort
endif endif
endfunction endfunction
" Stop any completion timer that is queued. This is useful for tests.
function! ale#completion#StopTimer() abort
if s:timer_id != -1
call timer_stop(s:timer_id)
endif
let s:timer_id = -1
endfunction
function! ale#completion#Queue() abort function! ale#completion#Queue() abort
let l:time = get(b:, 'ale_complete_done_time', 0)
if l:time && ale#util#ClockMilliseconds() - l:time < 100
" Do not ask for completions shortly after we just closed the menu.
return
endif
let s:timer_pos = getcurpos()[1:2] let s:timer_pos = getcurpos()[1:2]
" If we changed the text again while we're still waiting for a response, " If we changed the text again while we're still waiting for a response,
@@ -307,7 +291,9 @@ function! ale#completion#Queue() abort
let b:ale_completion_info.request_id = 0 let b:ale_completion_info.request_id = 0
endif endif
call ale#completion#StopTimer() if s:timer_id != -1
call timer_stop(s:timer_id)
endif
let s:timer_id = timer_start(g:ale_completion_delay, function('s:TimerHandler')) let s:timer_id = timer_start(g:ale_completion_delay, function('s:TimerHandler'))
endfunction endfunction
@@ -325,9 +311,6 @@ function! ale#completion#Done() abort
let &l:completeopt = b:ale_old_completopt let &l:completeopt = b:ale_old_completopt
unlet b:ale_old_completopt unlet b:ale_old_completopt
endif endif
" Set a timestamp, so we can avoid requesting completions again.
let b:ale_complete_done_time = ale#util#ClockMilliseconds()
endfunction endfunction
function! s:Setup(enabled) abort function! s:Setup(enabled) abort

View File

@@ -3,6 +3,15 @@
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
@@ -75,12 +84,12 @@ function! ale#cursor#EchoCursorWarning(...) abort
endfunction endfunction
function! s:EchoImpl() abort function! s:EchoImpl() abort
" Only echo the warnings in normal mode, otherwise we will get problems. if ale#ShouldDoNothing(bufnr(''))
if mode() isnot# 'n'
return return
endif endif
if ale#ShouldDoNothing(bufnr('')) " Only echo the warnings in normal mode, otherwise we will get problems.
if mode() isnot# 'n'
return return
endif endif
@@ -99,8 +108,15 @@ function! s:EchoImpl() abort
endfunction endfunction
function! ale#cursor#EchoCursorWarningWithDelay() abort function! ale#cursor#EchoCursorWarningWithDelay() abort
" Only echo the warnings in normal mode, otherwise we will get problems. return ale#CallWithCooldown(
if mode() isnot# 'n' \ 'dont_echo_with_delay_until',
\ function('s:EchoWithDelayImpl'),
\ [],
\)
endfunction
function! s:EchoWithDelayImpl() abort
if ale#ShouldDoNothing(bufnr(''))
return return
endif endif
@@ -113,23 +129,18 @@ function! ale#cursor#EchoCursorWarningWithDelay() 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( let s:cursor_timer = timer_start(10, function('ale#cursor#EchoCursorWarning'))
\ l:delay,
\ function('ale#cursor#EchoCursorWarning')
\)
endif endif
endfunction endfunction
function! ale#cursor#ShowCursorDetail() abort function! ale#cursor#ShowCursorDetail() abort
" Only echo the warnings in normal mode, otherwise we will get problems. if ale#ShouldDoNothing(bufnr(''))
if mode() isnot# 'n'
return return
endif endif
if ale#ShouldDoNothing(bufnr('')) " Only echo the warnings in normal mode, otherwise we will get problems.
if mode() isnot# 'n'
return return
endif endif

View File

@@ -375,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')
\&& !ale#path#IsTempName(l:old_item.filename) \&& l:old_item.filename[:len(s:temp_dir) - 1] isnot# s:temp_dir
" 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
@@ -573,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 asynchronous command after the other, " Run a chain of commands, one asychronous 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]
@@ -801,11 +801,6 @@ 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
@@ -841,7 +836,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, get(l:info, 'job_list', [])) call extend(l:job_list, 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.
@@ -889,7 +884,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 get(l:info, 'job_list', []) for l:job_id in 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

View File

@@ -1,27 +1,15 @@
" 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') let l:should_lint = ale#Var(a:buffer, 'enabled') && g:ale_lint_on_save
\ && 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 && !ale#events#QuitRecently(a:buffer) if l:should_lint
call ale#Queue(0, 'lint_file', a:buffer) call ale#Queue(0, 'lint_file', a:buffer)
endif endif
endfunction endfunction
@@ -36,8 +24,6 @@ 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)
@@ -47,13 +33,7 @@ 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 we're setting the filetype for the first time after it was blank, if a:new_filetype isnot# l:filetype
" 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

View File

@@ -56,9 +56,7 @@ 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 if g:ale_enabled && l:should_lint
\&& 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
@@ -98,11 +96,6 @@ 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)
@@ -115,7 +108,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:buffer, \ 'buffer': l:job_info.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,
@@ -216,12 +209,6 @@ 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

View File

@@ -27,11 +27,6 @@ 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'],
@@ -39,7 +34,7 @@ let s:default_registry = {
\ }, \ },
\ 'prettier': { \ 'prettier': {
\ 'function': 'ale#fixers#prettier#Fix', \ 'function': 'ale#fixers#prettier#Fix',
\ 'suggested_filetypes': ['javascript', 'typescript', 'json', 'css', 'scss', 'less'], \ 'suggested_filetypes': ['javascript'],
\ 'description': 'Apply prettier to a file.', \ 'description': 'Apply prettier to a file.',
\ }, \ },
\ 'prettier_eslint': { \ 'prettier_eslint': {
@@ -57,11 +52,6 @@ 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'],
@@ -97,16 +87,6 @@ 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.

View File

@@ -1,9 +1,29 @@
" 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: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(l:path . '/' . l:basename)
if filereadable(l:config)
return l:config
endif
endfor
endfor
return ale#path#FindNearestFile(a:buffer, 'package.json')
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 = ale#handlers#eslint#FindConfig(a:buffer) let l:config = s:FindConfig(a:buffer)
if empty(l:config) if empty(l:config)
return 0 return 0

View File

@@ -1,23 +0,0 @@
" 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

View File

@@ -10,16 +10,3 @@ 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

View File

@@ -1,18 +0,0 @@
" 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

View File

@@ -1,37 +1,13 @@
" Author: tunnckoCore (Charlike Mike Reagent) <mameto2011@gmail.com>, " Author: tunnckoCore (Charlike Mike Reagent) <mameto2011@gmail.com>,
" w0rp <devw0rp@gmail.com>, morhetz (Pavel Pertsev) <morhetz@gmail.com> " w0rp <devw0rp@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',
\]) \])
@@ -39,31 +15,11 @@ 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'
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ' ' . l:options
\ . (l:use_config ? ' --config ' . ale#Escape(l:config) : '')
\ . ' --write', \ . ' --write',
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\} \}

View File

@@ -1,39 +1,25 @@
" Author: tunnckoCore (Charlike Mike Reagent) <mameto2011@gmail.com>, " Author: tunnckoCore (Charlike Mike Reagent) <mameto2011@gmail.com>,
" w0rp <devw0rp@gmail.com>, morhetz (Pavel Pertsev) <morhetz@gmail.com> " w0rp <devw0rp@gmail.com>
" Description: Integration between Prettier and ESLint. " Description: Integration between Prettier and ESLint.
function! ale#fixers#prettier_eslint#SetOptionDefaults() abort call ale#Set('javascript_prettier_eslint_executable', 'prettier-eslint')
call ale#Set('javascript_prettier_eslint_executable', 'prettier-eslint') call ale#Set('javascript_prettier_eslint_use_global', 0)
call ale#Set('javascript_prettier_eslint_use_global', 0) call ale#Set('javascript_prettier_eslint_options', '')
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/dist/index.js', \ 'node_modules/prettier-eslint-cli/index.js',
\ 'node_modules/.bin/prettier-eslint', \ 'node_modules/.bin/prettier-eslint',
\]) \])
endfunction endfunction
function! ale#fixers#prettier_eslint#Fix(buffer) abort function! ale#fixers#prettier_eslint#Fix(buffer, lines) 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(l:executable) \ 'command': ale#Escape(ale#fixers#prettier_eslint#GetExecutable(a:buffer))
\ . ' %t' \ . ' %t'
\ . l:eslint_config_option \ . ' ' . l:options
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --write', \ . ' --write',
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\} \}

View File

@@ -1,10 +1,6 @@
" 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',

View File

@@ -1,22 +0,0 @@
" 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

View File

@@ -2,30 +2,20 @@
" 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
@@ -38,7 +28,6 @@ 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
@@ -58,9 +47,7 @@ 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)
\ . ale#Escape(l:executable) \ . l:executable . ' -I ' . s:script_path . '/gradle/init.gradle -q printClasspath'
\ . ' -I ' . ale#Escape(s:init_path)
\ . ' -q printClasspath'
endif endif
return '' return ''

View File

@@ -1,33 +1,11 @@
" 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',

View File

@@ -1,25 +1,12 @@
" 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') let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+):(.*)?$'
" 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^\s*([a-zA-Z]?:?[^:]+):(\d+):(\d+):(.*)?$'
let l:output = [] let l:output = []
let l:corrected_lines = [] let l:corrected_lines = []
@@ -64,9 +51,6 @@ 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,

View File

@@ -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
function! s:FindSpan(buffer, span) abort " returns: a list [lnum, col] with the location of the error or []
if ale#path#IsBufferPath(a:buffer, a:span.file_name) || a:span.file_name is# '<anon>' function! s:FindErrorInExpansion(span, buffer) abort
return a:span if ale#path#IsBufferPath(a:buffer, a:span.file_name)
return [a:span.line_start, a:span.line_end, a:span.byte_start, a:span.byte_end]
endif endif
" Search inside the expansion of an error, as the problem for this buffer if !empty(a:span.expansion)
" could lie inside a nested object. return s:FindErrorInExpansion(a:span.expansion.span, a:buffer)
if !empty(get(a:span, 'expansion', v:null))
return s:FindSpan(a:buffer, a:span.expansion.span)
endif endif
return {} return []
endfunction endfunction
function! ale#handlers#rust#HandleRustErrors(buffer, lines) abort " A handler function which accepts a file name, to make unit testing easier.
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,10 +44,11 @@ function! ale#handlers#rust#HandleRustErrors(buffer, lines) abort
continue continue
endif endif
for l:root_span in l:error.spans for l:span in l:error.spans
let l:span = s:FindSpan(a:buffer, l:root_span) if (
\ l:span.is_primary
if !empty(l:span) \ && (ale#path#IsBufferPath(a:buffer, l:span.file_name) || l:span.file_name is# '<anon>')
\)
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,
@@ -56,9 +57,29 @@ function! ale#handlers#rust#HandleRustErrors(buffer, lines) abort
\ '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

View File

@@ -9,7 +9,7 @@ function! ale#handlers#sh#GetShellType(buffer) abort
" Remove options like -e, etc. " Remove options like -e, etc.
let l:command = substitute(l:bang_line, ' --\?[a-zA-Z0-9]\+', '', 'g') let l:command = substitute(l:bang_line, ' --\?[a-zA-Z0-9]\+', '', 'g')
for l:possible_shell in ['bash', 'dash', 'ash', 'tcsh', 'csh', 'zsh', 'sh'] for l:possible_shell in ['bash', 'tcsh', 'csh', 'zsh', 'sh']
if l:command =~# l:possible_shell . '\s*$' if l:command =~# l:possible_shell . '\s*$'
return l:possible_shell return l:possible_shell
endif endif

View File

@@ -1,92 +0,0 @@
" 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

View File

@@ -1,5 +1,5 @@
" Author: w0rp <devw0rp@gmail.com> " Author: w0rp <devw0rp@gmail.com>
" Description: APIs for working with Asynchronous jobs, with an API normalised " Deciption: 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,11 +25,6 @@ endfunction
" Note that jobs and IDs are the same thing on NeoVim. " Note that jobs and IDs are the same thing on NeoVim.
function! ale#job#JoinNeovimOutput(job, last_line, data, mode, callback) abort function! ale#job#JoinNeovimOutput(job, last_line, data, mode, callback) abort
if a:mode is# 'raw'
call a:callback(a:job, join(a:data, "\n"))
return ''
endif
let l:lines = a:data[:-2] let l:lines = a:data[:-2]
if len(a:data) > 1 if len(a:data) > 1
@@ -39,9 +34,15 @@ function! ale#job#JoinNeovimOutput(job, last_line, data, mode, callback) abort
let l:new_last_line = a:last_line . a:data[0] let l:new_last_line = a:last_line . a:data[0]
endif endif
for l:line in l:lines if a:mode is# 'raw'
call a:callback(a:job, l:line) if !empty(l:lines)
endfor call a:callback(a:job, join(l:lines, "\n") . "\n")
endif
else
for l:line in l:lines
call a:callback(a:job, l:line)
endfor
endif
return l:new_last_line return l:new_last_line
endfunction endfunction
@@ -289,7 +290,7 @@ function! ale#job#Stop(job_id) abort
" FIXME: NeoVim kills jobs on a timer, but will not kill any processes " FIXME: NeoVim kills jobs on a timer, but will not kill any processes
" which are child processes on Unix. Some work needs to be done to " which are child processes on Unix. Some work needs to be done to
" kill child processes to stop long-running processes like pylint. " kill child processes to stop long-running processes like pylint.
silent! call jobstop(a:job_id) call jobstop(a:job_id)
else else
let l:job = s:job_map[a:job_id].job let l:job = s:job_map[a:job_id].job

View File

@@ -305,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-separated filetypes. " Handle dot-seperated 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)

View File

@@ -53,7 +53,7 @@ function! ale#lsp#message#DidOpen(buffer, language_id) abort
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ 'languageId': a:language_id, \ 'languageId': a:language_id,
\ 'version': ale#lsp#message#GetNextVersionID(), \ 'version': ale#lsp#message#GetNextVersionID(),
\ 'text': join(l:lines, "\n") . "\n", \ 'text': join(l:lines, "\n"),
\ }, \ },
\}] \}]
endfunction endfunction
@@ -67,7 +67,7 @@ function! ale#lsp#message#DidChange(buffer) abort
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ 'version': ale#lsp#message#GetNextVersionID(), \ 'version': ale#lsp#message#GetNextVersionID(),
\ }, \ },
\ 'contentChanges': [{'text': join(l:lines, "\n") . "\n"}] \ 'contentChanges': [{'text': join(l:lines, "\n")}]
\}] \}]
endfunction endfunction

View File

@@ -28,7 +28,7 @@ function! ale#lsp#tsserver_message#Change(buffer) abort
\ 'offset': 1, \ 'offset': 1,
\ 'endLine': 1073741824, \ 'endLine': 1073741824,
\ 'endOffset': 1, \ 'endOffset': 1,
\ 'insertString': join(l:lines, "\n") . "\n", \ 'insertString': join(l:lines, "\n"),
\}] \}]
endfunction endfunction

View File

@@ -7,26 +7,6 @@ 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
@@ -88,12 +68,22 @@ 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
return a:filename[:len(s:temp_dir) - 1] is# s:temp_dir let l:prefix_list = [
\ $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
@@ -185,12 +175,5 @@ function! ale#path#FromURI(uri) abort
let l:i = len('file://') let l:i = len('file://')
let l:encoded_path = a:uri[: l:i - 1] is# 'file://' ? a:uri[l:i :] : a:uri let l:encoded_path = a:uri[: l:i - 1] is# 'file://' ? a:uri[l:i :] : a:uri
let l:path = ale#uri#Decode(l:encoded_path) return ale#uri#Decode(l:encoded_path)
" If the path is like /C:/foo/bar, it should be C:\foo\bar instead.
if l:path =~# '^/[a-zA-Z]:'
let l:path = substitute(l:path[1:], '/', '\\', 'g')
endif
return l:path
endfunction endfunction

View File

@@ -1,7 +1,6 @@
" 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', [
@@ -12,6 +11,7 @@ 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,20 +58,15 @@ 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( let l:venv_dir = ale#path#Simplify(l:path . '/' . l:dirname)
\ 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(l:script_filename) if filereadable(ale#path#Simplify(l:venv_dir . '/' . s:bin_dir . '/activate'))
return l:venv_dir return l:venv_dir
endif endif
endfor endfor
endfor endfor
return $VIRTUAL_ENV return ''
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.
@@ -86,9 +81,7 @@ 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( let l:ve_executable = ale#path#Simplify(l:virtualenv . '/' . s:bin_dir . '/' . l:path)
\ join([l:virtualenv, s:bin_dir, l:path], s:sep)
\)
if executable(l:ve_executable) if executable(l:ve_executable)
return l:ve_executable return l:ve_executable

View File

@@ -209,17 +209,7 @@ function! s:UpdateLineNumbers(buffer, current_sign_list, loclist) abort
endif endif
endfunction endfunction
function! s:BuildSignMap(buffer, current_sign_list, grouped_items) abort function! s:BuildSignMap(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
@@ -245,7 +235,7 @@ function! s:BuildSignMap(buffer, current_sign_list, grouped_items) abort
let l:sign_map[l:line] = l:sign_info let l:sign_map[l:line] = l:sign_info
endfor endfor
for l:group in l:selected_grouped_items for l:group in a: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_list': [], \ 'current_id_list': [],
@@ -356,11 +346,7 @@ 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( let l:sign_map = s:BuildSignMap(l:current_sign_list, l:grouped_items)
\ 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,

View File

@@ -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() " no-custom-checks let g:dir = getcwd()
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() " no-custom-checks let l:dir = getcwd()
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#Winify(l:full_path)) silent noautocmd execute 'file ' . fnameescape(ale#path#Simplify(l:full_path))
endfunction endfunction

View File

@@ -75,7 +75,6 @@ fi
check_errors \ check_errors \
'^function.*) *$' \ '^function.*) *$' \
'Function without abort keyword (See :help except-compat)' 'Function without abort keyword (See :help except-compat)'
check_errors '^function[^!]' 'function without !'
check_errors ' \+$' 'Trailing whitespace' check_errors ' \+$' 'Trailing whitespace'
check_errors '^ * end\?i\? *$' 'Write endif, not en, end, or endi' check_errors '^ * end\?i\? *$' 'Write endif, not en, end, or endi'
check_errors '^ [^ ]' 'Use four spaces, not two spaces' check_errors '^ [^ ]' 'Use four spaces, not two spaces'
@@ -85,7 +84,6 @@ check_errors 'let g:ale_\w\+_\w\+_args =' 'Name your option g:ale_<filetype>_<li
check_errors 'shellescape(' 'Use ale#Escape instead of shellescape' check_errors 'shellescape(' 'Use ale#Escape instead of shellescape'
check_errors 'simplify(' 'Use ale#path#Simplify instead of simplify' check_errors 'simplify(' 'Use ale#path#Simplify instead of simplify'
check_errors "expand(['\"]%" "Use expand('#' . a:buffer . '...') instead. You might get a filename for the wrong buffer." check_errors "expand(['\"]%" "Use expand('#' . a:buffer . '...') instead. You might get a filename for the wrong buffer."
check_errors 'getcwd()' "Do not use getcwd(), as it could run from the wrong buffer. Use expand('#' . a:buffer . ':p:h') instead."
check_errors '==#' "Use 'is#' instead of '==#'. 0 ==# 'foobar' is true" check_errors '==#' "Use 'is#' instead of '==#'. 0 ==# 'foobar' is true"
check_errors '==?' "Use 'is?' instead of '==?'. 0 ==? 'foobar' is true" check_errors '==?' "Use 'is?' instead of '==?'. 0 ==? 'foobar' is true"
check_errors '!=#' "Use 'isnot#' instead of '!=#'. 0 !=# 'foobar' is false" check_errors '!=#' "Use 'isnot#' instead of '!=#'. 0 !=# 'foobar' is false"

View File

@@ -1,5 +1,5 @@
=============================================================================== ===============================================================================
ALE ASM Integration *ale-asm-options* ALE Assembly Integration *ale-asm-options*
=============================================================================== ===============================================================================

View File

@@ -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: `''`

View File

@@ -2,37 +2,6 @@
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*
@@ -52,78 +21,6 @@ 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*
@@ -162,5 +59,24 @@ 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:

View File

@@ -3,7 +3,7 @@ ALE Chef Integration *ale-chef-options*
=============================================================================== ===============================================================================
foodcritic *ale-chef-foodcritic* foodcritc *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*

View File

@@ -5,7 +5,7 @@ ALE CMake Integration *ale-cmake-options*
=============================================================================== ===============================================================================
cmakelint *ale-cmake-cmakelint* cmakelint *ale-cmake-cmakelint*
g:ale_cmake_cmakelint_executable *g:ale_cmake_cmakelint_executable* g:ale_cmake_cmakelint_exectuable *g:ale_cmake_cmakelint_executable*
*b:ale_cmake_cmakelint_executable* *b:ale_cmake_cmakelint_executable*
Type: |String| Type: |String|
Default: `'cmakelint'` Default: `'cmakelint'`

View File

@@ -5,9 +5,33 @@ ALE C++ Integration *ale-cpp-options*
=============================================================================== ===============================================================================
Global Options Global Options
The |g:ale_c_build_dir_names| and |g:ale_c_build_dir| also apply to some C++ g:ale_c_build_dir_names *g:ale_c_build_dir_names*
linters too. *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-cpp-clang* clang *ale-cpp-clang*
@@ -59,13 +83,6 @@ 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*
@@ -172,5 +189,12 @@ 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:

View File

@@ -1,102 +0,0 @@
===============================================================================
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:

View File

@@ -2,12 +2,6 @@
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*
@@ -19,8 +13,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: `''`

View File

@@ -1,25 +0,0 @@
===============================================================================
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:

View File

@@ -1,50 +0,0 @@
===============================================================================
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:

View File

@@ -3,7 +3,7 @@ ALE FusionScript Integration *ale-fuse-options*
=============================================================================== ===============================================================================
fusion-lint *ale-fuse-fusionlint* 4.12. fusionlint *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*

View File

@@ -1,36 +0,0 @@
===============================================================================
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:

View File

@@ -20,16 +20,6 @@ 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*

View File

@@ -1,6 +1,16 @@
=============================================================================== ===============================================================================
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*
@@ -20,17 +30,5 @@ 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:

View File

@@ -60,6 +60,105 @@ 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*
@@ -117,117 +216,6 @@ 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*

View File

@@ -1,18 +0,0 @@
===============================================================================
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:

View File

@@ -1,12 +0,0 @@
===============================================================================
ALE Less Integration *ale-less-options*
===============================================================================
prettier *ale-less-prettier*
See |ale-javascript-prettier| for information about the available options.
===============================================================================

View File

@@ -1,19 +0,0 @@
===============================================================================
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:

View File

@@ -3,7 +3,7 @@ ALE Lua Integration *ale-lua-options*
=============================================================================== ===============================================================================
luacheck *ale-lua-luacheck* 4.12. 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*

View File

@@ -35,6 +35,67 @@ 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*
@@ -63,74 +124,5 @@ 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:

View File

@@ -1,20 +0,0 @@
===============================================================================
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:

View File

@@ -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
compilation of Rust code, and can check Rust files while you type. `rls` compliation 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,

View File

@@ -5,28 +5,14 @@ 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 configuration file. A string containing the location of a global fallback config file.
By default, ALE will look for a config file named `scalastyle_config.xml` or
By default, ALE will look for a configuration file named `scalastyle-config.xml` in the current file's directory or parent directories.
`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*
@@ -35,6 +21,5 @@ 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:

View File

@@ -2,12 +2,6 @@
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*

View File

@@ -1,36 +0,0 @@
===============================================================================
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:

View File

@@ -1,16 +0,0 @@
===============================================================================
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:

View File

@@ -1,5 +1,5 @@
=============================================================================== ===============================================================================
ALE Spec Integration *ale-spec-options* ALE RPM Spec Integration *ale-spec-options*
*ale-integration-spec* *ale-integration-spec*
=============================================================================== ===============================================================================

View File

@@ -1,5 +1,5 @@
=============================================================================== ===============================================================================
ALE Stylus Integration *ale-stylus-options* ALE CSS Integration *ale-stylus-options*
=============================================================================== ===============================================================================

View File

@@ -1,46 +0,0 @@
===============================================================================
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:

View File

@@ -10,12 +10,6 @@ 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*
@@ -36,26 +30,6 @@ 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|

View File

@@ -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: `''`

View File

@@ -8,49 +8,34 @@ CONTENTS *ale-contents*
1. Introduction.........................|ale-introduction| 1. Introduction.........................|ale-introduction|
2. Supported Languages & Tools..........|ale-support| 2. Supported Languages & Tools..........|ale-support|
3. Linting..............................|ale-lint| 3. Global Options.......................|ale-options|
3.1 Highlights........................|ale-highlights|
4. Fixing Problems......................|ale-fix| 4. Fixing Problems......................|ale-fix|
5. Completion...........................|ale-completion| 5. Completion...........................|ale-completion|
6. Global Options.......................|ale-options| 6. Integration Documentation............|ale-integrations|
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|
c#....................................|ale-cs-options| clang-format........................|ale-cpp-clangformat|
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|
cuda..................................|ale-cuda-options| cmake.................................|ale-cmake-options|
nvcc................................|ale-cuda-nvcc| cmakelint...........................|ale-cmake-cmakelint|
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|
@@ -59,17 +44,13 @@ 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|
@@ -82,23 +63,14 @@ 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|
@@ -113,14 +85,12 @@ 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|
@@ -129,10 +99,6 @@ 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|
@@ -147,15 +113,10 @@ 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|
@@ -165,11 +126,8 @@ 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|
@@ -182,10 +140,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|
8. Commands/Keybinds....................|ale-commands| 7. Commands/Keybinds....................|ale-commands|
9. API..................................|ale-api| 8. API..................................|ale-api|
10. Special Thanks......................|ale-special-thanks| 9. Special Thanks.......................|ale-special-thanks|
11. Contact.............................|ale-contact| 10. Contact.............................|ale-contact|
=============================================================================== ===============================================================================
1. Introduction *ale-introduction* 1. Introduction *ale-introduction*
@@ -216,251 +174,80 @@ for the current buffer.
The following languages and tools are supported. The following languages and tools are supported.
Notes: * ASM: 'gcc'
* Ansible: 'ansible-lint'
`^` No linters for text or Vim help filetypes are enabled by default. * Asciidoc: 'proselint'
`!!` These linters check only files on disk. See |ale-lint-file-linters| * Bash: 'shell' (-n flag), 'shellcheck'
* Bourne Shell: 'shell' (-n flag), 'shellcheck'
* ASM: `gcc` * C: 'cppcheck', 'gcc', 'clang', 'clang-format'
* Ansible: `ansible-lint` * C++ (filetype cpp): 'clang', 'clangtidy', 'cppcheck', 'cpplint', 'gcc', 'clang-format'
* AsciiDoc: `proselint` * C#: 'mcs'
* Awk: `gawk` * Chef: 'foodcritic'
* Bash: `shell` (-n flag), `shellcheck` * CMake: 'cmakelint'
* Bourne Shell: `shell` (-n flag), `shellcheck` * CoffeeScript: 'coffee', 'coffelint'
* C: `cppcheck`, `cpplint`!!, `gcc`, `clang`, `clangtidy`!!, `clang-format` * Crystal: 'crystal'
* C++ (filetype cpp): `clang`, `clangcheck`!!, `clangtidy`!!, `cppcheck`, `cpplint`!!, `gcc`, `clang-format` * CSS: 'csslint', 'stylelint'
* CUDA: `nvcc`!! * Cython (pyrex filetype): 'cython'
* C#: `mcs`, `mcsc`!! * D: 'dmd'
* Chef: `foodcritic` * Dart: 'dartanalyzer'
* CMake: `cmakelint` * Dockerfile: 'hadolint'
* CoffeeScript: `coffee`, `coffeelint` * Elixir: 'credo', 'dogma'
* Crystal: `crystal`!! * Elm: 'elm-make'
* CSS: `csslint`, `stylelint`, `prettier` * Erlang: 'erlc'
* Cython (pyrex filetype): `cython` * Fortran: 'gcc'
* D: `dmd` * Go: 'gofmt', 'go vet', 'golint', 'go build', 'gosimple', 'staticcheck'
* Dart: `dartanalyzer` * FusionScript: 'fusion-lint'
* Dockerfile: `hadolint` * Haml: 'hamllint'
* Elixir: `credo`, `dogma`!! * Handlebars: 'ember-template-lint'
* Elm: `elm-format, elm-make` * Haskell: 'ghc', 'stack-ghc', 'stack-build', 'ghc-mod', 'stack-ghc-mod', 'hlint', 'hdevtools'
* Erb: `erb`, `erubis` * HTML: 'HTMLHint', 'proselint', 'tidy'
* Erlang: `erlc`, `SyntaxErl` * Idris: 'idris'
* Fortran: `gcc` * Java: 'javac'
* FusionScript: `fusion-lint` * JavaScript: 'eslint', 'jscs', 'jshint', 'flow', 'prettier', 'prettier-eslint', 'xo'
* GLSL: glslang * JSON: 'jsonlint'
* Go: `gofmt`, `go vet`, `golint`, `gometalinter`!!, `go build`!!, `gosimple`!!, `staticcheck`!! * Kotlin: 'kotlinc'
* GraphQL: `gqlint` * LaTeX (tex): 'chktex', 'lacheck', 'proselint'
* Haml: `haml-lint` * Lua: 'luacheck'
* Handlebars: `ember-template-lint` * Markdown: 'mdl', 'proselint', 'vale'
* Haskell: `ghc`, `stack-ghc`, `stack-build`!!, `ghc-mod`, `stack-ghc-mod`, `hlint`, `hdevtools` * MATLAB: 'mlint'
* HTML: `HTMLHint`, `proselint`, `tidy` * nim: 'nim check'
* Idris: `idris` * nix: 'nix-instantiate'
* Java: `checkstyle`, `javac` * nroff: 'proselint'
* JavaScript: `eslint`, `jscs`, `jshint`, `flow`, `prettier`, `prettier-eslint` >= 4.2.0, `prettier-standard`, `standard`, `xo` * Objective-C: 'clang'
* JSON: `jsonlint`, `prettier` * Objective-C++: 'clang'
* Kotlin: `kotlinc`, `ktlint` * OCaml: 'merlin' (see |ale-ocaml-merlin|)
* LaTeX (tex): `chktex`, `lacheck`, `proselint` * Perl: 'perl' (-c flag), 'perlcritic'
* LLVM: `llc` * PHP: 'hack', 'langserver', 'php' (-l flag), 'phpcs', 'phpmd', 'phpstan', 'phpcbf'
* Lua: `luacheck` * Pod: 'proselint'
* Markdown: `mdl`, `proselint`, `vale`, `remark-lint` * Pug: 'pug-lint'
* MATLAB: `mlint` * Puppet: 'puppet', 'puppet-lint'
* Nim: `nim check`!! * Python: 'autopep8', 'flake8', 'isort', 'mypy', 'pylint', 'yapf'
* nix: `nix-instantiate` * R: 'lintr'
* nroff: `proselint` * ReasonML: 'merlin'
* Objective-C: `clang` * reStructuredText: 'proselint'
* Objective-C++: `clang` * RPM spec: 'spec'
* OCaml: `merlin` (see |ale-ocaml-merlin|) * Rust: 'cargo', 'rls', 'rustc' (see |ale-integration-rust|)
* Perl: `perl -c`, `perl-critic` * Ruby: 'reek', 'rubocop'
* PHP: `hack`, `langserver`, `php -l`, `phpcs`, `phpmd`, `phpstan`, `phpcbf` * SASS: 'sasslint', 'stylelint'
* Pod: `proselint` * SCSS: 'sasslint', 'scsslint', 'stylelint'
* Pug: `pug-lint` * Scala: 'scalac', 'scalastyle'
* Puppet: `puppet`, `puppet-lint` * Slim: 'slim-lint'
* Python: `autopep8`, `flake8`, `isort`, `mypy`, `pycodestyle`, `pylint`!!, `yapf` * SML: 'smlnj'
* R: `lintr` * Stylus: 'stylelint'
* ReasonML: `merlin` * SQL: 'sqlint'
* reStructuredText: `proselint` * Swift: 'swiftlint', 'swiftformat'
* RPM spec: `rpmlint` * Texinfo: 'proselint'
* Ruby: `brakeman`, `rails_best_practices`!!, `reek`, `rubocop`, `ruby` * Text: 'proselint', 'vale'
* Rust: `cargo`!!, `rls`, `rustc` (see |ale-integration-rust|) * TypeScript: 'eslint', 'tslint', 'tsserver', 'typecheck'
* SASS: `sass-lint`, `stylelint` * Verilog: 'iverilog', 'verilator'
* SCSS: `sass-lint`, `scss-lint`, `stylelint`, `prettier` * Vim: 'vint'
* Scala: `scalac`, `scalastyle` * Vim help: 'proselint'
* Slim: `slim-lint` * XHTML: 'proselint'
* SML: `smlnj` * XML: 'xmllint'
* Solidity: `solium` * YAML: 'swaglint', 'yamllint'
* 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. Linting *ale-lint* 3. Global Options *ale-options*
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*
@@ -543,18 +330,6 @@ 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|
@@ -626,7 +401,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 overridden with variables in each buffer. This variable can be overriden 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*
@@ -737,10 +512,6 @@ 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*
@@ -873,23 +644,6 @@ 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|
@@ -1037,8 +791,6 @@ 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*
@@ -1110,10 +862,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 the This option can be set re-map problem types for linters. Each key in
|Dictionary| should be the name of a linter, and each value must be a the |Dictionary| should be the name of a linter, and each value must be
|Dictionary| mapping problem types from one type to another. The following a |Dictionary| mapping error types from one type to another. The
types are supported: following types are supported:
`'E'` - `{'type': 'E'}` `'E'` - `{'type': 'E'}`
`'ES'` - `{'type': 'E', 'sub_type': 'style'}` `'ES'` - `{'type': 'E', 'sub_type': 'style'}`
@@ -1121,13 +873,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 write For example, if you want to turn flake8 errors into warnings, you can do
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 write the following: > warnings, you can use the following: >
let g:ale_type_map = {'flake8': {'ES': 'E', 'WS': 'W'}} let g:ale_type_map = {'flake8': {'ES': 'E', 'WS': 'W'}}
< <
@@ -1183,7 +935,7 @@ g:ale_windows_node_executable_path *g:ale_windows_node_executable_path*
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
6.1. Highlights *ale-highlights* 3.1. Highlights *ale-highlights*
ALEError *ALEError* ALEError *ALEError*
@@ -1277,7 +1029,98 @@ ALEWarningSign *ALEWarningSign*
=============================================================================== ===============================================================================
7. Integration Documentation *ale-integrations* 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. 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|.
@@ -1310,7 +1153,7 @@ ALE will use to search for Python executables.
=============================================================================== ===============================================================================
8. Commands/Keybinds *ale-commands* 7. Commands/Keybinds *ale-commands*
ALEFix *ALEFix* ALEFix *ALEFix*
@@ -1326,7 +1169,6 @@ 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
@@ -1396,7 +1238,6 @@ 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*
@@ -1415,7 +1256,7 @@ ALEInfoToClipboard *ALEInfoToClipboard*
=============================================================================== ===============================================================================
9. API *ale-api* 8. API *ale-api*
ale#Queue(delay, [linting_flag, buffer_number]) *ale#Queue()* ale#Queue(delay, [linting_flag, buffer_number]) *ale#Queue()*
@@ -1545,7 +1386,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
converted to number using `str2nr()`. coverted 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.
@@ -1696,7 +1537,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 diagnostics automatically, so LSP linters handle diagonstics 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
@@ -1785,12 +1626,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-separated to invoke linters for multiple filetypes: Filetypes may be dot-seperated 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-separated filetypes are broken up into their are applied after dot-seperated filetypes are broken up into their
components. components.
@@ -1823,13 +1664,13 @@ ALELint *ALELint-autocmd*
echoing messges. echoing messges.
=============================================================================== ===============================================================================
10. Special Thanks *ale-special-thanks* 9. 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!
=============================================================================== ===============================================================================
11. Contact *ale-contact* 10. 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
@@ -1837,8 +1678,10 @@ 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:

View File

@@ -118,9 +118,6 @@ 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.
@@ -155,8 +152,6 @@ 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'))
@@ -383,7 +378,6 @@ 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

View File

@@ -209,7 +209,7 @@ if ((run_custom_checks)); then
echo echo
set -o pipefail set -o pipefail
docker run -a stdout "${DOCKER_FLAGS[@]}" test/script/custom-checks . || EXIT=$? docker run -a stdout "${DOCKER_FLAGS[@]}" ./custom-checks . || EXIT=$?
set +o pipefail set +o pipefail
echo echo
@@ -235,33 +235,6 @@ if ((run_custom_checks)); then
<(grep --exclude=tags -roh "\*$tag_regex\*" doc | sort -u | sed 's/*//g') \ <(grep --exclude=tags -roh "\*$tag_regex\*" doc | sort -u | sed 's/*//g') \
<(grep --exclude=tags -roh "|$tag_regex|" doc | sort -u | sed 's/|//g') \ <(grep --exclude=tags -roh "|$tag_regex|" doc | sort -u | sed 's/|//g') \
| grep '^+[^+]' && EXIT=1 | grep '^+[^+]' && EXIT=1
echo '========================================'
echo 'diff README.md and doc/ale.txt tables'
echo '========================================'
echo 'Differences follow:'
echo
test/script/check-supported-tools-tables || EXIT=$?
echo '========================================'
echo 'Look for badly aligned doc tags'
echo '========================================'
echo 'Badly aligned tags follow:'
echo
# Documentation tags need to be aligned to the right margin, so look for
# tags which aren't at the right margin.
grep ' \*[^*]\+\*$' doc/ -r \
| awk '{ sep = index($0, ":"); if (length(substr($0, sep + 1 )) < 79) { print } }' \
| grep . && EXIT=1
echo '========================================'
echo 'Look for table of contents issues'
echo '========================================'
echo
test/script/check-toc || EXIT=$?
fi fi
exit $EXIT exit $EXIT

View File

@@ -1,16 +0,0 @@
@echo off
REM Run tests on Windows.
REM
REM To run these tests, you should set up your Windows machine with the same
REM paths that are used in AppVeyor.
set tests=test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*/*.vader
REM Use the first argument for selecting tests to run.
if not "%1"=="" set tests=%1
set VADER_OUTPUT_FILE=%~dp0\vader_output
type nul > "%VADER_OUTPUT_FILE%"
C:\vim\vim\vim80\vim.exe -u test/vimrc "+Vader! %tests%"
type "%VADER_OUTPUT_FILE%"
del "%VADER_OUTPUT_FILE%"

Some files were not shown because too many files have changed in this diff Show More