Compare commits

...

811 Commits

Author SHA1 Message Date
Shaun Duncan 6996d1c14d
Allow callbacks for floating preview popups (#4247)
* Add extra config options for virtualtext

* Undo virtualtext changes and move to floating preview

* revert changes to pass hightlight group to floating preview

* rename var

* Document changes

* Add updates based on feedback

* Check for string type and attempt to call the function

* Fix lint errors

Co-authored-by: Shaun Duncan <shaun@speedscale.com>
2022-08-23 20:22:52 +09:00
Magnus Groß d93bc2baf7
Use native virtual-text for vim9 (#4281)
Our current virtual text implementation for vim emulates it by abusing
the textprop and popupwin feature from vim 8.2 (for more details see
commit 708e810414).
This implementation sometimes is janky, for example the popups may leak
into other vim windows next to the current window.

Luckily, vim just got native virtual-text support as a proper subtype to
the prop_add() function. By using the 'text' option, the text property
automatically becomes virtual text that is appended to the current line
if col is zero.

Note that the prop_add() method now returns negative IDs for virtual
text properties.

This feature was added in vim 9.0.0067, but it got a lot of bugfixes
which is why we only use this new API if vim has at least version
9.0.0214.
However, there are still some minor bugs with vim's native virtual text,
so we might have to bump the version check again in the future.

Also see #3906.

Now with proper virtual text support for both vim and neovim available,
we can tackle #2962 in the future by simply tracking multiple virt-texts
instead of just the last one.

In the future we might also want to disable our virtual text emulation
support for vim, as it is a total hack, but for now we should keep it
for backwards compatibility.
2022-08-23 20:22:14 +09:00
Erik Westrup 992476982a
Put :ALEInfo in collapsible for bug reports (#4286)
To make the bug reports a bit more readable. See an example of usage
here: https://github.com/dense-analysis/ale/issues/4285
2022-08-18 06:51:01 +09:00
Hongbo Liu 7889983f89
fix #4276: honor b:ale_enabled for hover at cursor (#4277)
* fix #4276: honor b:ale_enabled for hover at cursor

* fix indention
2022-08-18 06:34:34 +09:00
Mo Lawson 233b681029
Add support for syntax_tree fixer (#4268)
This is the library that now powers prettier/plugin-ruby but is also
stands on its own: https://github.com/ruby-syntax-tree/syntax_tree
2022-08-09 21:11:20 +09:00
Nathan Henrie 5063804d44
Add openscad and sca2d support (#4205) 2022-08-07 16:27:17 +09:00
Tomáš Janoušek e10fcf22dc
Prevent buffering of job output and excessive polling (#4259)
When 'close_cb' is set for job_start(), but out_cb or err_cb isn't, vim
buffers data instead of dropping it (in case someone wanted to read and
process it in close_cb), and additionally polls for new data every 10
milliseconds, causing excessive wakeups and CPU usage. Since we don't
read the data anywhere outside of out_cb/err_cb, any LSP that prints an
error to stderr triggers this and vim keeps spinning until :ALEStopAllLSPs.

Fix this by always setting both callbacks, thus dropping any data we're
not interested in.

See https://github.com/vim/vim/issues/10758 for an upstream report of
the excessive polling. It's possible this is intentional, I dunno.

Fixes: b42153eb17 ("Fix #4098 - Clear LSP data when servers crash")
2022-07-26 17:56:12 +09:00
Albert Peschar 854d606333
Add support for Dune (#4263)
* Add support for dune

* Add test

* Undo reformatting of Markdown file

* Refer to ale-ocaml-dune from ale.txt
2022-07-26 17:55:22 +09:00
0xHyoga 0ea53870b6
cairo support (#4256)
* cairo support

* supported languages txt

* add cairo to ale.txt
2022-07-22 13:05:08 +09:00
Horacio Sanson 5ef26c32da
Fix 4249 - Revert change to stop compl menu. (#4250)
In #4231 some code was added to stop the completion menu if any when
opening a new one. This resulted in an issue in Vim that fills the
buffer with Ctrl-Z characters when deleting to the end of a line in a
position that triggers auto-completion.

Since auto-completion seems to work fine on all my tests I am reverting
this specific change.
2022-07-14 07:25:42 +09:00
Michael Dyrynda ad2f75e4b2
Add support for Laravel Pint (#4238)
* add support, docs, tests for Laravel Pint

* fix php-cs-fixer link

* add missing project-without-pint

* fix indentation

* fix pint executable in pint fixer test

* fix variables, docs related to pint support
2022-07-07 21:42:21 +09:00
Marios S a918f8c7bc
Improve struct and pointer autocompletion in C (#4231)
* Add explicit trigger characters for C (#4226)

* Stop completion before issuing subsequent requests (#4226)

Co-authored-by: Marios Sioutis <26476573+s-marios@users.noreply.github.com>
2022-07-04 22:00:29 +09:00
Henrique Barcelos d6f3d4976d
Allow `shfmt` fixer to use `.editorconfig` (#4244)
* fix: added support for local solhint executable

* feat: added support for matching parse errors

* test: added test for solhint command callback and handler

* chore: removed command callback test

* refactor: made solhint handler structure closer to eslint

* refactor(shfmt-fixer): remove derivation of default CLI arguments
2022-07-02 22:05:03 +09:00
Horacio Sanson 16cca1413f
Update tests to use latest neovim 0.7 (#4180)
* Update tests to use latest neovim 0.7

* Update CI to use neovim 0.7

* Fix conflict
2022-06-29 13:17:00 +09:00
Steven Leiva 39d1a10589
Update ale-haskell.txt (#4241)
Change `b:ale_haskell_his_executable` to `b:ale_haskell_hls_executable`.
2022-06-26 16:04:59 +09:00
Gabriel Remus 4a0d669c0a
Show warnings for `dart_analyze` linter (#4237) 2022-06-25 00:18:08 +09:00
D. Ben Knoble 0e99519500
racket: start completion in a full keyword (#4186)
The default `omni_start_map` is too restrictive for Lisps and Schemes
like Racket, which permit hyphens (among other special characters).

As recorded in #3870, trying to complete `file-name-from-path` when
typing `file-name<C-x><C-o>` would give completions like `namespace`
because the hyphen is ignored to find the start of the word for
completion.

Now the racket filetype searches for the start using the keyword class
`\k`, which is more precise.
2022-06-23 09:13:28 +09:00
infokiller 91e8422d6d
Add pyflyby fixer (using its tidy-imports script) (#4219)
* add pyflyby fixer

updates

* pyflyby: add docs

updates

* add tests to pyflyby fixer
2022-06-16 22:41:57 +09:00
w0rp f10349b48b
Replace gitter badge with Discord 2022-06-08 15:26:25 +01:00
w0rp 9e1089c38d
Recommend Discord instead of IRC, actually 2022-06-08 15:22:21 +01:00
Danny (he/him) f6d7aa4f0f
Fix README typo (#4225) 2022-06-06 22:58:11 +09:00
Paul Thompson 9bdc923624
re-worded confusing grammar (#4223) 2022-06-04 15:58:36 +09:00
Isman Firmansyah 876140832c
Add support for actionlint options (#4216)
* Add support for actionlint options

* fix misaligned doc tags
2022-05-29 22:23:47 +09:00
Devin J. Pohly ae44f05600
Allow customization of all floating window borders (#4215)
* Allow customization of all floating window borders

Users may not necessarily want the same border character for top+bottom
or left+right, so allow all eight border characters to be configured in
g:ale_floating_window_border.

For backwards compatibility, the old rules are still applied if only six
elements are given.

* Reorder popup border array for compatibility
2022-05-27 13:41:06 +09:00
Arash Mousavi 3d7b3a6541
Add zig fmt support (#4198)
* Add zig fmt support

* Review changes

* Fix linter errors
2022-05-17 07:38:54 +09:00
Michał Padula e343148e80
Fallback to summary field if detail exists but is empty in terraform linter (#4157)
* Fallback to summary field if detail exists but is empty in terraform linter

* Add test

* Update terraform.vim

* remove whitespaces
2022-05-17 00:00:34 +09:00
Zhuoyun Wei 429f5a1447
Add support for Packer (#4192)
* Add support for HashiCorp Packer

* Add test for packer fmt

* Add doc for HCL/Packer

* Add link to Packer doc

* Also suggest packer fix for packer ft

* Add more links to TOC
2022-05-16 21:15:52 +09:00
Krishnakumar Gopalakrishnan, PhD b611fde718
fixes cpplint url in supported-tools.md (#4204) 2022-05-16 21:15:09 +09:00
Reza J. Bavaghoush 75d2413425
add rego support (#4199)
* add opa fmt fixer for rego files

* add opa linter

* add basic tests for linter and fixer

* add cspell to the docs
2022-05-16 21:14:11 +09:00
James C. Davis 5479b58660
support ember-template-lint 4.x (#4200)
* support ember-template-lint 4.x

* update ember-template-lint linter test
2022-05-15 12:44:23 +09:00
Fionn Fitzmaurice e6ca599e87
Look for .mypy.ini when finding project root (#4202)
We already check for mypy.ini, but the fallback .mypy.ini was ignored.
2022-05-15 12:20:16 +09:00
w0rp 044a6c956b
Close #4201 - Run vimls from Vader by default 2022-05-13 18:00:19 +01:00
w0rp e3e940a7fe
Update Vim versions mentioned in ale-development.txt 2022-05-13 17:47:15 +01:00
Matt Perry 14265e464a
Add support for ansible-lint 6.0.0 (#4189)
ansible-lint 6.0.0 removed the `--parseable-severity` option. Use the
JSON output in its place.

Fixes #4188
2022-05-09 20:27:21 +09:00
Richard Jonas 9e1351499c
Handle golangci_lint warning and error messages correctly (#4182)
* Handle golangci_lint warning and error messages correctly

* Fix linter warning

Co-authored-by: Richard Jonas <richard.jonas@derivco.se>
2022-05-04 20:05:32 +09:00
zandr 4e6a7debb4
Use stdin for Selene Lua linter (#4183)
When I added Selene as a linter, I wasn't aware it had the option to
process stdin using `-`.
2022-05-04 10:55:13 +09:00
bretello 323e2c0b6f
fix docs for actionlint (#4181)
Co-authored-by: bretello <bretello@distruzione.org>
2022-05-04 10:53:59 +09:00
Horacio Sanson 204e6294cf
Fix 4177 set default yaml linters (#4178)
* Fix 4177 set default yaml linters

* Fix 4177 set default yaml linters
2022-05-03 10:34:52 +09:00
bretello c694a24188
add yaml actionlint support (github actions) (#4173)
Co-authored-by: bretello <bretello@distruzione.org>
2022-05-03 10:03:05 +09:00
Dalius Dobravolskas 56399106fc
VSCode LSPs for CSS, HTML and JSON (#4175)
Switched to `vscode-langservers-extracted` as it is the one most
up-to-date.
2022-05-02 19:42:24 +09:00
Dalius Dobravolskas 34892186e4
vscode-json-languageserver support (#4164)
* vscode-json-languageserver-bin support

VSCode JSON languageserver has schema support for linting and
completions.

I have enabled snippets support (`snippetSupport`) even if it is not
fully supported. `label` that comes with completions response can be
used as well.

* Test fix.

* vscode-json-languageserver instead of vscode-json-languageserver-bin

vscode-json-languageserver is more up-to-date (about 1 year old),
vscode-json-languageserver-bin is 4 years old.

* Use git root.

* Documentation update.

* Trying to sort ordering issue.

* One more attempt

* One more attempt

* Uppercase seems to win.

* Clean-up

* Clean-up 2

* Test removed.
2022-04-30 12:33:48 +09:00
godbless d484347fb5
Add ALEGoToImplementation (#4160)
* Add go to implementation

* Add test cases for GoToImplementation

* Add documentation for GoToImplementation
2022-04-30 12:28:26 +09:00
zandr 57e16957e0
Add support for selene Lua linter (#4169) 2022-04-30 11:11:12 +09:00
godbless 3348222abc
Add CodeAction codeActionLiteralSupport Feature (#4163)
* Advertise codeActionLiteralSupport to LSP server

Without this, rust-analyzer doesn't return any code actions.  With it,
everything works properly.

* linter fixes

* test cases fixes

* Fix underflow of column in position.

Special values like for example -1 to denote the end of a line are not supported.
[reference](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position)

Co-authored-by: Brian Gernhardt <brian@gernhardtsoftware.com>
2022-04-29 22:17:29 +09:00
Diep Pham 6c51bb1573
Improve pylama linter output handling (#4106)
* Use JSON format for newer pylama version

https://github.com/klen/pylama/blob/develop/Changelog

The --format json option is added in pylama version 8.1.4.

* Fix linting warnings for pylama
2022-04-24 08:28:33 +09:00
Horacio Sanson e2ef4d91ee
Fix 3837 - update test to use latest vim 8.2 (#4147) 2022-04-20 22:07:25 +09:00
Alex McKinney 607f33a1b0
Add buf linter and fixer (#4128)
* Add buf lint to linters

* Add buf format to fixers

* Fix test/linter/test_buf_lint.vader

* Fix test/fixers/test_buf_format_fixer_callback.vader

* Simplify test/test-files/proto/testfile.proto

* Add buf-lint alias and rename linter
2022-04-06 17:00:59 +09:00
lykmast 1e997580fd
Handle ghc panic in haskell (#4145)
* Add primitive handling of ghc panic.

* PascalCase in function.

* Add simple test.
2022-04-06 16:59:50 +09:00
James Cherti 6c1f616c59
Add the buffer-local options 'b:ale_shell' and 'b:ale_shell_arguments'. (#4146) 2022-04-06 14:32:11 +09:00
Horacio Sanson c984daa0ec
Fix 4141 - Stop press enter prompt on long diagnostic messages (#4144)
* Fix 4141 - Stop press enter prompt on long diagnostic messages

* Fix 4139 - Check for array before join truncated_echo
2022-04-06 10:51:07 +09:00
Satoshi Matsubara cae550f07b
Update help for ale_go_staticcheck_lint_package (#4122) 2022-04-05 21:25:42 +09:00
w0rp d3df00b898
Fix test for echoing messages
The previous linter rule about stray echo lines has been restored, and
now all problems for custom linting rules can be ignored by adding a
comment above problem lines.
2022-04-01 14:35:07 +01:00
Amadeus Demarzi b3d1d6eecf
Use echon over echom for cursor echo (#3888)
* Problem messages no longer clutter `:messages`
* Messages are truncated better
2022-04-01 13:54:23 +01:00
João Costa bc406a846e
Set default value for insertTextFormat (#4124)
Co-authored-by: w0rp <devw0rp@gmail.com>
2022-04-01 12:41:05 +00:00
Horacio Sanson 0f55d371e9
Add neovim 0.6 to run-tests (#3998)
* Update test scripts
* Remove neovim 0.3 and 0.4
* Add neovim 0.6.1

Co-authored-by: Horacio Sanson <horacio@allm.inc>
Co-authored-by: w0rp <devw0rp@gmail.com>
2022-04-01 13:17:15 +01:00
Felix Maurer e81f005c78
Fix end line number when it exceeds the file (#4130)
If the end of the error exceeds the file, set it to the last line,
similarly as it is done with the beginning of the error.
2022-04-01 17:13:27 +09:00
Felix Maurer 80dcd648d3
rust-analyzer for non-Cargo projects (#4118)
* rust-analyzer in non-cargo projects

rust-analyzer can also be used in non-cargo projects. This requires a
rust-project.json file in the project root [1].

Make the rust-analyzer linter search for a rust-project.json file if no
Cargo.toml file could be found.

[1]: https://rust-analyzer.github.io/manual.html#non-cargo-based-projects

* Document rust-analyzer without cargo

* Test rust-analyzer with non-cargo projects

Change the other rust tests to match the new directory structure of the
test files.
2022-03-23 10:56:29 +09:00
Barnabás Ágoston 5c7019f394
Make it possible to override awk --lint option (#4114)
Currently, it's not possible to override the awk `--lint` option with

```viml
let g:ale_awk_gawk_options = '--lint=no-ext'
```

although this could be useful for those who only use gawk and don't want to get these lint errors:
> FEATURE X is a gawk extension

The idea is to move the default `--lint` option before the `awk_gawk_options` in the gawk.vim code to give the custom `--lint=...` option a higher precedence.

Co-authored-by: Barnabás Ágoston <barna@agoston.dev>
2022-03-20 13:52:22 +00:00
yoshi1123 c42fee3da5
Fix :ALEImport column position
Fix :ALEImport column position so it works with more language servers.

Co-authored-by: w0rp <devw0rp@gmail.com>
2022-03-20 13:20:33 +00:00
w0rp 560e6340ce
Bump ALE to v3.2.0 2022-03-05 01:24:43 +00:00
w0rp e5492e124d
Document default linter selections again 2022-03-05 00:43:56 +00:00
w0rp 87ade74b4d
Fix an argument name 2022-03-04 19:51:24 +00:00
Horacio Sanson c173b6243d
Enable autoimport by default (#4102) 2022-03-04 19:05:41 +00:00
yoshi1123 e490e87a60
Add eclipselsp jdt:// support for textDocument/definition (#4030)
This patch adds support for opening jdt:// links on "go to definition" requests returned by Java language servers.

Co-authored-by: w0rp <devw0rp@gmail.com>
2022-03-04 19:03:27 +00:00
w0rp b42153eb17
Fix #4098 - Clear LSP data when servers crash 2022-03-02 16:51:50 +00:00
nospam2998 66b2d994a1
Document the use of author rewriting tools (#4088)
Co-authored-by: cos <cos>
2022-03-01 16:04:09 +00:00
w0rp 3e1a98ff67
#3495 Mention that ShowResults() must not be called synchronously 2022-03-01 13:48:16 +00:00
w0rp 7ac0f633cc
Update README to mention Libera instead of Freenode 2022-02-26 20:24:48 +00:00
Horacio Sanson 5b1044e2ad
Fix 4086 - use stable command options for rustc (#4087) 2022-02-20 00:01:06 +09:00
Horacio Sanson 47470eddc2
Sometimes end_lnum and end_col are not present (#4062) 2022-02-09 23:25:52 +09:00
Sébastien NOBILI 82a3e444b2
fix: duplicate tags in doc (#4059)
* fix: duplicate tag in doc

* fix: duplicate tags in doc

Co-authored-by: Sébastien NOBILI <code@pipoprods.org>
2022-02-08 11:12:26 +00:00
Jerko Steiner 4a4516e3bf
Dispatch textDocument/didChange after rename (2) (#4049)
* Dispatch textDocument/didChange after rename

Previously whenever we renamed a symbol that was referenced from other
files we'd just edit those files in the background, and the LSP wouldn't
know about these changes. If we tried to rename the same symbol again,
the renaming would fail. In some scenarios, the operation would just be
wrong. Here is an attempt to fix this issue.

I also noticed another bug when using Go with `gopls` LSP and the `gofmt`
fixer. Whenever the file was saved, the `gofmt` would run and reformat
the file. But it seems there was some kind of a race condition so I
disabled saving for now, and all of the modified files will be unsaved,
so the user should call `:wa` to save them. I personally like this even
better because I can inspect exactly what changes happened, and I
instantly see them in the other opened buffers, which was previously not
the case.

Fixes #3343, #3642, #3781.

* Address PR comments

* Remove mode tests in corner case tests

* Address PR comments

* Save after ALERename and ALEOrganizeImports

Also provide options to disable automatic saving, as well as instructions to
enable `set hidden` before doing that.

* Fix broken test

* Save only when !&hidden

* Update doc

* Update doc

* Add silent
2022-02-08 20:07:39 +09:00
Jon Parise 8b1ea33cc0
Add a unimport linter for Python files (#4058)
Unimport (https://github.com/hakancelik96/unimport/) is a linter,
formatter for finding and removing unused import statements.

This introduces linting support, although fixer support could come
later.
2022-02-08 15:54:25 +09:00
Jon Parise 2428d4d81d
Update the Black URL (#4057)
The Black project moved to the PSF organization some time ago. Update
its URL accordingly.
2022-02-08 09:04:14 +09:00
Horacio Sanson 6d9399d863
Update cmake-lint linter url (#4056) 2022-02-06 22:07:08 +09:00
Carl Smedstad c9938bc293
Add CMake linter cmake-lint (#4036)
* Add CMake linter cmake-lint

Add support for the CMake linter provided by
https://github.com/cheshirekow/cmake_format.

* Escape cmake-lint executable and add linter tests
2022-02-06 21:09:38 +09:00
offa 7cbb68da6c
Add oelint-adv support (#4043) 2022-02-06 14:08:10 +09:00
Dalius Dobravolskas 0c276aac90
Allows to use quickfix for references. (#4033)
* Allows to use quickfix for references.

E.g. following mapping could be used to find references for item under
cursor and put result into quickfix list:

```
nnoremap <leader>af :ALEFindReferences -quickfix<CR>
```

Fixes #1759

* Documentation update.
2022-02-05 21:54:26 +09:00
nospam2998 a58b7b5efb
Treat ale_open_list integer values as thresholds (#4050)
Only open list window if the number of warnings or errors equals to or
exceeds the value of ale_open_list. No change when set to `1`.

Co-authored-by: cos <cos>
2022-02-04 17:56:48 +00:00
David Briscoe 5856c06775
Add ALEPopulateQuickfix and ALEPopulateLocList (#3761)
Closes #1810

Add ALEPopulateQuickfix and ALEPopulateLocList. They're not very useful
with ale's default auto-populate behaviour, so their useful configuration
is described in help.
2022-02-04 17:42:26 +00:00
David Briscoe 6d20b6c162
doc: Clarify the types of process_with (#4039) 2022-02-04 20:22:40 +09:00
Linda_pp 0d529d9b94
Add `naga` linter for WGSL support (#4047)
* Add WGSL support using `naga` command

* Add documents for wgsl

* Add test for `naga` linter

* Separate naga handler callback to hanlder/naga.vim
2022-02-04 16:29:28 +09:00
Justin Huang d1e2aaf85d
enable using cpplint for c (#3008)
* enable using cpplint for c

* fix tag alignment

* fix tag alignment trial #2

Co-authored-by: Justin Huang <justin.huang@perceive.io>
2022-02-03 22:32:42 +09:00
Jeffrey Lau a81512cfd2
Fix unhandled nix versions for linter 'nix' (#4045)
Previously, it would not generate any lint messages for nix 2.5.

Moreover, it would cause this error whenever the nix command is
invoked, when paired with a custom `g:ale_command_wrapper`:

    Error detected while processing function <SNR>92_NeoVimCallback[29]..<lambda>27[
    1]..<SNR>90_ExitCallback[28]..ale_linters#nix#nix#Command:
    line    1:
    E684: list index out of range: 0
2022-02-02 10:54:07 +09:00
Tomáš Janoušek da1e4dcd1e
Allow to configure haskell-language-server LSP config (#4038) 2022-02-02 10:28:52 +09:00
Jeffrey Lau 5087246c82
Add yaml-language-server support for YAML (#2874) (#4029) 2022-01-07 23:57:29 +09:00
Horacio Sanson 76bd059371
Fix 3838 - deprecate datanalyzer (#3839)
Co-authored-by: Horacio Sanson <horacio@allm.inc>
2022-01-05 22:34:47 +09:00
Horacio Sanson 5a5029b73d
Fix 4004 - Disable eslint by default for json. (#4023)
* Fix 4004 - Disable eslint by default for json.

This PR disables, or more correctly, excludes eslint from the list of
default linters for json files.

Also fixes elixir, go, json5, and jsonc files documentation and default
linters to make them consistent.

* Fix and improve tests
2022-01-05 22:33:00 +09:00
Horacio Sanson 7b8e711877
Fix 4025 - Allow to configure texlab LSP settings (#4027)
* Fix 4025 - Allow to configure texlab LSP settings

* Fix ale_tex_texlab_config type in help
2022-01-05 22:19:32 +09:00
w0rp 11a90ad0ff
Fix execution of the Angular language server for HTML files 2022-01-05 11:34:30 +00:00
Nathan ac0495df6e
Add dprint fixer (#4024)
* Add dprint fixer

* Fix windows tests

* dd dprint documentation
2022-01-04 21:49:03 +09:00
Alex Piechowski 48f68598cb
Add auto-fixer for crystal (#4016) 2021-12-28 20:23:57 +09:00
Horacio Sanson dcec4b3c37
Fix 3998 - add language option to uncrustify fixer (#4007) 2021-12-25 00:25:47 +09:00
Dalius Dobravolskas 5b792c7641
ALEFileRename command added. (#4012)
* ALEFileRename command added.

This command renames file and uses tsserver `getEditsForFileRename` to
fix import paths in Typescript files.

* ale#util#Input fix

* Even more fixes.

* Linting error fix.
2021-12-17 08:09:26 +09:00
Phong Nguyen e4ec2e4dc7
Fix crash for Reek 6.0.4 (#4010)
When `let g:ale_ruby_reek_show_wiki_link = 1`, Reek linter is crashed
 because `wiki_link` attribute does not exist in result.

 It seems that `wiki_link` is now replaced with `documentation_link` in
 recent version of Reek
2021-12-13 22:35:26 +09:00
thyme-87 091592bfb0
add support for checkov for linting terraform files (#4006)
* add support for checkov for terraform

* add tests for checkov handler

* add basic linter config tests for checkov

* update supported tools and languages lists

* simplify ale_linters#terraform#checkov#Handle

* ensure "-o json --quiet" is always set for checkov

* add documentation for checkov including config options

* fix tests after changing handling of default options for checkov

* add checkov to list of tools in doc/ale.txt
2021-12-11 20:51:26 +09:00
Brendan Maginnis b9744076a1
Pass full path to pydocstyle (#3995)
* Pass full path to pydocstyle

* Update pydocstyle tests
2021-12-09 23:24:32 +09:00
Horacio Sanson 9a01836015
Fix check for did_save and includeText capabilities (#4008) 2021-12-09 23:22:07 +09:00
Magnus Groß 9860dadbc9
Initialize hl-groups correctly if virtual text is loaded first (#3960)
If virtualtext.vim is autoloaded first, it will link
ALEVirtualTextWarning to ALEWarning. But ALEWarning is not initialized
yet, so it will create ALEWarning, but with no color definition set.

Shortly after, highlight.vim is autoloaded, which would usually link
ALEWarning to SpellCap, but only if ALEWarning is not already set.
However since ALEWarning is already initialized due to the previous
link, we skip this and never actually come around to properly
initializing it.

We fix this by initializing all highlight groups in highlight.vim, thus
satisfying the dependency of ALEVirtualTextWarning being initialized
after ALEWarning.

Fixes #3585
2021-12-09 23:21:39 +09:00
Arnold Chand de67f4743d
Add volar support for vue (#3992)
* feat-draft: inital volar setup

* feat(volar): add documentation

* feat(volar): include default init opts

* feat(volar): add initial tests

* fix(volar): add possible project roots

* fix(volar): tests - use empty files
2021-11-21 20:02:09 +09:00
Dan George 072750137f
Fix --file-filter option on cppcheck command (#3987)
* Add cppcheck handler match on misra msg

* Fix cppcheck --file-filter setting

This time, the tests and actually usage both work.

Co-authored-by: Dan George <dgeorge@anduril.com>
2021-11-20 19:01:32 +09:00
David Houston ea643b97ab
Add cspell Linter (#3981)
* Add cspell linter

Add cspell linter, with the languages it supports.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Add cspell Global Variables Documentation

Add documentation to /doc/ale.txt with cspell configuration options.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Add cspell to docs, Minor Cleanup

Add cspell for each supported language, adding some spaces and removing
others when caught navigating the file.

Signed-off-by: David Houston <houstdav000@gmail.com>
2021-11-19 07:41:05 +09:00
Dan George aee0cc45be
Cppcheck buffered file only (#3983)
* Add cppcheck handler match on misra msg

* Use --file-filter cppcheck option

Cppcheck recently added --file-filter so that cppcheck only checks the
filtered files, even when using --project option, which checks all files
in the project, by default. The --ccpcheck-build-dir option didn't help
enough (at all?).

* Added C test cases

Also fixed and assumed typo: foo.c, instead of foo.cpp

* Replace hard-coded full path filenames

Attempt to fix the windows platform test execution.

* Fix typo - foo.c, instead of foo.cpp

* Reset buffer var between tests

* Handle header files in cppcheck

Cppcheck isn't designed to check header files, stand-alone. Daniel
Marjamäki suggested using --suppress options to avoid FPs.

* Fix Vint complaint in cppcheck handler.

* Fix file path in cppcheck handler

Co-authored-by: Dan George <dgeorge@anduril.com>
2021-11-18 13:27:23 +09:00
Dan George 3ca66e44bd
Restore checkmake linebreaks (#3986)
* Add cppcheck handler match on misra msg

* Add linebreak to checkmake formatter

Co-authored-by: Dan George <dgeorge@anduril.com>
2021-11-18 13:23:38 +09:00
David Houston 2cfeabd1b5
Rewrite Alex Integration to Use stdin (#3982)
Since having been added, the `alex` tool has added support for linting
on stdin. Rewrite this integration to reduce the number of tools
requiring disk-write access.

Signed-off-by: David Houston <houstdav000@gmail.com>
2021-11-18 13:00:45 +09:00
Arie Oldman 3b8ff6536e
Adds PHPActor Linter (LSP) (#3975)
* Adds phpactor lsp linter

* Fixes missing comma

* Adds tests for phpactor lsp linter

* Adds note that this part is not my own work

* Removes unused variable

* Adds phpactor to supported tools list

* Fixes doc sorting

* Wraps phpactor in code tags
2021-11-18 12:54:10 +09:00
Daisuke Shimamoto 31dc6a61a0
Find composer.json when searching for psalm (#3979)
* Look for nearest composer.json before .git

* Add test for projects with composer.json
2021-11-15 21:17:18 +09:00
Chuan Wei Foo 01fdd8d66b
Show errors and warnings for the 'smlnj' linter (#3957)
* Show errors and warnings for the 'smlnj' linter

Fixes #3953

* Change smlnj stdIn regex
2021-11-15 20:35:45 +09:00
Dan George d72a9d64ff
Add cppcheck handler match on misra msg (#3980)
Co-authored-by: Dan George <dgeorge@anduril.com>
2021-11-15 20:34:46 +09:00
Utkarsh Verma 1e0e76bf96
Add support for AVRA linting (#3950)
* Add support for AVRA linting

* Add tests for AVRA linting and improve code

* Fix test

* Fix warning detection

* Fix test

* Fix test

* Add AVRA as a supported language in docs
2021-11-15 19:41:03 +09:00
Dmitri Vereshchagin 76c2293e68
Add sub_type to Elvis output (#3976)
Elvis is Erlang style reviewer, thus all loclist objects should have
sub_type set to style.
2021-11-12 16:50:56 +09:00
Arie Oldman ff26ed7231
Adds --memory-limit support for phpstan (#3973)
* Adds --memmory-limit option for PHPStan linter

* Updates docs for phpstan --memory-limit option.

* Adds Arizard to authors

* Adds test for phpstan memory limit parameter

* Fixes order of parameters in test

* Changes dash to underscore
2021-11-12 14:18:49 +09:00
David Houston a9d7f45924
Implement statix Linter and Fixer (#3969)
* Add Statix for Linting

Add `statix check` as a linter. Provides a simple set of definition
tests additionally. Variable names specify "check" to allow for later
addition of `statix fix` as a formatter once stream support is added.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Fixup Supported Tools List

I didn't realise there were two separate lists of tools, so add statix
to the other list. Also, remembered "S" comes after "R", and so
re-ordered it.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Fix statix Test File

I refactored the variables for statix to allow for writing a fixer
later, and forgot to update them in the test, so update them now. Also
remove a stray "i", add missing space before checks

Signed-off-by: David Houston <houstdav000@gmail.com>

* Update Output Stream for v0.4.0

statix v0.4.0 provides a breaking change of output stream from stderr to
stdout.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Add statix fix Fixer

Implement statix fix as a fixer for simple Nix antipatterns.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Fix statix Fixer Tests

Fix the statix fixer tests by removing the unnecessary
'read_temporary_file' value from the command, since it simply uses the
default value.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Add statix Handler Test

Add a test for the statix handler per @hsanson's request.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Fix to run only on stdin for linting

Signed-off-by: David Houston <houstdav000@gmail.com>
2021-11-12 07:34:25 +09:00
David Houston 8b3b16d71c
Implement gofumpt Fixer (#3968)
* Implement gofumpt Fixer

Add an implementation with test and documentation for the gofumpt go
code formatter, a stricter formatter than your standard "go fmt".

Signed-off-by: David Houston <houstdav000@gmail.com>

* Add gofumpt to ale.txt TOC

Forgot to add gofumpt to the ALE vim help Table of Contents, so do so.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Fix Test Setup Method Capitalization

I had put "Setup" instead of "SetUp" for "ale#assert#SetUpFixerTests".
Fix such.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Fix typos

Add a missing space, remove an extra bracket by actually running tests
locally first. Would've been smart to do that from the beginning...

Signed-off-by: David Houston <houstdav000@gmail.com>
2021-11-09 16:53:44 +09:00
Magnus Groß f37cd1fd4f
Make run-tests compatible with Podman (#3961)
There is no need to filter for references in such a complicated way.
docker images already works if you just pass the image and tag as
an argument.

This caused problems if one was using podman with its docker-compatible
interface.
Previously podman would return the following error:
Error: cannot specify an image and a filter(s)

With this new method podman does not return an error anymore, causing
the image to not be redownloaded every time and it still works with
normal Docker.
2021-11-04 16:01:46 +09:00
Benjamin Bannier 92f08b5af2
Add support for zeek (#3952) 2021-10-24 21:05:55 +09:00
Magnus Groß da331acc9e
Replace line breaks in virtual text with whitespace (#3949)
Before this patch multiline warnings would appear in a single line with
'^@' as separator.
Now we use whitespace as separator to improve the appearance.

Also strip trailing whitespace, newlines, etc...

Fixes #3939
2021-10-24 11:35:06 +09:00
Andrew Hayworth 95ba7898b4
Re-apply #3538 - remove -T argument from ruby linter (#3951)
The `-T` option (for "taint checking") was deprecated in ruby 2.7
and removed entirely in ruby 3.0. This causes the linter to fail
entirely for users of ruby 3.0.

This was reported in #3537, and then fixed in #3538 - but it seems as
though in 9fe7b1fe6a, it was accidentally
and entirely undone.

This commit is essentially identical to #3538, aside from a path change
for the tests.
2021-10-22 14:20:00 +09:00
Randy Stauner 9b5a3581eb
Parse clj-kondo lines that don't include row/col (#3946)
Some custom linter hooks don't include these numbers.
2021-10-19 16:04:50 +09:00
infokiller cb0f0e1d0b
fix(hadolint): set code field as well (#3943) 2021-10-19 15:30:19 +09:00
Horacio Sanson 16898417e6
Fix 3941 - add version check to isort fixer (#3942) 2021-10-16 14:02:58 +09:00
Horacio Sanson c7e3f1a0dd
Fix 3207 - do not send didSave notification if not supported (#3930) 2021-10-15 08:42:07 +09:00
Roeland 7413dfd3fc
erblint as fixer (#3935)
* fixer erblint

* erblint fixer test
2021-10-11 20:52:46 +09:00
Roeland 1ee7580557
Add support for erblint (#3931)
* support for erblint

* fix tests

* test for handler

* wrong names

* typo

* doc layout

* CI failed?
2021-10-09 14:33:07 +09:00
Wilson E. Alvarez 42a6e039cb
Implement textDocument/didSave includeText optional argument (#3925) 2021-10-07 20:48:54 +09:00
D. Ben Knoble 34a972f85d
sml: use filenames (fix #1084) (#3860) 2021-10-07 11:33:33 +09:00
Tomáš Janoušek efa563826d
codefix: Fix code actions that return Command[] directly instead of CodeAction[] (#3929)
According to
https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#textDocument_codeAction,
the response to textDocument/codeAction is:

    (Command | CodeAction)[] | null

and the code only handled the case where it was a CodeAction that either
specified an edit or a command, but didn't handle a direct Command.

Note that the specification also says that both can be specified and
then the edit is applied first, then the command. Furthermore, there
seems to be some hacky code handling arguments directly, which I suspect
is non-standard and only works with a specific LSP server that happens
to pass the edits in the arguments unmodified.
2021-10-07 11:29:00 +09:00
a666 f9deee0e41
Add flakehell python linter (#3295) (#3921) 2021-10-02 16:37:57 +09:00
Arnold Chand 19b0f72c23
feat: add deno lsp for javascript (#3924)
* feat(js/deno): add deno lsp

* fix(doc/typescript): typo

* feat(doc/javascript): add deno lsp information

* feat(doc/supported-tools): add deno to js list, sorted

* fix(doc/javascript): update ToC and supported tools w/ deno
2021-10-02 09:51:22 +09:00
Magnus Groß 708e810414
Implement virtual text support for vim (#3915)
This requires the textprop and popupwin feature (vim 8.2).

Fixes #3906
2021-10-02 09:02:49 +09:00
Yuto Ito c9c89a1853
Fix: Failed to execute rubocop fixer on other machine (#3916) 2021-09-23 18:46:16 +09:00
Trevor Whitney f8a4c78b5b
Add support for jsonnetfmt and jsonnet-lint (#3907)
* update to lates

Signed-off-by: Trevor Whitney <trevorjwhitney@gmail.com>

* fix up docs

Signed-off-by: Trevor Whitney <trevorjwhitney@gmail.com>

* fix docs

Signed-off-by: Trevor Whitney <trevorjwhitney@gmail.com>

* get tests passing

Signed-off-by: Trevor Whitney <trevorjwhitney@gmail.com>

* update regex

Signed-off-by: Trevor Whitney <trevorjwhitney@gmail.com>

* use ale#Pad and AssertFixer

Signed-off-by: Trevor Whitney <trevorjwhitney@gmail.com>
2021-09-21 10:49:15 +09:00
Götz Christ 2f72a3ed19
[YAML] CircleCI: skip checking for new tool version (#3902)
This way the tool runs a bit faster and we don't create unneeded network requests. Don't know if there are other network requests still occurring.
2021-09-17 17:55:28 +09:00
Dalius Dobravolskas dca56dd772
ALECodeAction fix: check linter name when searching for nearest error. (#3901)
It is easier to explain this fix with an example:

* tsserver and LSPs ask for error information when you want to fix
  error. tsserver `ts@getCodeFixes` command needs tsserver error code.

* now let's imagine that user has eslint and tsserver in use. Sometimes
  both can report same error in different way.

* Now there is no guarantee which error will come first and if eslint
  error comes first then tsserver will not return code fixes as we are
  passing wrong error code to it.

This fix will return proper error code based on linter.
2021-09-16 22:05:38 +09:00
Horacio Sanson 31349f208b
Update ALE test docs to mention NVim 0.5 (#3904) 2021-09-16 12:16:08 +09:00
Oliver Albertini f769f64c07
[ale-python-root] add `.pyre_configuration.local` to list of files (#3900)
Without this, we have one `pyre` process running across different pyre
projects. With this change, files in different projects can be linted
with pyre at the same time.

Co-authored-by: Oliver Ruben Albertini <ora@fb.com>
2021-09-15 21:07:45 +09:00
Samuel Branisa 19437e25d0
Robot framework rflint support (#3715)
* Create rflint.vim

support for robot framework by creating ale definition for rflint syntax linter

* robot framework - rflint support
2021-09-11 09:19:17 +09:00
Horacio Sanson bf29f6ea92
Fix 3897 - add poetry to isort (#3898)
Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-09-10 15:18:41 +09:00
Oliver Albertini b504eeb094
[python/pyre.vim] Fix pyre persistent behavior (#3895)
It's necessary to provide a `-l` option to pyre with the closest parent
directory containing a `.pyre_configuration.local` file, or simply
change directory (cwd) to the root of the pyre project. Thanks to Ken
Verbosky for the code that fixes this.

Error seen when not using such a solution:

```
1031.473923 on 6: Dropping message 'ƛ Background task unexpectedly quited: Invalid configuration: Cannot find any source files to analyze. Either `source_directories` or `targets` must be specified.
```

Issue with this approach is that if you are editing files under
different projects, the `pyre persistent` process is not re-created for
each file. We have to do `:ALEStopAlllsps` in order for the process to
start with the new working directory.

Co-authored-by: Oliver Ruben Albertini <ora@fb.com>
2021-09-10 12:53:54 +09:00
Jon Parise c5c58f5bf8
Improve the thriftcheck handler pattern (#3893)
More recent versions of thriftcheck use a more compliant GCC-style
output format which includes a space before the "severity" group.
This matches similar tools, like shellcheck.

This change adjusts the handler's pattern to parse this format in a
backwards-compatible way (even though backwards compatibility isn't
critical long-term as thriftcheck itself is close to its 1.0 release).
2021-09-08 21:48:48 +09:00
Horacio Sanson 42aadf6a26
Fix 3886 - Don't JSON decode completion user data if already a dict (#3894)
Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-09-08 21:45:19 +09:00
Amadeus Demarzi 35d0bd1519
Fix truncated echo (#3889)
* Fix truncated echo

In typescript, when putting the cursor on a `>` character of an arrow
function, the displayString body comes back as an empty string, and
means the split operation has 0 items, causing a failure when attempting
to call TruncatedEcho.

Even if there's a better fix, I'd assume this is a good safety since we
are injesting external data.

* Convert to use `empty()`
2021-09-06 11:26:32 +09:00
Jon Parise 8fd23f4b71
Introduce an ALELSPStarted autocommand (#3878)
This User autocommand is trigged immediately after an LSP process is
successfully initialized. This provides a way to perform any additional
initialization work, such as setting up buffer-level mappings.
2021-09-05 10:07:53 +09:00
tsjordan-eng b9fdb91e92
Cppcheck backwards compat 1.34 (#3887)
* Add support for cppcheck 1.34

* Add cppcheck 1.34 tests, correct pattern

Co-authored-by: Tyler S. Jordan <tsjorda@sandia.gov>
2021-09-03 22:31:17 +09:00
Jelte Fennema d53a085096
Add fixer for "dotnet format" (#3879)
The .NET ecosystem has an official tool for formatting its files: `dotnet format`
This adds support for that tool to ALE.
2021-08-25 15:27:04 +09:00
João Pesce f896744fee
Close #3872 - Add eslint-plugin-jsonc as a linter for JSON, JSONC and JSON5 (#3873)
* Add eslint as linter for JSON, JSONC and JSON5

Use the same lint configuration as eslint for javascript.

* Add documentation for JSON* eslint support

* Fix spacing in documentation

* Update docs to be unopinionated about plugins

Remove any preference for eslint plugins, since there are more thant one
that would work

* Reorder languages and tools in alphabetic order

* Fix misalignment

* Change orders to pass the tests
2021-08-21 10:02:56 +09:00
toastal a099fe24b2
Dhall fixes: use stdin, doc errors (#3868)
* purs-tidy

* Dhall fixes: use stdin, docs errors
2021-08-09 20:43:50 +09:00
toastal 9264ffda23
purs-tidy fix (#3867)
* purs-tidy

* Fixup for purs-tidy
2021-08-09 20:42:19 +09:00
pigfrown 836125391a
Adds fixer for golines (#3862)
* Adds fixer for golines

* Repositions golines docs to be in alphabetical order

* Fixes golines doc tag

* Fixes formatting for golines docs
2021-08-09 10:13:43 +09:00
Horacio Sanson d6f5fb69ad
Fix 3853 - Update 💾 icon on supported tools list. (#3854)
Look for all linters that have "lint_file" set to 1 and verify tools
that have it have the :floopy_disk: icon set and those that don't do not
have it.

Correspondingly added/removed !! on
ale-supported-languages-and-tools.txt file.

Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-08-08 22:15:36 +09:00
toastal 775d121d46
`purs-tidy` for PureScript (#3863)
* purs-tidy

* update email address for toastal
2021-08-08 22:09:21 +09:00
Horacio Sanson a793db7399
Fix 3865 - Disable scriptencoding vint error. (#3866)
- Add .vintrc.yaml configuration that disables the scriptencoding check
  (ProhibitMissingScriptEncoding) that is raised randomly.
- Upgrade vint to 0.3.21. Project seems to have stopped here and 0.4.0
  was never released.
- Ensure the run-test scripts use the correct docker image (e.g. add tag)
  .

Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-08-08 22:06:58 +09:00
Horacio Sanson cc34310a99
Add neovim-05 flag to run-test help output (#3864)
Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-08-07 20:19:41 +09:00
Horacio Sanson 10f984673c
Fix lint tests failing due to multibyte chars. (#3858)
For some reason CI tests started failing with these errors:

> ale_linters/eruby/erb.vim:1:1: Use scriptencoding when multibyte char exists (see :help :scriptencoding)
> ale_linters/mail/languagetool.vim:1:1: Use scriptencoding when multibyte char exists (see :help :scriptencoding)

Not sure at which point or what changed for this to happen but this MR
fixes it by removing the multibyte chars present on the problem files.

Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-08-06 11:36:39 +09:00
Jon Parise 9eb39348e9
Use md5(1) when available (#3855)
md5sum isn't available by default on macOS. Instead, it ships the
BSD-style md5(1) command, which does the same thing but with different
arguments.

With this change, run-tests works out-of-the-box on macOS.
2021-08-05 08:42:59 +09:00
Horacio Sanson 3ba40b4316
Add neovim 0.5 to list of test runtimes. (#3830)
* Add neovim 0.5 to list of test runtimes.

* Update testbed docker image

Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-08-05 08:41:34 +09:00
Jon Parise 2dd9790281
Add a thriftcheck linter (#3852)
ThriftCheck (https://github.com/pinterest/thriftcheck) is a linter for
Thrift IDL files.
2021-08-04 09:29:07 +09:00
Tobias Gruetzmacher fa032b1b7f
Fix link to jsonlint (#3850) 2021-08-03 16:42:55 +09:00
Jon Parise 8ecf32f3fe
Add missing space before function reference (#3849) 2021-08-03 08:29:11 +09:00
Henrik Farre 056fbd08f6
Do not use tempfiles for ansible lint (#3846)
* Used %s instead of std in

* Set lint_file to 1 for ansible-lint so it does not use temp files

* Fix test for ansible-lint
2021-07-31 12:35:43 +09:00
Jon Parise dce088a4f0
Correct the spelling of :ALEComplete (#3843) 2021-07-28 20:40:59 +09:00
ghsang 73d32335fe
Add support for `dart analyze` (#3825) 2021-07-25 13:48:12 +09:00
Arnold Chand 8c591996a8
Add importMap option to deno Initialization Options (#3827)
* feat(deno): move init options to handlers

* feat(deno): add deno lsp support for js files

* feat(deno): use default map option

* feat(docs): add deno import map option

* feat(deno): add tests for importMap option

* fix(deno): use full path in importMap

* feat(deno): remove deno as linter for js, separate PR

* fix(deno): test for executable

* fix(deno-test): include filename to simplify function
2021-07-25 13:39:56 +09:00
Daniel Roseman 7d8fb2ba17
Python support poetry (#3834)
* Add poetry support to python linters and black fixer.

* Update python.vim to detect poetry project.

* Update ale.vim, add an option for poetry `g:ale_python_auto_poetry`.

* Update ale-python.txt, add poetry support.

* Add and update poetry related tests.

Co-authored-by: unc0 <unc0@users.noreply.github.com>
2021-07-25 13:39:05 +09:00
D. Ben Knoble 530b38de34
Vim popup (#3817)
* implement vim popups for preview

Details on implementation
-------------------------
- we make use of the |popupwin| api
- we split implementations (Nvim* vs. Vim* prefix) and call the right
  one based on has('nvim')
- we follow a similar structure in each function, using the relevant API
  - popup_list, win_execute, popup_settext in VimShow
  - popup_create in VimCreate
  - popup_close in VimClose

Some differences
----------------
- we DON'T have VimPrepareWindowContent because we use arguments to
  popup_create for borders, padding, etc., and it also takes care of
  buffer creation.
- we follow the protocol of setting and using w:preview for information,
  but we only need the ID
- InsertEnter is the only autocommand required, because of
  popup_create's moved argument. Any cursor movement with 'any' will
  close the popup. This in turns means VimClose is only called from
  InsertMode, so no mode-restoration necessary
- we don't tweak too much in the buffer because vim's popup buffers
  already have most relevant settings and aren't editable without
  calling popup functions.
- I enabled scrollbars, close buttons, dragging, and resizing
- vim popups get as big as they need to by default, so no worrying about
  truncating/hiding/size

Note: we might want to consider changing w:preview to w:ale_preview to
avoid clashes if someone else tries to use the same variable

* floating window: document that vim supports it

* lint: fix indent/cont. lines
2021-07-23 21:59:31 +09:00
Horacio Sanson 5ad4fdd583
Fix 3801 - Add ALEDummySign some width. (#3832)
* Fix 3801 - Add ALEDummySign some width.

Due to changes in NeoVim 0.5 the g:ale_sign_column_always configuration
stopped working.

This PR sets the ALEDummySign to a blank space so when g:
ale_sign_column_always is set we have a sign with 1 width allowing the
configuration to work as before.

https://github.com/neovim/neovim/issues/13635

* Fix visual artifact on dummy sign

* Fix visual artifact on dummy sign (attempt 2)

Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-07-21 18:25:41 +09:00
foobarbyte c1c3873c89
Correct typo in python config filenames (#3826)
* Correct typo in a config file filename.

.tool_versions should be .tool-versions

* Correct typo in config file names.

.tool_versions should be .tool-versions
2021-07-20 18:14:45 +09:00
D. Ben Knoble 651038b601
racket: support racket-langserver lsp (#3808)
* racket: support racket-langserver lsp

* racket-langserver: find highest dir with init.rkt

* autoload/ale/racket: re-indent to 4 spaces

* racket: lint: sort supported tools

* racket: lint: function!

This is _not_ needed anymore, but the lint wants it. See :help E127

* racket-langserver: do not use new dict format

* racket: lint: use snake_case

* add tests for racket-langserver

* racket-langserver tests: correct result values
2021-07-20 10:02:23 +09:00
Horacio Sanson a6719c2d4f
Fix 3673 - Add nocolor option to ansible-lint (#3811)
Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-07-20 10:00:49 +09:00
莊喬 f83a1f70d5
Add option to clojure clj-kondo linter (#3812)
Allow define `clojure_clj_kondo_options` to customize command options
for `clj-kondo`.

The `--cache` in original command is now defined as default.
2021-07-17 22:07:02 +09:00
Jose Maria Perez Ramos a6a8131306
Update erlang format for OTP24 (#3823)
Erlang's erlc error format includes the column in OTP24.
See https://blog.erlang.org/My-OTP-24-Highlights/#column-number-in-warnings-and-errors
2021-07-17 21:51:17 +09:00
foobarbyte 1893abdb19
Python .tool versions (#3820)
* Also check for asdf-vm's .tool_versions file

A minimal python project may only be specifying a python version using a version management tool like asdf-vm, without providing other common python project configuration files. asdf-vm creates a single .tool_versions file in the managed directory. By checking for .tool_versions in addition to other common python config files we ensure that python linters (whose behaviour typically depends on a particular python version) will run with the same version of python used by the project. This will also be the same python version used by vim itself when it is run from inside the project's directories.

* add .tool_versions to ale-python-root documentation

This reflects the corresponding change to autoload/ale/python.vim
2021-07-17 21:46:43 +09:00
ghsang d6dbb5398e
Add support for `dart format` fixer (#3764) 2021-07-16 16:20:47 +09:00
Jeff Willette d8f4e8b708
added filename to stdin stream of isort (#3815)
modified tests to run with new format

Co-authored-by: Jeff Willette <jeff@Jeffs-MacBook-Pro.local>
2021-07-14 20:58:25 +09:00
Nikolay Zakirov 82a7e9f588
add autoflake fixer (#3779)
* first attempt

* added autoflake executable

* added Windows executable for appveyor

* delete unused files

* corrected wrong sorting
2021-07-13 21:58:18 +09:00
Horacio Sanson d098124e59
Fix 3373 - do not crash on HandleUserData with invalid json (#3807)
Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-07-13 08:37:21 +09:00
Nathan Sharp c8f669249a
Add Yosys linter for Verilog files. (#3713)
* Add yosys for verilog files.

* Add handler test for yosys.

* fix typo in yosys handler test

* fix array order in yosys handler test

* add yosys linter to filetype defaults test

* fix duplicate tag

* add 'yosys' to 'ale-supported-languages-and-tools.txt'
2021-07-12 21:39:53 +09:00
Michael Weimann 9a9fd24b17
add phpstan local executable detection (#3809) 2021-07-10 22:56:26 +09:00
Grégoire Paris 2a5a7baffc
Add support for multiline messages (#3686)
This is achieved by switching to JSON, which makes it much easier to
avoid confusion between an error message and the next one. It also
spares us from having to deal with regular expressions, and eliminates
some edge cases that no longer need to be tested.
2021-07-09 23:59:36 +09:00
Horacio Sanson 774ab4b4f0
Update eclipse JDT LSP documentation (#3743)
Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-07-09 23:55:47 +09:00
Mathias Jean Johansen 1e9f40ff8d
Add support for `lua-format` fixer. (#3804) 2021-07-09 23:54:43 +09:00
Gerardo Gómez Rodríguez 8b73d98baf
chore: replace python-language-server to supported pylsp (#3810)
As mentioned in #3722 palantir's python-language-server is no longer maintained.
The alternative is to use the community-driven https://github.com/python-lsp/python-lsp-server.
2021-07-09 22:40:31 +09:00
Matej Fandl e230f07465
updated ale-purescript configuration example in docs according to changes in Spago v0.14 (#3710) 2021-07-07 09:50:44 +09:00
Moritz Röhrich 958f30c163
hadolint: multiple fixes and adapt expected format (#3678)
- Show hadolint rule number in vim gutter in addition to `ALEDetails`
- Capture and show error in case of syntax errors
- Add tests for error capture
- Adapt existing tests

fixes: #2333
fixes: #958
2021-07-05 21:54:03 +09:00
James Cherti af13c350d2
Add stdin ("-") to the command-line arguments of ansible-lint >=5.0.0 (#3786)
* Added an explicit stdin argument to ansible-lint >=5.0.0 (ansible_lint.vim).

This commit fixes the issue "<<NO OUTPUT RETURNED>>":
```
:ALEInfo
(finished - exit code 0) ['/bin/bash', '-c', ''ansible-lint'' --parseable-severity -x yaml < ''/tmp/vVyvn4B/7/test2.yml'']
<<<NO OUTPUT RETURNED>>>'
```

Reason: Ansible-lint ignores stdin when "-" or "/dev/stdin" is not
specified explicitly.

Tested with: ansible-lint 5.0.12 using ansible 2.11.2

* Update ansible-lint tests.
2021-07-05 21:48:32 +09:00
Néstor Coppi 87e079a9b2
Solidity solc linter compatible with 0.6/0.7/0.8 (#3763) 2021-07-04 21:40:12 +09:00
Jesse Hathaway 36fcb01e05
Add pandoc as a markdown fixer (#3641)
Utilize pandoc to fix markdown files, currently set to Github-Flavored
Markdown, but that can be changed by setting,
ale_markdown_pandoc_options.
2021-07-04 21:39:29 +09:00
ourigen e4ddd32c84
Let R_languageserver consider .Renviron (#3744)
* Fix languageserver.vim to consider Renviron

* Update test_r_languageserver.vader

* Update credits
2021-07-04 21:34:35 +09:00
Frederick Zhang afcbd1620e
Change checkstyle's output sub_type to style (#3780) 2021-07-04 21:31:00 +09:00
Michael Jeanson 9efa96eb94
fix: cflags parser: no absolute path for '-include' (#3775)
Both '-include' and '-imacros' take a file as an argument that will then
be searched in the include path like a regular '#include "..."'
statement in a source file. As such, they should not have their path
converted to an absolute path.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
2021-07-04 21:27:55 +09:00
Carl Smedstad f9332bae1f
Add support for rpmlint 2.0.0 (#3757)
The -o/--option flag was removed in version 2.0.0 of rpmlint. Providing
this causes rpmlint to fail and provide no output. Only provide this
flag to rpmlint if the version is less than 2.0.0.
2021-07-04 21:19:00 +09:00
D. Ben Knoble d6302d1858
racket/raco: add filename to loc list (#3777)
This allows the location list from one buffer to point to an issue in
another; previously, the error message would be shown but with no way to
jump to it.
2021-07-04 21:17:44 +09:00
Filippo Tessarotto 12d8803015
[PHP] PhpStan also looks for .dist config file (#3765)
* [PHP] PhpStan also looks for .dist config file

* Add tests
2021-07-04 21:16:55 +09:00
Buck Evan 52563f9181
black fixer: --pyi option was appended without a space (#3759) 2021-07-04 21:15:37 +09:00
Linda_pp 45430eb07e
Use filter pattern instead of regex for tags filter in CI workflow (#3802)
since regex is not supported for filtering paths, tags and branches.

- Document: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
- Answer by GitHub staff: https://github.community/t/using-regex-for-filtering/16427/2
2021-07-04 21:11:38 +09:00
Robert Liebowitz 0d90cb64c6
Add stylua fixer for lua (#3789) 2021-07-03 18:50:48 +09:00
Yuxuan 'fishy' Wang b749ec702a
Change default of go_staticcheck_lint_package to 1 (#3799)
Fixes https://github.com/dense-analysis/ale/issues/3798.
2021-07-03 18:40:01 +09:00
Gregory Anders 49bdbc3ba5
Deduplicate items in location list (#3792) 2021-07-03 18:38:37 +09:00
w0rp 7862633d9d
When repeating selections, jump to the last selected item 2021-06-29 11:53:11 +01:00
Stefan Braun a4ba421803
Fixes an index error with Java files. (#3706)
Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2021-06-22 14:07:49 +01:00
Shannon Moeller 397d56f40c
fix(eslint): yarn 2 project cwd (#3684)
* eslint-handler: fix getcwd when there is no node_modules
2021-06-19 12:03:39 +01:00
w0rp a566a5d01b
#3719 - Prevent redir being used again in future 2021-06-19 12:01:33 +01:00
حبيب الامين ad27e921d7
Fix breakage w/ plugins that inadvertently trigger ALE in `execute()` (#3719)
Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2021-06-19 11:56:43 +01:00
Horacio Sanson 88817b3780
Fix 3167 - add custom fixer example to help docs. (#3541)
Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-06-19 11:47:35 +01:00
w0rp 2c8a857262
Move a test file to match the newer location 2021-06-19 11:00:26 +01:00
w0rp e78519683e
Close #3433 - Only use noselect if set for automatic completion 2021-06-19 10:57:34 +01:00
w0rp 84a4a76aaf
Close #3770 - Add support for checking circleci configs 2021-06-19 10:34:57 +01:00
w0rp 1b08791228
Make staticcheck configurable with GOPATH detection 2021-05-27 22:03:46 +01:00
Pau Ruiz Safont a02a4f2811
ocaml: prepare for filetype separation (#3732)
The ocaml filetype is currently used for several, different file
formats. This causes problems as not all tools support all formats.
New filetypes are introduced to support this separation, this needs some
changes in ale that are fortunately backwards-compatible.

These change add ocamlinterface file support for ocp-indent, merlin,
ocamlformat and ocaml-lsp. For ocaml-lsp I took the liberty to
add all recognised language ids, even if they are not supported.

ols has not been changed as the project has been abandoned since 2019.
2021-05-27 16:33:43 +09:00
w0rp f53431331e
Enable gopls by default with GOPATH detection 2021-05-26 22:43:33 +01:00
David Hotham 3f386ae5e9
Don't use a temporary file for tflint (#3717)
* Don't use a temporary file for tflint

* set cwd for tflint
2021-05-25 09:41:14 +09:00
awang bf1c30f585
Use stdin/out for cmake-format (#3725)
cmake-format added support for reading from/outputting to stdin/out as
of v0.3.6, released 2018-04-10 (commit 2e2aff2) [0].

Reading from stdin is preferable over reading from a temporary file
because when given a concrete file cmake-format will look for its config
file (.cmake-format.py or similar) in the parent directories of the
provided file. If the temporary file is off in a tmpdir somewhere (e.g.,
/tmp on *nix), cmake-format will almost certainly not come across the
user's intended format configuration file, making it appear that
cmake-format is ignoring the config file.

If cmake-format reads from stdin, though, it'll look for its config file
in its current working directory and its parent directories, in a
similar manner to clang-format. This has a much higher chance of running
across the intended config file.

[0]: https://github.com/cheshirekow/cmake_format/releases/tag/v0.3.6

Co-authored-by: Alex Wang <ts826848@gmail.com>
2021-05-25 09:37:09 +09:00
ourigen 6ef5bf308c
Allow lintr to consider .Renviron settings. Fix #3391 (#3727)
* Fix lintr.vim to consider Renviron

* Update test_lintr.vader to match lintr.vim fix

* Update credits

Co-authored-by: ourigen <ourigen [at] pm.me>
2021-05-25 09:30:42 +09:00
Horacio Sanson 93f80ea767
Fix 3524 - parse buffer signs with getplaced() function (#3648)
Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-05-23 21:58:13 +09:00
w0rp bee8eccb42
Fix a bug when code actions have no changes 2021-05-04 08:44:33 +01:00
Linda_pp d81986a106
add 'How can I use ALE and vim-lsp together?' in readme (#3711) 2021-04-30 18:33:50 +01:00
Jay Sitter 737c1bf1ac
Fix stylelint not obeying project-specific rules (#3272)
* Fix stylelint not obeying project-specific rules

* Fix tests

* Fix test

* Fix test
2021-04-20 12:50:57 +09:00
Henrique Barcelos 1c90d8c018
Updated `solhint` linter to be able to use a local installation (#3682)
* fix: added support for local solhint executable

* feat: added support for matching parse errors

* test: added test for solhint command callback and handler

* chore: removed command callback test

* refactor: made solhint handler structure closer to eslint
2021-04-15 09:01:18 +09:00
Kevin Clark 1cd0c0c33b
Don't exit visual mode on floating preview close (#3689) 2021-04-12 16:57:14 +09:00
infokiller 686c8c5e0a
hadolint: fix color output and stdin shown as "-" (#3680) 2021-04-10 21:17:55 +09:00
yohei yoshimuta cec9954d01
feat: Add protolint as linter and fixer (#2911) 2021-04-09 22:16:23 +09:00
bosr f0887d3e61
apple-swift-format: linter and fixer with config swiftpm support (#3671) 2021-04-07 19:34:34 +09:00
Remi Thebault 06f57ca973
improve DMD handler (#3647)
* improve DMD handler

 - ignore errors from other files
 - catch 'Deprecation' as warning
 - add tests

* adding filename key instead of filtering

* update dmd test

* fix test dmd windows
2021-03-30 15:47:59 +09:00
fiatjaf 655f0070cd
Add support for V: "v" (compiler) and "vfmt" fixer. (#3622)
* v: add "v fmt" fixer.

* v: add "v" (build) linter.

* v: fix vlint complaints and add documentation.

* v: add tests.

* v: use ale#Pad().
2021-03-26 15:38:57 +09:00
David Houston b1f95dc4fb
Add nixfmt as a Nix fixer. (#3651)
* Add nixfmt fixer.

* Replace manual options pad with ale#Pad()
2021-03-24 09:02:17 +09:00
Jon Parise eb0ebe6221
Switch to using buildifier's -path option (#3640)
Buildifier offers a -path command line option:

> Buildifier's reformatting depends in part on the path to the file
> relative to the workspace directory. Normally buildifier deduces
> that path from the file names given, but the path can be given
> explicitly with the -path argument. This is especially useful when
> reformatting standard input, or in scripts that reformat a temporary
> copy of a file.

This lets us drop our `-type`-guessing logic.

For the moment, we rely on the buffer filename being "relative to the
workspace directory", which it generally is, but in a future change, we
should introduce logic that will locate the WORKSPACE file and adjusts
the filename relative to that directory. This could be complicated based
on the working directory in which `buildifier` is executed, so a little
more research is necessary to implement that logic correctly.
2021-03-23 22:04:51 +09:00
BarrOff cdac7a830e
Add support for `ptop` fixer (#3652)
* Add support for `ptop` fixer

* add test file for ptop tests

* called wrong fixer in assertion test

* use ' %s %t' instead of ' %t %t'
2021-03-23 21:51:14 +09:00
Remi Thebault c6b61950f8
Add more parameters to the DMD linting command (#3639)
* Add more parameters to the DMD linting command

fixes #3637

* adding tests for dmd linter

* adding dmd test for windows
2021-03-23 08:31:52 +09:00
w0rp f7852dbd0a
#3633 - Move linter tests into test/linter 2021-03-21 00:25:33 +00:00
w0rp 35caaecc9f
Allow more time before PRs become stale 2021-03-20 22:35:43 +00:00
Tommy Chiang 3728d9f76c
Add support for clangd with CUDA (#3598)
* add support for clangd with CUDA
* add clangd with CUDA in supported-tools.md
* add doc for clangd with CUDA
2021-03-20 22:26:53 +00:00
fiatjaf 4411b4d751
add support for svelte via svelteserver language server (#3644)
* add support for svelte via svelteserver language server
* svelte: fix Vint error and add a `svelteserver` simple test.

Co-authored-by: Joakim Repomaa <mail@j.repomaa.com>
Co-authored-by: Joakim Repomaa <mail@jreinert.com>
2021-03-20 22:23:27 +00:00
w0rp b1d833417b
#3633 - Put all dummy test files in test/test-files 2021-03-20 22:11:42 +00:00
w0rp 3838ae118d
Add desktop-file-validate 2021-03-19 22:29:06 +00:00
w0rp 8319e0f8c7
Fix a typo in a test filename 2021-03-19 21:55:15 +00:00
Nathan Henrie ed7f4dee53
issue 3033 (#3620)
* Add ale_python_pyls_options

* Add extra explanatory detail

* Fix alignment

* Fix test
2021-03-18 08:55:50 +09:00
w0rp dc40ece3c3
#3632 Add ale#util#MapMatches 2021-03-15 22:30:22 +00:00
w0rp bd808dca30
Fix ale#path#Dirname on Windows 2021-03-15 21:30:13 +00:00
w0rp c00852e809
Disable blank issues and add a link to ask for help 2021-03-15 00:36:45 +00:00
w0rp f43e4abc88
Check user systemd unit files with systemd-analyze 2021-03-14 23:34:38 +00:00
w0rp b45ee8ec6c
Close #2102 - Add support for the Angular language server 2021-03-14 21:10:20 +00:00
ourigen 80a48d01be
Fix texlab#GetProjectRoot (#3610)
* Fix texlab GetProjectRoot

* Fix indents in texlab#GetProjectRoot

* Prevent texlab from starting on every tex file

* Update texlab Vader tests

* Fix GetProjectRoot to return parent of .git

Previously, the function returned `../.git/`. We want the function to return the parent directory above that as the project root. This should help pass Vader tests.
2021-03-12 20:40:40 +09:00
Victor Fernandez c21d6afd2f
Solve #3611 (#3612)
Fix dmd not using dub
2021-03-07 20:20:35 +09:00
Horacio Sanson 8c5081f631
Fix 3605 - set fallback for error detail (#3606)
* Fix 3605 - set fallback for error detail

* Add use case with no detail key

Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-03-04 20:45:33 +09:00
w0rp 826878c41e
Update documentation for floating window borders 2021-03-01 21:38:14 +00:00
Yen3 1d76fd55a1
Add borders for floating windows in Neovim (#3603)
* Add borders for floating windows in Neovim
* Add docs for floating window border setting

Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2021-03-01 21:36:05 +00:00
w0rp 680ba68d81
#3599 - Use ale_root instead of ale_lsp_root
The `ale_lsp_root` setting is now deprecated, and `ale_root` should be
used instead. The setting will be used for both setting the root easily
for LSP linters, and for running other linters over whole projects.
2021-03-01 20:51:29 +00:00
w0rp 9fe7b1fe6a
Close #2281 - Separate cwd commands from commands
Working directories are now set seperately from the commands so they
can later be swapped out when running linters over projects is
supported, and also better support filename mapping for running linters
on other machines in future.
2021-03-01 20:11:10 +00:00
Antoine Gagné 48fab99a0a
Add support for `erlfmt` fixer (#3602)
* Add support for `erlfmt`

* Add missing entry to table of contents

* Fix warnings

* Add missing tools to supported tools
2021-02-28 22:31:44 +09:00
serapas 038e4a8c31
Fix ansible-lint linter definition. (#3601)
* Fix ansible-lint linter definition.

Use ansible-lint's feature auto-detection instead of temporary file.
For auto-detection to work, ansible project has to be also a git repository.

Don't use yaml rules. These are checked by yamllint.

Refactor pattern to work with ansible-lint >=5.0 version.

Clean-up obsolete test cases.

* Pull Request changes
2021-02-28 21:43:23 +09:00
Horacio Sanson 7696561555
Fix 3537 - remove -T argument from ruby linter (#3538)
Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-02-23 16:48:42 +09:00
Jon Parise 90b9597d50
Add a buildifier fixer for Bazel files (#3499)
This fixer enables buildifier's formatting and "lint fix" modes.
Additional options can be provided via `bazel_buildifier_options`.

It also implements some basic logic for guessing the file's type.
buildifier itself usually does this based on the filenames provided on
the command line, but because we're piping our buffer via stdin, we need
to do this manually.
2021-02-21 21:35:26 +09:00
Tomáš Janoušek 2550f5d952
Fixes to code actions (cursor moving, tests, EOL/EOF corner cases) (#3478)
* code_action: Don't move cursor when change covers entire file
* code_action: Refactor/simplify ApplyChanges
* code_action: Fix EOL at EOF corner cases while performing no changes
* code_action: Fix column around EOL corner cases
* code_action: Handle positions out of bounds
* code_action: Add instructions for verifying corner case tests against vscode
2021-02-20 16:16:47 +00:00
Alex LaFroscia d340710fcf
Support going to type definition with tsserver (#3545) 2021-02-20 16:09:28 +00:00
Risto Stevcev 3ea887d2f4
Added ocamllsp (#3595)
* Added ocamllsp

* Update ordering in docs to be alphabetical

* Updated expected result in test
2021-02-18 23:51:11 +09:00
David Buchan-Swanson 1ee7f6c97b
add support for prettier-ruby to prettier fixer (#3593)
it _does_ need an additional plugin, but when it has the plugin, it
works as expected.
2021-02-18 16:33:02 +09:00
David Balatero 0b35c3a5b9
Make markdown vale linter command configurable with options (#3594)
* Make vale command user-configurable

* Add test for vale options

* Typo in test

Co-authored-by: David Balatero <dbalatero@stripe.com>
2021-02-18 10:10:49 +09:00
Jason Axelson 88d052b5a9
Update elixir-ls link in supported tools (#3588)
https://github.com/elixir-lsp/elixir-ls/ is now the canonical repo: 

> It's now being maintained by proactive volunteers from the Elixir community over at elixir-lsp/elixir-ls. Updates will continue to be published from that repo to the original VS Code extension, so no need to switch plugins if you're using VS Code.

from: https://github.com/JakeBecker/elixir-ls#this-project-has-moved
2021-02-14 23:04:12 +09:00
Mukund Mauji b30c5c9b51
Allow clangformat to use a local style file (#3587)
* Allow clangformat to use a local style file.

* Add tests.

* Fix Vint issue.

* Improve explanation of feature in documentation.

* Fix failing test.

The test was checking the wrong directory.
2021-02-14 23:03:04 +09:00
Daniel Leong 8cb9f5ef51
mypy: Pass user options before any others (#3582)
This enables us to use a custom `python` exe as the "mypy" executable
and pass `-m mypy` in `mypy_options`
2021-02-11 20:29:23 +00:00
w0rp 3b184f88d3
Bump the ALE version to v3.1.0 2021-02-11 19:47:29 +00:00
Tarik Graba ea72d66b6d
Verilator current file search path (#3500)
* Simplify verilator linter using ale command format strings
* Verilator Linter: Restructure linter command tests
* Verilator Linter: adds to the handler test the returned filename
* Verilator Linter: add the current file path to the search path
* Verilator Linter: Add the search path to the tests

Co-authored-by: TG <tarik.graba@telecom-paris.fr>
2021-02-11 19:35:25 +00:00
w0rp 1773a496ad
Clean up the hdl_checker test a bit better 2021-02-10 22:10:18 +00:00
w0rp 388cf33743
Fix #3579 - Escape cppcheck arguments for Windows 2021-02-06 20:13:28 +00:00
Hugo Gualandi 77c034884b
Bugfix: ParseCFlagsFromMakeOutput was never being called (#3574)
Previously, the make output was never being parsed, even when the
`c_parse_makefile` option was set.
2021-02-06 19:06:01 +00:00
w0rp 8beb67b4d1
Fix tests for LSP suggestions 2021-02-06 18:55:21 +00:00
w0rp 99eb68e6ca
#3362 Disable LSP/tsserver hints/suggestions by default 2021-02-06 18:49:42 +00:00
Horacio Sanson f9f2ad2765
Merge pull request #3571 from rfwatson/gopls-add-init-options
gopls: add go_gopls_init_options
2021-02-06 21:34:19 +09:00
Horacio Sanson b88d3c4e4b
Merge pull request #3575 from hugomg/gnumakefile
Have c_parse_makefile look for GNUmakefile as well
2021-02-06 21:31:16 +09:00
Horacio Sanson cf53eb3667
Merge pull request #3568 from jD91mZM2/jq
Add jq linter for JSON diagnostics
2021-02-06 21:29:51 +09:00
jD91mZM2 27130efc65
Reuse ale#fixers#jq#GetExecutable for jq 2021-02-06 11:12:04 +01:00
Hugo Musso Gualandi ae916d49fd Add test case for gnumakefile detection 2021-02-05 20:48:52 -03:00
Horacio Sanson 787ab2a366
Merge pull request #3529 from krsch/master
phan: add filename to output
2021-02-05 23:02:47 +09:00
Horacio Sanson f612805801
Merge pull request #3576 from cyyever/fish_indent
Fish indent
2021-02-05 22:58:43 +09:00
Hugo Musso Gualandi 4c7e843fd0 Have c_parse_makefile look for GNUmakefile as well
Makefiles using GNU-make features might be called "GNUmakefile" instead
of "Makefile". This commit teaches the `c_parse_makefile` feature to
look for a GNUmakefile file if a Makefile is not present.
2021-02-03 19:15:03 -03:00
Rob Watson 26b92f73b5 gopls: add go_gopls_init_options 2021-02-03 14:49:27 +01:00
Alexey Kreshchuk cc67bc0541 add filename to output 2021-02-02 17:34:59 +03:00
jD91mZM2 98caa19cc7
Add command callback test 2021-02-02 13:15:46 +01:00
Horacio Sanson 9b5c090473
Merge pull request #3472 from m-ildefons/hadolint
hadolint: Recognize message type
2021-02-02 13:08:18 +09:00
w0rp c747c277c2
#2547 Add a cfn-lint alias for cloudformation 2021-01-31 17:06:56 +00:00
w0rp 1457e54528
#3527 - Clarify that popup menus should only be used in GUI Vim 2021-01-31 16:29:22 +00:00
Jerko Steiner e8080be08b
Allow duplicate LSP completions for autoimport (#3473)
Similarly to TS completions, this allows the user to pick the package to autoimport when both the package and method name are the same.
2021-01-31 16:21:31 +00:00
jD91mZM2 4894c760c2
Add jq linter for JSON diagnostics 2021-01-31 13:01:03 +01:00
Horacio Sanson 7572ec3489
Merge pull request #3474 from yen3/haskell-hls
Add linter for haskell-language-server
2021-01-31 20:19:00 +09:00
yen3 e5e851fadc Add linter for haskell-language-server
The patch adds a new linter for haskell-language-server (hls). hls is
the integration point of haskell-ide-engine (hie) and ghcide.
2021-01-31 11:43:45 +01:00
Horacio Sanson 2d07fa0cc2
Merge pull request #3566 from hsanson/2726-fix-terraform-linter
Fix 2726 - fix terraform linter.
2021-01-30 18:20:49 +09:00
Horacio Sanson dd1c665db2 Fix tests on windows 2021-01-30 18:17:28 +09:00
Horacio Sanson d511d5af11 Fix 2726 - fix terraform linter.
Instead of using `terraform fmt` for linting use `terraform validate`
with json output.
2021-01-30 17:20:44 +09:00
Horacio Sanson 7c44f4e403
Merge pull request #3565 from hsanson/3371-add-terraform-ls-support
Fix 3371 - Add terraform-ls support
2021-01-30 16:19:40 +09:00
Horacio Sanson 64d430438e Fix 3371 - Add terraform-ls support 2021-01-30 16:09:39 +09:00
w0rp 82c8e3a3a3
Remove last traces of Travis CI
* The build status badge is now for GitHub Actions.
* The documentation now mentions GitHub instead.
* Warnings in the YAML file have been fixed or ignored.
2021-01-27 20:11:46 +00:00
Horacio Sanson bafe1c0fd6
3560 add vim 8.2 and nvim 0.4 to ci tests (#3561)
* Add vim82 and neovim04 to CI tests.

* Fix test_sign_column_hightlighting test.

In vim82 with verbose=1 the output of highlight command changes breaking
the ale#sign#SetUpDefaultColumnWithoutErrorsHighlight(). This commit
forces verbose=0 when the method starts and restores the previous value
before exiting.

* No return values in vim82 returns a numeric value instead of a empty string.

* Fix test_reek_handler test

The FuzzyJSONDecode() method catches E474 when it fails to parse the
input as JSON but Vim8.2 throws E491 instead. This commit modifies the
function to catch both E474 or E491.

* Fix perl6 handler test.

Perl6 handler catches json parse errors using the E474 error but in
Vim82 it changed to E491. This commit modifies the handler so both
errors are considered.

* Fix list opening tests.

In Vim 8.2 the call `range(1, bufnr('$'))` always returns quickfix
buffers no matter if they are closed or not. Using `ls` does not show
them but the above range will always include them.

This new behavior breaks the ale#list#IsQuickfixOpen() method that in
turn breaks many other things. This commit fixes this by using the
getqflist() and getloclist() methods instead.

* Fix test updates loclist test.

For some reason in Vim 8.2 the sign offset seems to not reset between
tests causing the sign_id to not match in the Assert. When the test is
run individually it passes but when run as part of the whole suite the
sign_id is off by one.

Forcing the offset in the test setup seems to fix the issue.

* Fix omnifunc completion test.

For unknown reasons the SetCompletionResponse tests fail in Neovim 0.2
and 0.4. Unfortunatelly the only solution I found is to disable them
for neovim.

* Fix linter warnings

* Fix smoker test.

Add vim 8.2 to the list of versions that need some retires due to
randomly failing tests.

* Add docker image build job.

Trying some clever trick to build the docker image if not available
locally or in Docker hub. It uses the Dockerfile md5 checksum as tag so
only when changes on that file occur will the image be downloaded or
build.

* Add labels to Docker image

* Remove tests for middle versions 8.1 and 0.3.5

* Use same vader commit as appveyor

* Implement image push to Docker Hub

Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-01-27 19:52:24 +00:00
Horacio Sanson c9f4005820
Merge pull request #3425 from pinicarus/custom-dialyzer-options
Custom erlang/dialyzer options
2021-01-27 20:24:26 +09:00
Kevin Svetlitski cab4280d02
Feature: Add support for named-pipe sockets for LSPs (#3509)
* Add support for using named pipes for lsp 'socket' servers; documentation updated accordingly
* Add tests for connecting to named pipe sockets
2021-01-26 20:43:17 +00:00
Horacio Sanson 3a1728297a
Merge pull request #3227 from Ma27/nixunstable-error-fmt
Update error-parser for `nix-instantiate` on Nix 2.4+
2021-01-25 13:53:09 +09:00
Maximilian Bosch 72dbd7f648
Update error-parser for `nix-instantiate` on Nix 2.4+
In the (unreleased) Nix 2.4 the error-messages have been reformatted[1].
This patch aims to retain proper `.nix`-support in `ale`, for both
stable Nix (2.3 and older) and unstable Nix (2.4 and newer).

[1] https://github.com/NixOS/nix/pull/3590
2021-01-24 22:54:02 +01:00
Horacio Sanson 471e20ed2b
Merge pull request #3559 from nibocn/master
fix(eclipselsp): org.eclipse.equinox.launcher_xxxx.jar file matching
2021-01-24 16:36:34 +09:00
NiBo 65bfb07e43 fix(eclipselsp): org.eclipse.equinox.launcher_xxxx.jar file matching failed 2021-01-24 14:48:54 +08:00
Horacio Sanson 18eb6a0758
Merge pull request #3557 from benknoble/dafny-filename-again
dafny: update filename handling
2021-01-24 14:07:12 +09:00
Horacio Sanson 580271b510
Merge pull request #3377 from benknoble/fix-swipl
prolog/swipl: update error format for new version
2021-01-24 10:40:11 +09:00
Pierre-Nicolas Clauss 105bc55695
refactor(erlang/dialyzer): remove file placeholder from options
Signed-off-by: Pierre-Nicolas Clauss <pinicarus@protonmail.com>
2021-01-23 19:07:26 +01:00
Pierre-Nicolas Clauss 0ac7595fe9
Merge remote-tracking branch 'upstream/master'
Signed-off-by: Pierre-Nicolas Clauss <pinicarus@protonmail.com>
2021-01-23 19:06:59 +01:00
D. Ben Knoble bacb8bb902 dafny: update filename handling
cf. #3475, #3390
2021-01-23 12:34:36 -05:00
D. Ben Knoble 2c1c5b06d9 Merge branch 'master' into fix-swipl
* master: (133 commits)
  Add rnix-lsp for Nix diagnostics and completion
  add spectral support for json
  add spectral handler
  add spectral linter for yaml
  doc: Fix linter issues
  doc: Add documentation for Deno
  feat: Add Deno lsp support
  feat: Add Deno fmt fixer
  Add document for apkbuild filetype
  Add tests for atools handler, basic and dealing with Error and Warning
  Test default linters for apkbuild
  Document new default linters for apkbuild
  Make apkbuild_lint and secfixes_check default for apkbuild filetype
  document support for apkbuild-lint and secfixes-check for apkbuild
  Add linters for apkbuild-lint and secfixes-check from atools
  Add handler for the output of atools
  Fix typos
  Add command callback tests
  Add support for standalone files
  Fix linting errors
  ...
2021-01-23 12:29:05 -05:00
D. Ben Knoble 10d2b8797c swipl: style fix 2021-01-23 12:27:55 -05:00
Horacio Sanson 9fd9435cd5
Merge pull request #3556 from jD91mZM2/rnix
Add rnix-lsp for Nix diagnostics and completion
2021-01-23 21:50:36 +09:00
Horacio Sanson 1101346657
Merge pull request #3547 from hsanson/3546-fix-E928-when-using-javac-linter-on-non-maven-projects
Fix 3546 - check empty executable string.
2021-01-23 21:26:39 +09:00
jD91mZM2 c1b6628425
Add rnix-lsp for Nix diagnostics and completion 2021-01-23 13:23:14 +01:00
Horacio Sanson 3e94c42ec0
Merge pull request #3521 from hsanson/3498-change-standardrb-fixer-to-use-stdin
3498 change standardrb fixer to use stdin
2021-01-23 19:28:41 +09:00
Horacio Sanson a6dfc611f6
Merge pull request #3424 from maxice8/atools
Add support for Alpine Linux APKBUILD
2021-01-23 16:05:26 +09:00
Horacio Sanson 3c3dcd4041
Merge pull request #3489 from t2h5/yaml-spectral-linter
Add Stoplight Spectral linter for yaml
2021-01-23 16:00:45 +09:00
tatsuya 66b3e768db add spectral support for json 2021-01-23 11:56:10 +09:00
tatsuya 997dd7f8fe add spectral handler 2021-01-23 11:56:10 +09:00
tatsuya 5a47d878fb add spectral linter for yaml
ci
2021-01-23 11:56:10 +09:00
Horacio Sanson c374736301
Merge pull request #3533 from motato1/master
Deno support for LSP and fixer
2021-01-23 11:04:52 +09:00
Horacio Sanson 5200e6c734
Merge pull request #2825 from thindil/master
Added support for Ada Language Server
2021-01-23 09:41:02 +09:00
Mohammed Chelouti fe666a7a6c doc: Fix linter issues 2021-01-23 00:43:33 +01:00
Mohammed Chelouti e16c3b09f7 doc: Add documentation for Deno 2021-01-22 19:06:53 +01:00
Mohammed Chelouti 9b362634f7 feat: Add Deno lsp support 2021-01-22 19:06:53 +01:00
Mohammed Chelouti 4f2666265a feat: Add Deno fmt fixer 2021-01-22 19:06:52 +01:00
Leo d7ed80346c Add document for apkbuild filetype 2021-01-22 14:04:26 -03:00
Leo 56951932e0 Add tests for atools handler, basic and dealing with Error and Warning 2021-01-22 14:04:26 -03:00
Leo 4999ae2e85 Test default linters for apkbuild 2021-01-22 14:04:26 -03:00
Leo 4f8f2a4a0c Document new default linters for apkbuild 2021-01-22 14:04:26 -03:00
Leo 542ba5a04a Make apkbuild_lint and secfixes_check default for apkbuild filetype 2021-01-22 14:04:26 -03:00
Leo df91bc9046 document support for apkbuild-lint and secfixes-check for apkbuild 2021-01-22 14:04:26 -03:00
Leo 32c0eb7c42 Add linters for apkbuild-lint and secfixes-check from atools 2021-01-22 14:04:26 -03:00
Leo 99a809c814 Add handler for the output of atools
atools is a collection of tools written in ash shell and Lua that
provide linting for Alpine Linux's APKBUILD.

APKBUILDs are build recipes used by Alpine Linux's build system, abuild,
an equivalent would be Arch Linux's PKGBUILD and Gentoo's ebuild.
2021-01-22 14:04:26 -03:00
Horacio Sanson 33f2f8ddcd
Merge pull request #3551 from fenuks/bugfix-3506
Fix clang-tidy ignoring compile-commands.json
2021-01-23 01:55:40 +09:00
Bartek thindil Jasicki 1ca780a08a Merge remote-tracking branch 'upstream/master' 2021-01-22 17:52:01 +01:00
Horacio Sanson 1b010bbabb
Merge pull request #3069 from nelsyeung/feature/dart-analysis-server
Add dart analysis server to linter
2021-01-23 01:47:38 +09:00
Nelson Yeung 985a5295a9 Fix typos 2021-01-22 16:37:38 +00:00
Nelson Yeung efe65f3477 Add command callback tests 2021-01-22 16:37:38 +00:00
Nelson Yeung a8acac1f4a Add support for standalone files 2021-01-22 16:37:38 +00:00
Nelson Yeung 850c41b2a9 Fix linting errors 2021-01-22 16:37:38 +00:00
Nelson Yeung 847f729cd4 Add dart analysis_server doc 2021-01-22 16:37:38 +00:00
Nelson Yeung 075c3e0ad0 Add dart analysis_server to supported tools 2021-01-22 16:37:38 +00:00
Nelson Yeung 35b8bb8a55 Add dart analysis server linter 2021-01-22 16:37:38 +00:00
Horacio Sanson 53ff5f2d88 Fix 3546 - check empty executable string.
At some point VIM/NVIM started throwing errors if the input string is
empty for some functions such as execute() and fnamemodify(). This
commit checks if the executable string is empty before passing it to the
executable() function.

Resources:
  - https://github.com/vim/vim/issues/7465
  - https://github.com/vim/vim/releases/tag/v8.2.2117
2021-01-23 01:34:13 +09:00
Horacio Sanson 9a1e91e075
Merge pull request #3519 from atsuya/feature/support-vala-lint
Add support for Vala-Lint
2021-01-23 01:24:24 +09:00
Horacio Sanson 64550062dc
Merge pull request #3148 from charlesbjohnson/charlesbjohnson/xo
fixers/xo: enhance `xo` fixer
2021-01-23 01:23:22 +09:00
Charles B Johnson 451e99341e
xo: refactor to function 2021-01-22 09:23:54 -06:00
Charles B Johnson 03bd494fd4
linters/xo: prefer function shorthand 2021-01-22 09:23:54 -06:00
Charles B Johnson 5fd5fa5305
linters/xo: fix tests 2021-01-22 09:23:54 -06:00
Charles B Johnson 4edfac4db6
xo: inline filetype handling 2021-01-22 09:23:54 -06:00
Charles B Johnson 23ff19a162
fixers/xo: remove unnecessary directory crawl 2021-01-22 09:23:54 -06:00
Charles B Johnson 1991313ee7
xo: update docs 2021-01-22 09:23:54 -06:00
Charles B Johnson f17beadb49
fixers/xo: support monorepos 2021-01-22 09:23:54 -06:00
Charles B Johnson 8ffde14039
fixers/xo: support stdin relative to the fixed file 2021-01-22 09:23:53 -06:00
Charles B Johnson e75ac9f497
fixers/xo: support typescript options 2021-01-22 09:23:53 -06:00
Charles B Johnson 289f808ccd
fixers/xo: refactor to handlers 2021-01-22 09:23:53 -06:00
Charles B Johnson 4a6136c27e
fixers/xo: add tests 2021-01-22 09:23:53 -06:00
Charles B Johnson 6bfcb9cdff
linters/xo: consolidate xo linters 2021-01-22 09:23:53 -06:00
Atsuya Takagi 6b0b8cec79
update doc with snake cased linter name 2021-01-23 00:20:36 +09:00
Atsuya Takagi 897f6b2b23
use snake case for linter name 2021-01-23 00:20:11 +09:00
Horacio Sanson db816b5c3f
Merge pull request #2782 from hsanson/2777-add-ibm-openapi-validator
Fix 2777 - Add IBM openapi validator
2021-01-23 00:13:40 +09:00
Atsuya Takagi 33485ffb92 document the variables can be set for the linter 2021-01-23 00:08:01 +09:00
Atsuya Takagi 8d5b3e827d decide whether or not to run with config file based on the presence of config filename value 2021-01-23 00:08:01 +09:00
Atsuya Takagi e3e1ddce95 allow setting vala-lint executable 2021-01-23 00:08:01 +09:00
Atsuya Takagi 4328fe7dca add a blank line before if statement 2021-01-23 00:08:01 +09:00
Atsuya Takagi 04550717bf add Vala-Lint as supported linter 2021-01-23 00:08:01 +09:00
Atsuya Takagi 2dbf4ee271 add test to check if it properly ignores outputs with unknown error types 2021-01-23 00:08:01 +09:00
Atsuya Takagi 67c3fa9001 add documentation for vala-lint 2021-01-23 00:08:01 +09:00
Atsuya Takagi ed2afafd62 use ale#Set for setting default config variable values 2021-01-23 00:08:01 +09:00
Atsuya Takagi 823b094f56 support flags for enable/disable config 2021-01-23 00:08:01 +09:00
Atsuya Takagi 89403b4a06 expect warn or error 2021-01-23 00:08:01 +09:00
Atsuya Takagi 280d2dedae find and use vala-lint config if exists 2021-01-23 00:08:01 +09:00
Atsuya Takagi c15d9538cd use the correct regex to match the escape sequences... 2021-01-23 00:08:01 +09:00
Atsuya Takagi b3010ad793 fix the wrong variable name 2021-01-23 00:08:01 +09:00
Atsuya Takagi 9eb6dace88 escape color sequences 2021-01-23 00:08:01 +09:00
Atsuya Takagi e94d23b1d9 test my hypotethis 2021-01-23 00:08:01 +09:00
Atsuya Takagi 7f1dd5f66a specify a filename of the current buffer 2021-01-23 00:08:01 +09:00
Atsuya Takagi 3e820207e7 be precise about output_stream 2021-01-23 00:08:01 +09:00
Atsuya Takagi 4ed520a219 add initial files 2021-01-23 00:08:01 +09:00
Horacio Sanson 9bc4b468c2 Fix linter error 2021-01-22 23:51:29 +09:00
fenuks 65824feef3 Fix clang-tidy ignoring compile_commands.json 2021-01-22 15:19:38 +01:00
Horacio Sanson 4aa11cbc05 Improve documentation 2021-01-22 23:17:38 +09:00
Horacio Sanson 014b00d4d7 Add yamllint and prettier to openapi.
This commit enables yamllint and prettier on openapi files.
2021-01-22 23:17:38 +09:00
Horacio Sanson 03eae9e085 Fix 2777 - Add IBM openapi validator 2021-01-22 23:17:38 +09:00
Horacio Sanson 27a22e7161 Update tests 2021-01-22 23:17:01 +09:00
Horacio Sanson 7fe61cdf0e Fix 3498 - Change standardrb fixer to read from stdin.
Seems standardrb fails to properly use the --config option when using
temporary files but works fine when reading from stdin. This commit
changes the fixer so it uses stdin instead of temporary files.
2021-01-22 23:17:01 +09:00
Horacio Sanson a1e6df987c
Fix 354 - Migrate CI from travis to Github Actions (#3549)
* Fix 354 - Migrate CI from travis to Github Actions
* Use matrix strategy for parallel tests
* Don't build image on each run
* Add push trigger on tags

Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-01-22 09:27:36 +00:00
Bartek thindil Jasicki 42bf5ca911 Merge remote-tracking branch 'upstream/master' 2021-01-22 09:45:52 +01:00
Horacio Sanson 80a0108fcf prolog/swipl: cover new format with complex tests
https://github.com/dense-analysis/ale/pull/3377#issuecomment-763628447
2021-01-20 12:08:05 -05:00
Horacio Sanson 6a3d215571 prolog/swipl: simplify with @hsanson's suggestions
https://github.com/dense-analysis/ale/pull/3377#issuecomment-763628447
2021-01-20 12:07:26 -05:00
Horacio Sanson 7e3d2930d8
Merge pull request #3261 from toastal/dhall
Enhanced Dhall fixer support
2021-01-20 21:06:03 +09:00
Horacio Sanson 7b42dd7387
Merge pull request #3475 from benknoble/dafny-include-timeouts
dafny: add a timeLimit option and message-parsing
2021-01-20 20:48:53 +09:00
Horacio Sanson 16c45b8213
Merge pull request #3453 from blinsay/blinsay/rust-analyzer-lsp
pass lsp intialization_options to rust-analyzer
2021-01-20 20:45:17 +09:00
Horacio Sanson 8de0e7b9ba
Merge pull request #3430 from mbrunnen/mbn/fix-macros-include-c-flag
Add -imacros to C flags
2021-01-20 20:42:18 +09:00
Horacio Sanson 783cf4ab82
Merge pull request #3362 from daliusd/tsserver_hints
Show tsserver hints/suggestions in Ale.
2021-01-20 20:40:44 +09:00
Horacio Sanson bfc412a77b
Merge pull request #3455 from Thau/feat/credo_config_file
feat: Adds variable to use custom config file with Elixir Credo
2021-01-20 08:42:45 +09:00
Horacio Sanson 9387ccfbc5
Merge pull request #3485 from andreaconti/master
Fix Julia Language Server Support
2021-01-16 15:58:21 +09:00
Horacio Sanson bbac230008
Merge pull request #3234 from hsanson/3233-enable-ktlint-fixer-for-kotlin-files
Enable ktlint fixer for kotlin files.
2021-01-15 22:26:56 +09:00
Bartek thindil Jasicki 45a28383a2 Merge remote-tracking branch 'upstream/master' 2021-01-15 09:42:14 +01:00
w0rp 6fbdec8587
Merge pull request #3535 from dense-analysis/revert-3358-master
Revert "Improves fixer performance for large buffers"
2021-01-14 20:41:55 +00:00
w0rp 8dce126a6c
Update the Docker image; fix an error 2021-01-14 20:24:19 +00:00
w0rp f398faa8d3
Merge pull request #3471 from kevinclark/3448-fix-unittests
Make test/scripts/custom-checks portable
2021-01-14 18:08:44 +00:00
Kevin Clark 39f393ef07
Add nvim floating window support (replaces #3314) (#3470)
* Add nvim floating window hover support
* Add configuration for float to replace preview
* preview#ShowFloating: qualify local variables
* Configure floating preview usecases individually

Also:
  * Extract floating preview to its own file.
  * Ignore 'stay_here' option. Moving into the floating preview window
    seems confusing at best.
  * Re-use existing floating preview window if it's still up.
  * Flush out floating preview documentation.

* Watch cursor position changes per window

Floating previews open a new window, so when that window is written to,
it moves briefly there at a different position than the original window.
This makes repeated positions detected when positions are tracked at a
s: level. Instead, we change the variable to window scoped, which only
fires a message if the cursor has changed from the last position in
*that window*.

* g:ale_floating_preview cleanup
* floating_preview: add ALEDetail tests
* Fix fecs test missing runtime call
* Add ALEHover floating preview tests

Co-authored-by: Jan-Grimo Sobez <jan-grimo.sobez@phys.chem.ethz.ch>
2021-01-14 18:06:20 +00:00
Horacio Sanson 97ce2423b0
Merge pull request #3494 from YorickPeterse/master
Add linter for Inko
2021-01-13 23:54:06 +09:00
Horacio Sanson 7b187af10a
Merge pull request #3482 from liskin/lsp-popup-menu-fix
codefix: Fix LSP MenuCallback invocation (E119, not enough args)
2021-01-13 23:41:34 +09:00
Horacio Sanson aabca5b0ac
Merge pull request #3398 from ecly/update-python-find-root
Update `ale#python#FindProjectRootIni` with poetry.lock and pyproject.toml
2021-01-13 22:07:02 +09:00
Horacio Sanson 012348582c
Merge pull request #3531 from pinicarus/custom-erlc-executable
Custom erlc executable
2021-01-13 14:04:58 +09:00
Horacio Sanson 12d28ca34f
Merge pull request #3399 from StephenWithPH/suggest-scalafmt-for-sbt
suggest scalafmt for sbt
2021-01-13 14:00:10 +09:00
Horacio Sanson 49f8aa4703
Revert "Improves fixer performance for large buffers" 2021-01-12 17:49:30 +09:00
Bartek thindil Jasicki 7b1ed2733e Merge remote-tracking branch 'upstream/master' 2021-01-08 09:43:19 +01:00
Horacio Sanson 54dd731cf1
Merge pull request #3386 from ivorpeles/master
Make isort fixer recognize auto_pipenv flag
2021-01-08 10:43:34 +09:00
Horacio Sanson 4c454c96a9
Merge pull request #3390 from benknoble/fix-dafny-filename
dafny: include correct filename in lint results
2021-01-06 11:19:29 +09:00
Horacio Sanson 7e4c125d38
Merge pull request #3491 from Poulpatine/salt-lint
Add salt-lint support
2021-01-05 12:45:36 +09:00
Horacio Sanson 8c34c738ab
Merge pull request #3517 from ttys3/master
fix: proper initialization options call in php intelephense
2021-01-05 10:53:34 +09:00
ttys3 b4d889b682 fix: proper initialization options call in php intelephense 2021-01-04 23:10:39 +08:00
toastal 3229d5aba4 Merge branch 'master' of https://github.com/dense-analysis/ale into dhall 2021-01-04 20:25:48 +07:00
Kevin Clark 6b97af680d Exclude grandfathered-in non-snakecased lints
Prior to #3448, several linters should have been failing the
custom-checks that look for non-snake-cased lint names. They weren't,
but now the bug that hid those is fixed. So to avoid breaking users, we
just exclude those from the check. Linters excluded:

  * clojure/clj_kondo.vim
  * elixir/elixir_ls.vim
  * go/golangci_lint.vim
  * swift/swiftformat.vim
2021-01-01 14:48:10 -08:00
Bartek thindil Jasicki 3fca5e73b6 Merge remote-tracking branch 'upstream/master' 2021-01-01 09:24:50 +01:00
Horacio Sanson 7fca451cf9
Merge pull request #3467 from fwy/bugfix-checkstyleRegexpNvimWin32
Fix checkstyle regexp pattern to work correctly in NVim on Windows
2020-12-28 15:22:25 +09:00
Yorick Peterse 8375ee2766
Add linter for Inko
This adds a linter for Inko (https://inko-lang.org/). The linter makes
use of Inko's own compiler, and a newly introduced --check flag to only
check for errors; instead of also compiling source code.
2020-12-23 16:50:45 +01:00
Manoel Brunnen 02255dd967 Add tests for -imacros C flag 2020-12-21 15:07:11 +01:00
toastal 9c7e1fe4dd
merging master 2020-12-21 10:26:09 +07:00
Bartek thindil Jasicki 8af805cefe Merge remote-tracking branch 'upstream/master' 2020-12-18 10:04:19 +01:00
Benjamin Binier e358afdd9b Add salt-lint support 2020-12-17 09:19:19 +01:00
Horacio Sanson f996ede599
Merge pull request #3403 from will/sorbetwatchman
Add Ruby sorbet option to enable watchman
2020-12-16 09:48:35 +09:00
Andrea Conti 6043eeb25a Fix test space bug 2020-12-12 00:41:05 +01:00
Andrea Conti 1f0cbc7dbd Fix space error in string concat 2020-12-12 00:37:14 +01:00
Andrea Conti fa2186d95e Update Julia language server run command 2020-12-12 00:16:09 +01:00
Tomas Janousek 6d7cff9c00 codefix: Fix LSP MenuCallback invocation (E119, not enough args) 2020-12-05 15:29:25 +00:00
Bartek thindil Jasicki b85207d524 Merge remote-tracking branch 'upstream/master' 2020-12-04 09:45:06 +01:00
D. Ben Knoble 730222bcd8 fix blank line issue (???) 2020-11-30 13:51:15 -05:00
D. Ben Knoble 7e12be0c64 Merge remote-tracking branch 'origin/master' into fix-swipl
* origin/master: (40 commits)
  fix: correct suggested filetype for yamlfix
  feat: add yamlfix fixer
  Use _config for LSP config options
  Add support for R languageserver (#3370)
  Fix 3103 - add shellcheck shell directive detection. (#3216)
  Added the Vundle command in installation instructions (#3400)
  Adds support for Tlint - A Tighten Opinionated PHP Linter (#3291)
  Add php phpcbf options (#3383)
  Use has('gui_running') instead of has('gui')
  Close #2727 - Add a hover-only setting for balloons
  Fix #3332 - Modify everything for rename/actions
  Add a missing blank line in documentation
  Add luafmt fixer (#3289)
  #3442 Fix code fix clangd issue
  Close #1466 - Add GVIM refactor menu support
  Look for node packages in .yarn/sdks as well
  Update documentation for code actions and rename
  cmp forwards, and reverse the code actions
  Support for LSP/tsserver Code Actions (#3437)
  Move the test for buffer-local variables
  ...
2020-11-30 13:42:21 -05:00
D. Ben Knoble 303b89a6b4 add tests 2020-11-30 13:40:57 -05:00
D. Ben Knoble 3f01cc247c dafny: add a timeLimit option and message-parsing 2020-11-30 13:28:04 -05:00
Moritz Röhrich d9b74caf43 hadolint: Recognize message type
Hadolint is in the process of adding the severity of a lint rule to the
commandline output: https://github.com/hadolint/hadolint/pull/501

This change utilizes that to show the severity in vim.
2020-11-29 15:09:47 +01:00
Horacio Sanson 03b6978a27
Merge pull request #3381 from andreypopp/gofmt-stding-stdout
Use stdin/stdout to communicate with gofmt
2020-11-29 18:59:48 +09:00
Kevin Clark 84c95aff9b Restore ls -v flag to check-toc 2020-11-28 09:44:19 -08:00
Kevin Clark 65b09cfa9d Restore use of grep in check-toc 2020-11-28 09:20:50 -08:00
Kevin Clark 6b0250a843 Use akevinclark/ale for the updated docker image 2020-11-28 09:05:06 -08:00
Kevin Clark d52dce2e6f Use docker image for custom-check scripts
NOTE: The custom-linting-rules test fails due to the following (legit)
warnings:

  ale_linters/clojure/clj_kondo.vim:29 Use snake_case names for linters
  ale_linters/elixir/elixir_ls.vim:15 Use snake_case names for linters
  ale_linters/go/golangci_lint.vim:54 Use snake_case names for linters
  ale_linters/swift/swiftformat.vim:56 Use snake_case names for linters

The message wasn't getting printed because docker was explicitly only
being asked to connect stdout (ignoring stderr). Unclear yet why the
error code wasn't getting bubbled up.
2020-11-28 08:26:13 -08:00
Kevin Clark e300a48e13 Fix test/script/check-supported-tools-tables 2020-11-28 08:23:06 -08:00
Kevin Clark 469af2a734 Fix TOC tests
Sort order is slightly different than the headings
2020-11-28 07:55:35 -08:00
Kevin Clark 99f1874e86 Add non-busybox grep/sed to Dockerfile
Tests need extended regexes from sed and --exclude from grep.
2020-11-28 07:51:02 -08:00
Kevin Clark f72e60c12a Fix check-supported-tools-tables check
sed wasn't using -E, so '|' wasn't being handled properly. Seems likely
that's sed-implementation specific, so now it runs through docker's sed
to support portability.
2020-11-27 20:32:51 -08:00
Bartek thindil Jasicki 09b8cc97de Merge remote-tracking branch 'upstream/master' 2020-11-27 13:38:24 +01:00
Horacio Sanson 1365dce921
Merge pull request #3461 from lyz-code/feat/add-yamlfixer
feat: add yamlfix fixer
2020-11-27 16:02:33 +09:00
fwy 0a2ad516d4 Fix regexp pattern to work correctly in nvim and vim on windows and linux 2020-11-26 15:29:23 -06:00
Lyz 12eb8d1523
fix: correct suggested filetype for yamlfix 2020-11-26 12:42:50 +01:00
Ivor Peles ce3d891bed Use better string comparison operators in isort fixer 2020-11-25 17:57:40 -05:00
Ivor Peles 713e53e3f6 Ensure isort / pipenv test conforms to ALE coding standards 2020-11-25 17:51:27 -05:00
Ivor Peles 340e966055 Fix comparison operator 2020-11-25 17:34:03 -05:00
Lyz c69d696e1b
feat: add yamlfix fixer 2020-11-25 01:21:53 +01:00
Gonzalo Quero 7e9d4fbfc8 refactor: Move test to the right file 2020-11-23 10:21:09 +00:00
Gonzalo Quero 491ceacb64 fix: Use proper CdPath function in test 2020-11-23 10:08:00 +00:00
Gonzalo Quero 05d5cc4988 chore: Document config_file variable 2020-11-23 10:08:00 +00:00
Gonzalo Quero 7d8275daf5 chore: Add Elixir Credo tests 2020-11-23 10:08:00 +00:00
Gonzalo Quero 433b23be17 feat: Add optional configuration file for Credo 2020-11-23 10:08:00 +00:00
Ivor Peles d27a3f453c Ignore executable check when executable is pipenv 2020-11-21 19:24:20 -05:00
Ivor Peles 6efca486e8 Add test for isort with auto_pipenv flag(s) 2020-11-21 19:24:20 -05:00
Ivor Peles ae86d10e48 Set default value for python_isort_auto_pipenv 2020-11-21 19:24:20 -05:00
Ivor Peles 64471e6ea8 Document ale_python_isort_auto_pipenv option 2020-11-21 19:24:19 -05:00
Ivor Peles 373ffa0f31 Use pipenv isort executable when python_auto_pipenv = 1 2020-11-21 19:24:19 -05:00
w0rp 681a6e371d
Use _config for LSP config options 2020-11-21 20:58:34 +00:00
Eric Zhao 9692c0c64c
Add support for R languageserver (#3370) 2020-11-21 20:56:38 +00:00
Horacio Sanson 5458a1b291
Fix 3103 - add shellcheck shell directive detection. (#3216)
* Fix 3103 - add shellcheck shell directive detection.

Searches for shellcheck shell directive to detect dialects for scripts
that do not have shebang.

* Change order of detection of shellcheck dialect

In a situation where the filetype can be wrong (example: something.sh
which is written in bash dialect) and has no hash-bang (since it is
meant to be sourced) then the override specified within the script will
be ignored.

It probably is the most right thing to do if the script author has added
a specific directive; it should trump everything else.

Co-authored-by: Horacio Sanson <horacio@allm.inc>
Co-authored-by: Dino Korah <dino.korah@redmatter.com>
2020-11-21 20:49:31 +00:00
w0rp b4550f361b
Merge pull request #3409 from lyz-code/feat/add-autoimport-support
feat: add autoimport fixer
2020-11-21 20:45:51 +00:00
Gabriel Petrovay b09ccc12c3
Added the Vundle command in installation instructions (#3400) 2020-11-21 20:32:58 +00:00
Jose Soto e1184e31f6
Adds support for Tlint - A Tighten Opinionated PHP Linter (#3291)
Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2020-11-21 20:29:33 +00:00
w0rp 96428425fe
Merge pull request #2903 from davidtwco/ormolu-fixer
Add ormolu fixer.
2020-11-21 20:25:13 +00:00
Dale Jung 2873be2d6a
Add php phpcbf options (#3383)
* Taken from phpcs. add add_php_phpcbf_options #3382
* Updated docs for php_phpcbf_options #3382
* Added tests #3382
2020-11-21 20:19:02 +00:00
w0rp d1246ea8d5
Merge pull request #3380 from rgossiaux/patch-1
Fix typo in ale-python.txt
2020-11-21 20:17:35 +00:00
w0rp 2e91f0e689
Use has('gui_running') instead of has('gui') 2020-11-21 20:16:32 +00:00
w0rp a139599d39
Close #2727 - Add a hover-only setting for balloons 2020-11-21 20:12:09 +00:00
w0rp 06e7f2195e
Fix #3332 - Modify everything for rename/actions
ALE now just modifies every open buffer for rename and actions, and sets
up a one-time use BufEnter event to reload buffers that are changed so
you don't have to think about what to do with changed buffers.
2020-11-21 19:00:53 +00:00
w0rp b8aaff2cf7
Merge pull request #3358 from lukaswozniak/master
Improves fixer performance for large buffers
2020-11-21 16:40:29 +00:00
w0rp 342e5af4e3
Add a missing blank line in documentation 2020-11-21 16:20:02 +00:00
w0rp e4bfcb44b3
Merge pull request #3357 from creativenull/feat-php-intelephense
feat: add intelephense support for php
2020-11-21 16:18:20 +00:00
w0rp edd96f4414
Merge pull request #3354 from rphln/collapse-whitespaces
Collapse spaces and lines in the completion menu.
2020-11-21 16:16:08 +00:00
w0rp d23c9125c5
Merge pull request #3352 from arthrarnld/patch-1
Fix wording in Rust doc
2020-11-21 16:13:24 +00:00
w0rp c10e807492
Fix handling of ranges at file end. (#3344) 2020-11-21 16:03:39 +00:00
zandr e5d16caebe
Add luafmt fixer (#3289) 2020-11-21 15:59:50 +00:00
w0rp 8e28de142a
Merge pull request #3292 from dmitrivereshchagin/add-elvis-handler-for-erlang
Add Elvis handler for Erlang
2020-11-21 15:56:50 +00:00
w0rp df3163223f
Merge pull request #3282 from zanona/master
fix(ale_linters/phpcs): add support for multiline error messages
2020-11-21 15:36:22 +00:00
w0rp 9f2215d69b
Merge pull request #3435 from myobie/yarn-berry
For linters/tserver and handlers/eslint: look for node packages in .yarn/sdks as well
2020-11-21 15:33:55 +00:00
Dalius Dobravolskas 81d16823a7
Settings to control suggestions. 2020-11-21 15:49:42 +02:00
Dalius Dobravolskas 17c0c3c731
Test fix. 2020-11-21 15:49:42 +02:00
Dalius Dobravolskas c098a07d67
Tests added. 2020-11-21 15:49:41 +02:00
Dalius Dobravolskas 2ab46d4b8e
Show tsserver hints/suggestions in Ale. 2020-11-21 15:49:41 +02:00
Dalius Dobravolskas d0b5909fd8
#3442 Fix code fix clangd issue 2020-11-21 01:27:27 +00:00
w0rp 7c04ee5c20
Close #1466 - Add GVIM refactor menu support
Code actions and ALERename now appear in the right click context menu
for GVim by default.
2020-11-21 01:18:27 +00:00
Bartek thindil Jasicki f156548c16 Merge remote-tracking branch 'upstream/master' 2020-11-20 10:11:02 +01:00
Ben Linsay ddfc43e774 pass lsp intialization_options to rust-analyzer
fixes #3350
2020-11-18 22:22:16 -05:00
Nathan Herald b74827de99
Look for node packages in .yarn/sdks as well 2020-11-17 17:12:04 +01:00
w0rp 48fe0dd4f6
Update documentation for code actions and rename 2020-11-14 10:41:51 +00:00
w0rp e9140c740b
cmp forwards, and reverse the code actions 2020-11-14 10:17:02 +00:00
Dalius Dobravolskas 01800a23ad
Support for LSP/tsserver Code Actions (#3437)
* Added tsserver and LSP code action support.
* tsserver refactors support added.
* Handling special case when new text is added after new line symbol.
* ale#code_action#ApplyChanges simplified.
* Initial attempt on LSP Code Actions.
* workspace/executeCommand added.
* Some null checks added.
* Add last column to LSP Code Action message.
* Pass diagnostics to LSP code action.

Previously ApplyChanges code was applied from top-to-bottom that required 
extra parameters to track progress and there was bug. I have changed code
to bottom-to-top approach as that does not require those extra parameters
and solved the bug.

Tested with typescript-language-server and it is working.
2020-11-14 10:15:17 +00:00
toastal 42e4b14861
Merge branch 'master' of github.com:dense-analysis/ale into dhall 2020-11-14 15:03:26 +07:00
Bartek thindil Jasicki 01b661ea25 Merge remote-tracking branch 'upstream/master' 2020-11-06 13:31:59 +01:00
Horacio Sanson 1ec573bf0d
Merge pull request #3427 from lifecrisis/sh-buffer-vars
Check for Vim's shell type buffer variables before falling back to the file type
2020-11-05 08:37:15 +09:00
Manoel Brunnen 96d8415946 Add -imacros to C flags 2020-11-03 23:10:15 +01:00
Jason Franklin 31b7a2de41
Move the test for buffer-local variables
The "ale#handlers#sh#GetShellType()" function currently falls back
to the file type without checking for buffer-local variables first.
This causes the function to return "sh" even when a script is known
by Vim to be a script of a more specific type (e.g., "bash").

The "ale#handlers#shellcheck#GetDialectArgument()" function then
erroneously uses this type even though a more fitting type should be
used instead.  Files without a "#!" line will be of type "sh" even
though they may have a ".bash" suffix.

This commit fixes the problem by checking for buffer-local shell
type variables (set by Vim) before falling back to the file type.
2020-11-02 10:59:16 -05:00
Jason Franklin 73632312c2
Use the proper term for the "#!" line 2020-11-02 10:46:56 -05:00
Jason Franklin 6c22936303
Remove a noise comment 2020-11-02 10:46:28 -05:00
pinicarus db96b00720
Merge branch 'custom-erlc-executable' 2020-11-01 11:45:36 +01:00
cyy a49f664aea chang fishindent to fish_indent 2020-10-31 14:01:08 +08:00
cyy 194660660d update url 2020-10-31 14:01:08 +08:00
cyy 9d1a71a5cb add doc and test 2020-10-31 14:01:08 +08:00
cyy 983c7e8805 add fish_indent fixer 2020-10-31 14:01:08 +08:00
pinicarus 62f2c6d326
test(erlang/erlc): simplify matches 2020-10-28 12:58:15 +01:00
pinicarus 7d69cdf4ad
test(erlang/erlc): make quotes optional in matches 2020-10-28 12:51:38 +01:00
pinicarus 15f44933c2
feat(erlang/erlc): add option for custom executable 2020-10-28 12:38:28 +01:00
Lyz 513e6ee972
feat: add autoimport fixer 2020-10-23 18:53:38 +02:00
David Wood b496c4b164
Add ormolu fixer.
This commit adds a fixer for the Haskell language, ormolu
(https://github.com/tweag/ormolu).

Signed-off-by: David Wood <david@davidtw.co>
2020-10-23 11:48:21 +01:00
Will Leinweber cafe8621e2 Add Ruby sorbet option to enable watchman 2020-10-20 23:13:53 -07:00
StephenWithPH af5a8e1abf
add sbt as a suggested filetype for scalafmt fixer 2020-10-19 09:47:54 -07:00
Bartek thindil Jasicki b84d41f9ea Merge remote-tracking branch 'upstream/master' 2020-10-16 17:51:08 +02:00
w0rp 557a1ed5da
Make the two nearly identical Swift tools easier to distinguish 2020-10-15 22:02:27 +01:00
w0rp 477eb89793
#3332 Implement :ALERename! for ignoring errors
:ALERename! now ignores errors for files that cannot be modified, and
modifies all other files.
2020-10-15 21:56:21 +01:00
w0rp f384d61c3d
Fix sorting of supported tools 2020-10-15 21:24:27 +01:00
ecly f125c11faa Update FindProjectRootIni with poetry.lock and pyproject.toml 2020-10-15 13:35:47 +02:00
Bartek thindil Jasicki c4eb41f091 Merge remote-tracking branch 'upstream/master' 2020-10-09 12:54:48 +02:00
D. Ben Knoble 160af49450 update tests 2020-10-08 12:02:30 -04:00
D. Ben Knoble 47da7483d8 Merge remote-tracking branch 'origin/master' into fix-swipl
* origin/master:
  Add tests for maven.vim file
  Fix grammatical error in doc
  Add maven helper file; use maven wrapper if available instead of global 'mvn' executable
  fix lint, fix variable semantics and update tests
  bibclean: update matchlist reges for bibclean > v2.11.4
  Update rubocop_auto_correct_all tag
2020-10-08 11:55:39 -04:00
D. Ben Knoble c37cc1c8a3 dafny: include correct filename in lint results
Results can come from included files, not just the current buffer.
2020-10-08 11:54:56 -04:00
Andrey Popp 96ec33e6d6 Use stdin/stdout to communicate with gofmt 2020-10-03 18:44:19 +03:00
pinicarus d7557ef9be
refactor(erlang/dialyzer): simplify option handling 2020-10-03 10:16:04 +02:00
rgossiaux 9a8ab764d5
Fix typo in ale-python.txt 2020-10-02 22:51:54 -04:00
Horacio Sanson b91c6c2edd
Merge pull request #3374 from fenuks/maven_helper
Use maven wrapper if available
2020-10-02 20:07:28 +09:00
fenuks 4466c47990 Add tests for maven.vim file 2020-10-02 10:03:14 +02:00
Bartek thindil Jasicki bd1b671e82 Merge remote-tracking branch 'upstream/master' 2020-10-02 09:36:32 +02:00
pinicarus ef145bda1c
docs(erlang/dialyzer): change wording a bit 2020-10-01 19:20:31 +02:00
D. Ben Knoble 3410c1b1e2 prolog/swipl: add blank line after call
Though I do not see this specified or followed anywhere else
2020-10-01 13:18:34 -04:00
D. Ben Knoble 81b92bcbfa prolog/swipl: add test for new format 2020-10-01 13:12:43 -04:00
D. Ben Knoble e32d5fc03d prolog/swipl: address linter feedback
This actually caught a bug where I forgot to rename the function
2020-10-01 13:12:18 -04:00
D. Ben Knoble abe1440268 prolog/swipl: update error format for new version
A recent(?) update to swipl changed the error format from

  Warning: some.pl:2:
              Singleton variables: [Y]

to

  Warning: some.pl:2:
  Warning:    Singleton variables: [Y]

The old error handler doesn't report the correct line numbers and
messages on the old format.

I've chosen to add a function that covers the second case and detect it,
rather than rewrite the current function. This way, both versions should
be able to live together.

---

Example file that demonstrates the issue (some.pl above):
```
% vim: ft=prolog
ii(X, Y) :- X.
```

---
2020-10-01 12:49:53 -04:00
Horacio Sanson 2d3ed956b9
Merge pull request #3375 from isaif/fix-doc
Fix grammatical error in doc
2020-10-01 20:44:35 +09:00
isaif 7857098cb0 Fix grammatical error in doc 2020-10-01 16:23:49 +05:30
pinicarus ac3c0c093a
feat(erlang/dialyzer): add custom options passing 2020-09-30 23:16:50 +02:00
fenuks 7186b0437f Add maven helper file; use maven wrapper if available instead of global 'mvn' executable 2020-09-30 00:11:57 +02:00
Horacio Sanson 96dcbd1f20
Merge pull request #3367 from bratekarate/update-bibclean
bibclean: update matchlist reges for bibclean > v2.11.4
2020-09-28 10:53:19 +09:00
bratekarate 56242cb874
fix lint, fix variable semantics and update tests 2020-09-26 17:09:54 +02:00
Horacio Sanson 94927195ee
Merge pull request #3284 from resong/bug/duplicateTag
Update ale_ruby_rubocop_auto_correct_all tag
2020-09-26 14:50:36 +09:00
bratekarate 5f2aeba8cc
bibclean: update matchlist reges for bibclean > v2.11.4 2020-09-26 03:21:26 +02:00
Marcus Zanona e089969404
fix(ale_linters/phpcs): add support for multiline error messages 2020-09-25 11:25:24 +02:00
toastal 48cbf1cb36
dhall alias 2020-09-25 08:26:17 +07:00
Łukasz Woźniak 6bebdcfa30 Improves fixer performance for large buffers 2020-09-18 12:59:27 +02:00
Arnold Chand f8351c1b22 fix: test: mkdir should create if it doesn't exist 2020-09-17 09:58:45 -04:00
Arnold Chand 8a855e3e64 fix: tests 2020-09-17 09:35:06 -04:00
Arnold Chand fec6b63494 feat: add intelephense support for php 2020-09-17 08:06:11 -04:00
Raphael Nepomuceno 9769565f88 Collapse spaces and lines in the completion menu. 2020-09-14 12:11:16 -03:00
Arthur Arnold 63a528eac2
Fix wording in Rust doc 2020-09-14 07:57:22 -03:00
toastal ed47008710
addressing missing docs + cleaning up older Dhall files 2020-09-14 10:13:11 +07:00
toastal b32954a46c
Merge branch 'master' into dhall 2020-09-14 08:54:07 +07:00
Bartek thindil Jasicki 1781b1eab0 Merge remote-tracking branch 'upstream/master' 2020-09-11 10:38:36 +02:00
w0rp 08295ce174
Bump the ALE version to 3.0.0 2020-09-09 22:06:38 +01:00
w0rp 4ddf742643
Close #2522 - Check pylint on the fly
Newer versions of pylint will now check your code as you type. Older
versions will still only check the file on disk.

Co-authored-by: Oliver Wiegers <oliver.wiegers@gmail.com>
2020-09-09 21:45:15 +01:00
w0rp 78fa93bd55
Add tests for covering the coming Vint version 2020-09-09 20:34:27 +01:00
w0rp 62fd83f1dd
Merge pull request #3108 from timbedard/vint-add-stdin
Add stdin option for supported vint versions
2020-09-09 20:15:54 +01:00
Christian Keil d1f48e5ede Remove unnecessary length check. 2020-09-09 17:49:21 +02:00
Christian Keil d3932c0242 Fix format linting error. 2020-09-09 17:44:09 +02:00
Christian Keil 20f6bebdf2 Fix handling of ranges at file end. 2020-09-09 17:30:41 +02:00
w0rp 6a367e44aa
Close #3003 - Show ignored linters in :ALEInfo 2020-09-08 22:19:13 +01:00
w0rp 7d90ff56d9
Close #3333 - Add an ALECompletePost event
Add an `ALECompletePost` event along with everything needed to make it
useful for its primary purpose: fixing code after inserting completions.

* `ALEFix` can now be called with a bang (`!`) to suppress errors.
* A new `ALELintStop` command lets you stop linting, and start it later.
2020-09-08 21:40:10 +01:00
toastal f07ecbc579
merge master -- apparently someone else added dhall? 2020-09-08 10:08:00 +07:00
w0rp b4b75126f9
Fix a completion error 2020-09-07 10:01:18 +01:00
Horacio Sanson fc2a34e9d8
Merge pull request #3337 from sodapopcan/patch-1
Fix typo
2020-09-07 16:30:42 +09:00
Horacio Sanson 8950f6b812
Merge pull request #3334 from remi6397/bugfix/asciidoc-languagetool-typo
Fix asciidoc languagetool integration
2020-09-07 15:37:04 +09:00
Andrew Haust 417761b415
Fix typo 2020-09-07 02:24:39 -04:00
w0rp c36053d4cc
Close #3268 - Implement :ALEImport
A new command, `:ALEImport`, has been added, which lets you import words
at your cursor if a completion provider can provide a completion for
that word which includes some additional text changes.
2020-09-06 22:37:37 +01:00
Dmitri Vereshchagin 49718e0ec6 Add Elvis handler for Erlang
[Elvis][1] is an Erlang style reviewer.

[1]: https://github.com/inaka/elvis
2020-09-06 12:40:28 +03:00
w0rp 5bc49d2047
Fix #3183 - Escape filename characters from LSP/tsserver 2020-09-05 21:46:39 +01:00
w0rp 152b2cb691
Clean up embertemplatelint code
Alias ember-template-lint to embertemplatelint so users can use either
string to enable the linter.
2020-09-05 19:06:07 +01:00
Jeremiasz Nelz 0b55098bd0 Fix asciidoc languagetool integration 2020-09-04 22:52:29 +02:00
Bartek thindil Jasicki c78be86103 Merge remote-tracking branch 'upstream/master' 2020-09-04 13:46:11 +02:00
w0rp 844febb9fb
Fix #3322 - Apply rename changes correctly 2020-09-04 09:37:33 +01:00
Cyrille David d4a14746cd
feat(template-lint): Read from stdin (#2622)
* ember-template-lint: Lint from stdin
  * This feature has recently been implemented in ember-template-lint.
* Refactor ember-template-lint executable
* Fallback on a temporary file for old template-lint

Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2020-08-31 09:26:33 +01:00
w0rp ac2100d410
Fix flake8 cd logic for invalid options 2020-08-31 09:12:36 +01:00
w0rp cdaeca452e
Add tests for \r removal 2020-08-31 09:01:44 +01:00
w0rp 31942c99b9
Merge pull request #2858 from kalekseev/patch-flake8
Provide configuration option to run flake8 from project root.
2020-08-31 09:01:16 +01:00
w0rp 4a91f92f28
Merge pull request #3078 from jgehrig/jg-issue2958
Issue 2958: Addtional ^M characters on Windows
2020-08-31 08:31:44 +01:00
Konstantin Alekseev 1462de6685 Run flake8 from project root by default.
Option `per-file-ignores` was introduced in flake8 version 3.7.0.
It allows to ignore specific errors in specific files using glob syntax.
For example `per-file-ignores = src/generated/*.py:F401` will
ignore `F401` error in all python files in `src/generated`.
Thus ale has to run flake8 from project root where .flake8 config
is placed otherwise glob won't match linted file.
2020-08-30 22:56:10 +03:00
w0rp 0989da4a38
Merge pull request #3194 from maxwell-k/vint
vim/vint: show policy name
2020-08-29 20:54:09 +01:00
w0rp 33202a39f5
#2107 - Recommend <C-c> instead, which avoids autocmd functions 2020-08-29 20:45:45 +01:00
w0rp 303bed6ec1
#2107 - Document completion fallbacks and insert-completion trick 2020-08-29 20:40:50 +01:00
w0rp 25b572b3bf
Close #3205 - Avoid inserting completions by default 2020-08-29 17:36:25 +01:00
w0rp 6e2e51b154
Fix #2971 - Disable automatic completion while 'paste' is active 2020-08-29 17:27:53 +01:00
w0rp 6888ca46a7
Fix retrying on some test failures 2020-08-29 16:32:17 +01:00
w0rp f1ecc2e068
Fix psalm options. Retry on some test failures 2020-08-29 16:31:47 +01:00
w0rp 7e0cdb53ec
Fix #3247 - Use --always-make for make -n by default 2020-08-29 16:05:49 +01:00
w0rp bc3a843e10
Add a missing `augroup END` line 2020-08-29 14:23:58 +01:00
w0rp 6b138b965d
Merge pull request #3327 from Kimplul/master
Improved macro handling in gcc
2020-08-29 13:57:16 +01:00
Kimplul d9a7d6bc23 Improved macro handling in gcc 2020-08-29 15:17:20 +03:00
w0rp 06264c264f
typo 2020-08-29 12:35:40 +01:00
w0rp dd9ad9b5be
#3319 - Try to modify buffers later for ALEFix 2020-08-29 12:33:17 +01:00
Bartek thindil Jasicki 0de847a8e1 Merge remote-tracking branch 'upstream/master' 2020-08-29 10:42:25 +02:00
w0rp 7d4ce4e6aa
Close #3325 - Apply new formatting where possible 2020-08-28 19:50:36 +01:00
w0rp 3d5a2690ce
#3325 - ale#path#BufferCdString now generates %s:h 2020-08-28 17:46:43 +01:00
w0rp 34e409ea21
Close #3285 - lint_file is now dynamic
`lint_file` can now be computed dynamically with a callback function,
which can return a deferred result, as per `ale#command#Run`. This
allows linters to dynamically switch between checking files on disk,
or checking code on the fly.

Some tests have been fixed on Windows.
2020-08-28 14:02:05 +01:00
w0rp b8c0ac2e61
Close #3309 - Add b:ale_lint_delay 2020-08-28 09:54:43 +01:00
w0rp 6874120405
Fix #3323 - Set default for g:ale_filename_mappings 2020-08-28 09:33:09 +01:00
w0rp 36e959a466
Add sql-lint to supported tools 2020-08-28 09:25:40 +01:00
w0rp 47fdc02fc7
Merge pull request #2988 from joereynolds/master
Add sql-lint as linter
2020-08-28 08:43:10 +01:00
w0rp 369e3876f0
#3324 - Enable rls by default 2020-08-28 08:23:10 +01:00
Sorin Iclanzan 80bd2e18d6
Set prettier working directory to where .prettierignore is (#3101)
Prettier does not use `.prettierignore` unless the current directory is the root where the `.prettierignore` file resides.

* Update Prettier tests
* Look for prettierignore to determine project root
2020-08-28 08:14:50 +01:00
w0rp ecd7abecc0
Fix #3319 - Force modifications to buffers 2020-08-27 21:29:13 +01:00
w0rp 7545b18ba1
Fix #3318 - Escape macros when parsing C flags 2020-08-27 21:17:24 +01:00
w0rp 6d843715f3
Fix C flag parsing and tests on Windows 2020-08-27 20:18:13 +01:00
w0rp 6074720dc2
Mention --fast, and document running Windows tests locally 2020-08-27 19:39:16 +01:00
w0rp af177d7825
#3318 Refactor C flag parsing to set up for quoting arguments 2020-08-27 19:33:43 +01:00
w0rp 719f3c62b0
#3266 - Catch echo visual selection errors 2020-08-27 13:57:20 +01:00
w0rp 5d3d33626c
Merge pull request #3310 from pbrisbin/master
Add dhall-format as a Fixer
2020-08-27 13:39:30 +01:00
w0rp 571cff932d
Label the test cases more clearly 2020-08-27 13:15:04 +01:00
w0rp 17605777d6
Fix #3317 - Parse -include from C flags 2020-08-27 13:05:50 +01:00
w0rp 66ff00c420
Fix #3316 - Repeat -relative for ALERepeatSelection 2020-08-27 12:41:07 +01:00
w0rp f5aa0e8457
Fix #3307 - Handle compile_commands paths better
ALE now converts paths from compile_commands.json files into absolute
paths and prefers matching against absolute file and directory names for
determining which flags to use for files. As a result, parsing
compile_commands.json to determine flags should work for a lot more C
and C++ projects.
2020-08-27 11:44:35 +01:00
w0rp 686f42a2e1
Fix a typo 2020-08-27 09:18:10 +01:00
w0rp c9377e9baf
#3314 - Tell people how to make new plug mappings 2020-08-27 09:17:14 +01:00
w0rp a955f5dfa8
#3312 - Just check if additionalTextEdits is non-empty 2020-08-27 08:57:12 +01:00
w0rp 396fba7cca
Fix #3312 - Fix a false positive for auto imports
ALE was incorrectly detecting completion results from servers such as
rust-analyzer as wanting to add import lines when additionalTextEdits
was present, but empty.

Now ALE only filters out completion results if the autoimport setting is
off, and one of the additionalTextEdits starts on some line other than
the current line. If any additionalTextEdits happen to be identical to
the change from completion anyway, ALE will skip them.
2020-08-27 08:44:43 +01:00
patrick brisbin 447aea4af0
Add dhall-format as a Fixer
https://github.com/dhall-lang/dhall-lang
2020-08-25 09:34:34 -04:00
w0rp 3e2abe3f25
#2556 - Support modifiers for formatted filenames 2020-08-24 09:33:07 +01:00
Horacio Sanson 1a7366067a
Merge pull request #3302 from khaveesh/master
latexindent: Run fixer from stdin instead of a temporary file
2020-08-24 09:16:35 +09:00
w0rp 33eb03ea71
Yes, try again to fix Windows tests 2020-08-23 20:19:22 +01:00
w0rp d4583f1a63
Try to fix Windows tests again 2020-08-23 20:14:08 +01:00
w0rp c0566db1d2
Try to fix Windows tests 2020-08-23 20:05:09 +01:00
w0rp ba3dd0d027
Close #2556 - Support filename mapping
ALE now supports mapping files between different systems for running
linters and fixers with Docker, in virtual machines, in servers, etc.
2020-08-23 19:55:42 +01:00
Khaveesh N 76801743cf
Fixed tests 2020-08-21 17:29:43 +05:30
Khaveesh N 4bece27bd4
refactor(Fixer): Change latexindent to read from stdin instead of temporary file
This is a better strategy as it avoids creating temporary files and the delay that follows
2020-08-21 17:19:22 +05:30
Bartek thindil Jasicki 62f07d820c Merge remote-tracking branch 'upstream/master' 2020-08-21 10:39:39 +02:00
w0rp 2b785688ea
#3299 Merge gcc and clang into a cc linter
Users can easily be confused when they set some options for a C or C++
compiler, and another compiler is run with different options, which
still reports errors. To remedy this, the existing `gcc` and `clang`
linters have been replaced with a `cc` linter that will run either
compiler.

This is a breaking change for ALE v3.0.0.
2020-08-20 01:49:14 +01:00
awang 4d42ebc160
Keep -iframework if present in parsed C/C++ flags (#3057)
* Keep -iframework if present in parsed C/C++ flags
* Add test to make sure -iframework is parsed

Co-authored-by: Alex Wang <ts826848@gmail.com>
2020-08-20 00:09:02 +01:00
w0rp 90abb7e7ef
Try to fix Windows tests again 2020-08-19 01:22:43 +01:00
w0rp de7b0567b1
Try to fix tests on Windows 2020-08-19 01:10:33 +01:00
w0rp 361027eac6
Fix #3200 - Do not use -fstack-usage from parsed flags 2020-08-19 01:04:08 +01:00
w0rp 794224aafa
#3056 Add tests for parsed C/C++ -std flag handling 2020-08-19 00:47:39 +01:00
w0rp 92cada9913
Merge pull request #3056 from ts826848/remove-ale-std-if-already-in-GetCFlags
[WIP] Avoid overriding parsed C/C++ -std=* flag
2020-08-19 00:21:22 +01:00
w0rp e27d4377b5
Merge pull request #3178 from sudobash1/expand_at
Fixes #3092 - Implement loading `@file` c arguments
2020-08-19 00:15:34 +01:00
w0rp f8b3a43aab
Merge pull request #3229 from hsanson/3220-enable-languagetool-for-asciidoc
Enable languagetool for asciidoctor files.
2020-08-18 23:22:01 +01:00
w0rp 5eda1df0a9
Remove features deprecated in previous versions 2020-08-18 23:03:43 +01:00
w0rp 4df352eee5
Fix #3294 - Fix hover off by 1, handle LSP server crashes 2020-08-18 01:48:07 +01:00
w0rp bc6304bdb0
Merge pull request #3007 from klaaspieter/swift-format
Add Apple's swift-format as a linter
2020-08-17 23:37:23 +01:00
w0rp ac56574b55
Merge pull request #3046 from hsanson/2816-fix-standard-fix-doesnt-work
Fix 2816 - Standard fix does not work.
2020-08-17 21:44:19 +01:00
w0rp 6d33417b15
Merge pull request #2759 from kgrzywacz/master
credo now recognizes umbrella projects
2020-08-17 21:34:10 +01:00
w0rp eb864730e2
Merge pull request #2906 from elebow/shelldetect-fall-back-to-filetype-if-no-hashbang
ShellDetect falls back to filetype if no hashbang (fixes #2886)
2020-08-17 21:29:16 +01:00
w0rp 514e5a8baa
Merge pull request #2940 from davidsierradz/add-markdownlint-options
allow passing custom options to markdownlint
2020-08-17 10:21:36 +01:00
w0rp cfda549056
Tell stale bot to wait longer before closing PRs 2020-08-17 10:20:41 +01:00
blyoa d5c1d84230
Add remark-lint for a markdown fixer (#2836) 2020-08-17 10:14:38 +01:00
w0rp 5c778e1ae7
Make it easier to run tests locally
Certain tests could break if you ran them separately from other tests.
They have been patched.

`run-tests` now has a `--fast` option which runs tests with only the
fastest Vim version ALE tests with, and the custom checks.
2020-08-16 21:20:08 +01:00
Bartek thindil Jasicki 04bd84e914 Merge remote-tracking branch 'upstream/master' 2020-08-14 19:38:09 +02:00
Horacio Sanson 5ceda0164c
Merge pull request #3288 from nibocn/master
fix(eclipselsp): Get jar file path failed
2020-08-14 13:49:09 +09:00
w0rp 5a4fad6172
Fix #2899 - Handle tsserver default import completion 2020-08-14 01:55:54 +01:00
w0rp 2b2403a20d
Merge pull request #3144 from jamescdavis/dont_append_newline_when_noeol
don't append a newline to temp file when buffer is noeol and nofixeol is set
2020-08-14 00:32:28 +01:00
w0rp 8151e3e8fa
Merge pull request #2920 from ConradIrwin/prettier-standard-stdin
Fix prettier_standard to respect the configuration file
2020-08-14 00:27:41 +01:00
w0rp 94a968ef39
Merge pull request #2924 from patrick96/vlog-filename
verilog: Add filename to vlog linter output
2020-08-14 00:20:57 +01:00
toastal 167e2e7750
tests 2020-08-14 00:31:49 +07:00
toastal f1080a2bbe
Dhall language support (fixes #2820) 2020-08-14 00:31:47 +07:00
w0rp ed69b074ba
Merge pull request #3164 from mathstuf/cargo-separate-target-dir
rust/cargo: add support for a custom target directory
2020-08-13 16:29:19 +01:00
NiBo a4f70163eb fix(eclipselsp): Get jar file path failed
Error: Unable to access jarfile
2020-08-13 23:12:12 +08:00
Ben Boeckel 506a8532d0 rust/cargo: add support for a custom target directory
This can avoid having to wait for ALE or ALE being blocked on other
cargo actions within the same crate.
2020-08-13 10:22:33 -04:00
w0rp 0b77766337
Merge pull request #3010 from kevinoid/ps1-powershell
Alias ps1 filetype to powershell
2020-08-13 13:45:49 +01:00
w0rp 979062235a
Fix #3286 - Fix duplicate tags 2020-08-13 13:44:22 +01:00
Horacio Sanson 8e6c7bff9a
Fix 1695 - Change rubocop fixer to use stdin (#3230)
* Fix 1695 - Change rubocop fixer to use stdin
* Update test_rubocop_fixer_callback.vader

Co-authored-by: Horacio Sanson <horacio@allm.inc>
Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2020-08-13 11:25:07 +01:00
w0rp 34adb997c6
Configure the stale bot 2020-08-13 02:37:54 +01:00
w0rp 64d4c951ae
Fix #3281 - Stop CursorHold flickering 2020-08-13 02:22:21 +01:00
Rebecca Song 80b93a3606 Update rubocop_auto_correct_all tag 2020-08-12 20:04:51 -04:00
w0rp 7c4b1d8444
Close #3274 - Handle basic LSP markdown formatting 2020-08-12 22:11:45 +01:00
Nihad Abbasov d5912b53dd
Restore old behavior of ALEFix command for Rubocop (#3237)
* Restore old behavior of ALEFix command for Rubocop

Since RuboCop 0.60 ALEFix command stopped to fix all found offenses. This change restores the 
previous behavior by allowing rubocop to fix all detected offenses.

* Fix tests
* Allow to configure auto-correct option for Rubocop
2020-08-12 14:04:54 +01:00
w0rp d3f410b6f7
Fix #1608 - Treat .h as C++ files for C++ clang-tidy 2020-08-10 02:33:50 +01:00
w0rp 2237f9b462
#2919 Use compile_commands.json for headers 2020-08-10 02:14:23 +01:00
w0rp 05210846e4
Fix #3278 - Handle UTF-8 in URI encoding/decoding 2020-08-10 02:03:41 +01:00
w0rp bf3c3e9438
#3276 - Update README for make -n changes 2020-08-09 20:13:21 +01:00
w0rp 9e1f511003
#3276 - Disable make -n by default again 2020-08-09 20:08:42 +01:00
w0rp affeed7a87
Enable C flag parsing by default
The options for parsing `make -n` and `compile_commands.json` flags
are now enabled by default, so people can start getting better flags
for their files by default.

`compile_commands.json` flags are now preferred over `make -n` results,
to make the options work better by default.
2020-08-09 04:23:32 +01:00
w0rp 681ca5fee8
Explain how to use ALE and coc.nvim together 2020-08-09 03:18:21 +01:00
w0rp 2ed09f51b6
Move :ALEInfo higher up in the FAQ 2020-08-09 02:50:25 +01:00
w0rp 6d502233d8
Close #3267 - Add a general autoimport setting 2020-08-09 02:32:47 +01:00
w0rp 8bfb5c6407
Merge pull request #2849 from DonnieWest/excludeTsserverWarnings
Allow the user to remove warnings from completions
2020-08-09 01:32:27 +01:00
w0rp 2d174db5b2
Merge pull request #3107 from daliusd/tslintfix
Fix tslint fixer not working issue (temporary file not found)
2020-08-07 19:52:18 +01:00
Bartek thindil Jasicki 973c4ea053 Merge remote-tracking branch 'upstream/master' 2020-08-07 17:43:11 +02:00
w0rp f741245f11
Fix #3273 - Handle missing keys in hover information 2020-08-07 12:34:45 +01:00
w0rp 388049dbea
Try to fix gopls tests again 2020-08-07 12:30:50 +01:00
w0rp 96d525a287
Try to fix gopls tests 2020-08-07 12:27:26 +01:00
w0rp b9a1c0e6d3
Fix order of supported-tools for pyright 2020-08-07 12:24:59 +01:00
w0rp 97d887ae22
It's the Current Year 2020-08-07 12:22:25 +01:00
w0rp 7cefc80f1b
Fix a failing test 2020-08-07 12:21:22 +01:00
w0rp 19229e8e27
Close #2472 - Add support for pyright 2020-08-07 12:16:13 +01:00
w0rp 9bdabce8df
Fix #2907 - Handle dictionaries for capabilities 2020-08-07 10:54:38 +01:00
w0rp 667618b399
Merge pull request #3191 from mostfunkyduck/master
Fixes govet linter for go 1.13+, with tests
2020-08-07 08:54:17 +01:00
tsjordan-eng f17b74679f
fix cppcheck for 1.89+, and add column support (#3030)
* fix cppcheck for 1.89+, and add column support

In cppcheck 1.89 the output changed to be more like GCC. This commit
forces any version of cppcheck to output in that same format. This also
allows for ALE to pick up the linter's column information

* Add parameters to tests. Vader passes.

* Fix c cppcheck for v1.89
2020-08-06 20:50:44 +01:00
w0rp 4044196047
#2804 Add hdl-checker to supported tools 2020-08-06 13:24:20 +01:00
Andre Souto 5b3da60cea
Adds hdl_checker LSP support (#2804)
* Added hdl_checker support
* Added hdl_checker tests

HDL Checker searches for files when no config file is found, which could lead to very long searches when the user is not really on a project setting
2020-08-06 13:20:54 +01:00
w0rp 711c90c523
Merge pull request #3123 from liskin/ccls-build-dir
ccls: Detect build dir and set compilationDatabaseDirectory
2020-08-06 13:12:56 +01:00
w0rp cdd8d38e2f
Fix #3266 Part 2: Fix Harder 2020-08-06 09:36:00 +01:00
w0rp fa3a927ca3
Fix #3266 - Truncate hover messages for LSP too 2020-08-05 13:46:08 +01:00
w0rp 1bd7b3e4ad
Merge pull request #3196 from jeremija/autoimport-langserver-pr
Add autoimport and rename support for langservers
2020-08-05 13:35:48 +01:00
w0rp 86d5cb81bd
Use more American English 2020-08-04 20:11:49 +01:00
w0rp acf892c4d1
#1532 - Display hover information on CursorHold 2020-08-04 20:11:49 +01:00
Horacio Sanson 316c7c7372
Merge pull request #3259 from sblask/support-markdownlint-rules-with-multiple-slashes
Support markdownlint rules with multiple slashes
2020-08-01 13:22:22 +09:00
Horacio Sanson 9894e92553
Merge pull request #3257 from jhlink/fix_astyle_config_detection_with_source
Fix Astyle Project Option Detection when Placed with Source Files
2020-08-01 13:21:16 +09:00
Bartek thindil Jasicki 9a9d12cf4f Merge remote-tracking branch 'upstream/master' 2020-07-31 07:56:28 +02:00
jhlink e2d1e54eb5 doc: Meaningless comment to kick CI from hang 2020-07-30 21:54:41 -04:00
Horacio Sanson fc7b4585e6
Merge pull request #3246 from lgmsantos/patch-1
Update ale-java.txt
2020-07-31 08:16:11 +09:00
Sebastian Blask fbfeae0587 Support markdownlint rules with multiple slashes 2020-07-31 11:15:13 +12:00
Horacio Sanson 275b5248e5
Merge pull request #3258 from jmreicha/patch-3
bashate typo
2020-07-31 08:13:04 +09:00
jhlink 84a413350c fix: Replace hardcoded quotes with ale#Escape 2020-07-30 10:07:53 -04:00
Josh Reichardt 72f1d730fd
Typo 2020-07-30 09:00:20 -05:00
jhlink ac2ebafadd fix: Force add .astylerc in test_cpp_project 2020-07-30 09:58:14 -04:00
jhlink ab6aed17ab test: Find .astylerc placed with src for astyle 2020-07-30 09:43:41 -04:00
jhlink d49b06e030 fix: Find proj_options in same dir for astyle 2020-07-30 09:29:33 -04:00
Horacio Sanson e03e24c091
Merge pull request #3253 from sblask/support-markdownlint-0.19.0-and-0.22.0
Support markdownlint 0.19.0 and 0.22.0
2020-07-30 09:45:13 +09:00
Sebastian Blask 7cada95683 Support markdownlint 0.19.0 and 0.22.0
Fixes #2965
2020-07-30 09:57:46 +12:00
Horacio Sanson 5338dbf680
Merge pull request #3231 from jhlink/add-astyle-for-c-formatting
Add astyle for C/C++ formatting
2020-07-29 22:08:46 +09:00
jhlink cef64424ce style: Resolve lint issue 2020-07-29 01:52:36 -04:00
jhlink 428c5f94da fix: Use ALE to reliably find project options 2020-07-29 01:36:45 -04:00
jhlink f4cff3bc06 test: Set empty values for astyle project_options 2020-07-28 23:29:19 -04:00
jhlink 7d40d0a16f chore: Distinguish test value name 2020-07-28 23:28:25 -04:00
jhlink a9b2f6362d chore: Delete dead test code 2020-07-28 23:26:49 -04:00
jhlink 5377272d20 fix: Change _options to _project_options 2020-07-28 19:48:27 -04:00
jhlink 0e6578cf65 fix: Remove explicit calls to file path in astyle 2020-07-26 22:05:14 -04:00
jhlink 75723e4522 doc: Add C++ desc in astyle entry in registry 2020-07-26 22:05:10 -04:00
jhlink 028485b4de doc: Add ale_cpp_astyle_options in ale-cpp 2020-07-26 21:22:17 -04:00
jhlink c38b2a6524 doc: Add ale_c_astyle_options in ale-c 2020-07-26 21:21:38 -04:00
jhlink 78295024e1 feat: Add project option file support for astyle 2020-07-26 21:11:37 -04:00
jhlink b25bb64a4d feat: Use stdin/redirection for astyle 2020-07-26 20:51:41 -04:00
jhlink a9799fe90e test: Add cpp test case for astyle 2020-07-25 21:25:11 -04:00
jhlink b3ad7bb3d0 Merge branch into add-astyle-for-c-formatting 2020-07-25 20:38:21 -04:00
jhlink f26b2e7f01 doc: Add astyle to ale-cpp-options in ale.txt 2020-07-25 20:38:15 -04:00
jhlink 4fc59ccace doc: Add astyle in c++ section in supported-tool 2020-07-25 20:38:12 -04:00
jhlink 9316b7b3f2 doc: Add astyle to c++ in supported lang & tools 2020-07-25 20:38:09 -04:00
jhlink ee466de733 feat: Add astyle in c++ section in supported-tool 2020-07-25 20:35:28 -04:00
jhlink 2987ebcfae feat: Add astyle to c++ in supported lang & tools 2020-07-25 20:34:03 -04:00
jhlink a2d172c457 doc: Add astyle to ale-cpp 2020-07-25 20:32:06 -04:00
jhlink 488df0fa41 feat: Add cpp to registry.vim 2020-07-25 20:22:10 -04:00
jhlink 076f9efbd9 feat: Add cpp support to astyle fixer 2020-07-25 20:20:47 -04:00
Luiz Gustavo 9fe208a01f
Update ale-java.txt 2020-07-25 02:32:10 -03:00
Bartek thindil Jasicki e06060a31f Merge remote-tracking branch 'upstream/master' 2020-07-24 10:38:29 +02:00
w0rp 68b484a49f
Merge pull request #2914 from hsanson/2913-fix-checkstyle-config-with-options
Fix 2913 - checkstyle config file ignored.
2020-07-21 12:49:55 +01:00
w0rp f31182beee
Merge pull request #3060 from hsanson/345-update-javalsp-documentation
Fix 345 - update java language server docs.
2020-07-21 12:48:57 +01:00
w0rp f4668c751f
Merge pull request #3070 from hsanson/2732-add-bashate-support
Fix 2732 - Add bashate support
2020-07-21 12:47:33 +01:00
w0rp 70ab831001
Merge pull request #3119 from hsanson/2269-ktlint-stdin-support
Fix 2269 - use ktlint stdin.
2020-07-21 12:45:26 +01:00
w0rp c1c3bd9227
Merge pull request #3137 from hsanson/3132-fix-eclipselsp-command
Fix eclipselsp command function.
2020-07-21 12:43:28 +01:00
Horacio Sanson 54aeeec97f
Merge pull request #3225 from markeganfuller/puppet_parser_error_at_end
Handling for puppet parser error at end of input.
2020-07-15 21:08:42 +09:00
Mark Egan-Fuller d38b92c957 Handling for puppet parser error at end of input.
Add handling for `Syntax error at end of input` which doesn't give a
line or column.

Fixes #2656
2020-07-15 12:10:34 +01:00
Horacio Sanson ddf4e7e9ba Enable ktlint fixer for kotlin files. 2020-07-12 20:49:04 +09:00
Horacio Sanson 26571fa050
Merge pull request #3232 from CherryMan/master
Zig support using zls.
2020-07-11 11:40:52 +09:00
Sheheryar Parvaz 23c58e63d4 Support zls language server for zig 2020-07-10 22:33:37 -04:00
jhlink d0b7a6e71f doc: Remove c++ from astyle 2020-07-10 19:06:22 -04:00
jhlink 57423f13ec style: Adjust spacing 2020-07-10 18:59:29 -04:00
jhlink fecffeee91 test: Add astyle vader test 2020-07-10 18:26:15 -04:00
jhlink 56b92544c2 doc: Add astyle to supported lang & tools 2020-07-10 18:16:12 -04:00
jhlink 5dbbd2d18b doc: Add astyle to supported-tools.md 2020-07-10 17:59:14 -04:00
jhlink 8c0b9ecdfd doc: Add astyle to ale-c-options in ale-contents 2020-07-10 17:56:02 -04:00
jhlink 4394084d99 doc: Add astyle entry to ALE c integration 2020-07-10 17:54:27 -04:00
jhlink 6c58164094 feat: Add astyle to fix/register.vim 2020-07-10 17:47:01 -04:00
jhlink 7f881f66a8 feat: Add ALE fixer for astyle 2020-07-10 17:46:01 -04:00
Horacio Sanson c136061b3f Enable languagetool for asciidoctor files. 2020-07-09 10:46:33 +09:00
Kevin Locke 106c27644b
eslint: Use cwd from executable location to fix nested projects (#3222)
* Split FindNearestExecutable from FindExecutable

The path searching in ale#node#FindExecutable() will be useful for
eslint.  Refactor it into a separate function so it can be used without
regard for the state of the _use_global and _executable variables.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>

* eslint: Set project root from local executable

Using the nearest directory with node_modules does not work correctly
for nested projects where the eslint dependencies are in the outer
project.  For example:
https://github.com/dense-analysis/ale/issues/3143#issuecomment-652452362

Adopt the behavior of SublimeLinter, which runs from project_root
determined by the presence of the eslint executable in node_modules/.bin
(or eslint in dependencies/devDependencies of package.json, which we can
add later as necessary).  See [NodeLinter#find_local_executable].

[NodeLinter#find_local_executable]: https://github.com/SublimeLinter/SublimeLinter/blob/056e6f6/lint/base_linter/node_linter.py#L109

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2020-07-08 14:42:01 +01:00
Horacio Sanson fd399c527f
Merge pull request #3223 from cspeterson/master
Puppet handler regex fix, plus new test
2020-07-08 22:24:28 +09:00
Christopher Peterson 1fcb9d1e1a Tests/puppet: add new test case for a heretofore unaccounted-for version of error message 2020-07-02 12:44:39 -04:00
Christopher Peterson 9b8ec86d7f Puppet handler: make error-parsing regex more robust 2020-07-02 12:42:44 -04:00
Bartek thindil Jasicki 0f45d3d01d Merge remote-tracking branch 'upstream/master' 2020-07-02 10:11:30 +02:00
Kevin Locke b3c6db173a
Run ESLint fixer from project root, where possible (#3096)
* Split eslint#GetCdString from eslint#GetCommand

Move the code for finding the project root and building the cd string
into a separate function so that it can be reused in the eslint fixer.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>

* Run ESLint fixer from project root dir

To match the ESLint linter, as changed in 9ee57d43 (which I forgot to
apply to the fixer, whoops).

Fixes: #3094
Closes: #3095

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2020-07-01 17:00:21 +01:00
Horacio Sanson 834d6f9c48
Merge pull request #3158 from ulidtko/improve-dockerfile_lint
Improve :ALEDetail for dockerfile_lint [READY TO REVIEW]
2020-06-20 20:58:42 +09:00
Horacio Sanson 4f25498806
Merge pull request #3172 from 0xMH/patch-1
More docs for beginners to use cloudformation linter
2020-06-19 22:26:45 +09:00
Bartek thindil Jasicki a5e7f2c8bb Merge remote-tracking branch 'upstream/master' 2020-06-07 09:26:06 +02:00
Jerko Steiner b29e9867e8 Add test for LSP autoimport 2020-05-31 11:46:10 +02:00
Jerko Steiner b339a8bfa0 Add support for rename (documentChanges) 2020-05-31 11:00:53 +02:00
Jerko Steiner 4062b05669 Fix completion with langserver (autoimport in go) 2020-05-31 11:00:53 +02:00
Keith Maxwell 53bfe41841 vim/vint: show policy name
So that I can find the relevant information in the vint
linting policy summary and policies can be easily configured
https://github.com/Vimjas/vint/wiki/Vint-linting-policy-summary

Before this change an example warning message appears as:

    autocmd should execute in an augroup or execute with a group (see :help :autocmd)

After this change the same example appears as:

    ProhibitAutocmdWithNoGroup - autocmd should execute in an augroup or execute with a group (see :help :autocmd)
2020-05-30 08:38:07 +01:00
mostfunkyduck 35c7c297b6 Fixes govet linter for go 1.13+, with tests 2020-05-25 11:46:16 -04:00
Stephen Robinson b209315714 Fixes #3092 - Implement loading `@file` c arguments 2020-05-20 18:15:52 -07:00
Mohamed hamza 6b8f08f7fc Added linter installing methods 2020-05-15 03:40:46 +02:00
NoNE 345daf683b
More docs for beginners to use cloudformation linter 2020-05-15 00:35:15 +02:00
max ulidtko c0d74b8094 Fix style and test 2020-05-06 14:05:39 +03:00
max ulidtko 5f4103fb35 Improve :ALEDetail for dockerfile_lint
1. The often longish `description` moved away from (supposedly short)
statusline `message` into the `detail` section.

2. dockerfile_lint sends `reference_url` pointing to issue explanations.
Use that.
2020-05-06 13:07:08 +03:00
James C. Davis 15d590ee5e
fix: don't append newline when buffer is noeol and nofixeol 2020-04-30 15:00:10 -04:00
Klaas Pieter Annema 2548763d04
Add Apple's swift-format as a linter 2020-04-29 14:33:13 +02:00
Horacio Sanson e641fe0c5d Fix eclipselsp command function.
Changes in eclipselsp and java caused the command needed to run the
language server fail to build properly.

Thi PR fixes those issues.
2020-04-25 15:21:09 +09:00
Tomas Janousek 4fbfcc9dec ccls: Detect build dir and set compilationDatabaseDirectory
Fixes #2621
2020-04-18 13:57:57 +02:00
Horacio Sanson 5035281cb9 Fix 2269 - use ktlint stdin.
Use stdin flag instead of temporary files. This allows ktlint to work
with .editorconfig files.
2020-04-18 15:27:11 +09:00
Dalius Dobravolskas 891852de71
Fix tslint fixer not working issue (temporary file not found) 2020-04-15 17:30:19 +03:00
Tim Bedard b800d24212
add stdin option for supported vint versions 2020-04-02 22:52:47 -05:00
John Gehrig 1c6b9354a8 Issue 2598: Addtional ^M characters on Windows
Windows may insert carriage return line endings, which ALE does not handle
well. These characters should not be displayed.

Adds a line to remove these characters for all messages.
2020-03-26 09:25:18 -04:00
Horacio Sanson 7b9855f1fe Fix 2732 - Add bashate support 2020-03-23 12:18:35 +09:00
Horacio Sanson c2aa01199e Fix 345 - update java language server docs. 2020-03-19 18:00:13 +09:00
Alex Wang fc6677d405 Avoid overriding parsed C/C++ -std=* flag
ALE appends flags from {c,cpp}_{clang,gcc}_options after those found by
parsing compile_commands.json or Makefile output. If -std=* flags are
present in both the ALE flags and parsed flags, the last one present
(i.e., ALE's -std=* flag) will determine the mode the compiler works in.
This can result in errors showing up in vim but not in the actual build
or vice-versa.

For example, say you have foo.cpp:

    #include <type_traits>
    int main() {
        return std::is_same_v<float, int>;
    }

If cpp_clang_options contains -std=c++17 and -std=c++14 is parsed from
compile_commands.json, then ALE would end up running something like:

    clang++ -S -x c++ -fsyntax-only -std=c++14 -std=c++17 - < foo.cpp

This would result in no errors showing up in Vim, but the actual build
would fail with:

    <stdin>:3:14: error: no template named 'is_same_v' in namespace 'std'; did you mean 'is_same'?
            return std::is_same_v<float, int>;
                   ~~~~~^~~~~~~~~
                        is_same
    /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/type_traits:872:61: note: 'is_same' declared here
    template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same           : public false_type {};
                                                                ^
    <stdin>:3:35: error: expected '(' for function-style cast or type construction
            return std::is_same_v<float, int>;
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~^
    2 errors generated.

as the actual build would not have the -std=c++17 flag added by ALE.

If cpp_clang_options contains -std=c++14 and -std=c++17 is parsed from
compile_commands.json, then the opposite problem would occur. ALE would
end up running something like:

    clang++ -S -x c++ -fsyntax-only -std=c++17 -std=c++14 - < foo.cpp

and would show an error on line 3 of foo.cpp:

    [clang] No template named 'is_same_v' in namespace 'std'; did you mean 'is_same'? (fix available)

The actual build, on the other hand, would succeed without any
complaints.

Removing -std=* from ALE's flags if it is already present in the parsed
flags ensures that the wrong -std=* flag is not used.

An alternative would have been to switch the order in which parsed flags
and ALE flags were concatenated when producing the command to execute,
but that could prevent a user from intentionally using ALE's flags to
override some other flags, e.g.  -W* flags to enable/disable warnings in
a project whose flags are not under the developer's control.

-std=* flags are also present in cuda/nvcc.vim, objc/clang.vim,
objcpp/clang.vim, and vhdl/ghdl.vim, but none of those linters appear to
parse compile_commands.json or `make` output.
2020-03-17 22:51:54 -04:00
Horacio Sanson c207d6a550 Fix 2816 - Standard fix does not work.
The standard linter --fix fails if the file being input is not relative
to the project root (https://github.com/standard/standard/issues/1384).

This MR attempts to fix this by changing the command so the input file
is relative to the project root and the output is to a temporary file.

Preliminary tests with toy javascript projects seem to indicate this
works fine.
2020-03-12 16:29:46 +09:00
Kevin Locke 8c0b0f085f Alias ps1 filetype to powershell
Rather than requiring users to alias ps1 to powershell themselves,
include it in s:default_ale_linter_aliases.  Since [vim-ps1] is a
popular (the only?) PowerShell ftplugin and there do not appear to be
any other uses of ft=ps1 on vim.org, this seems like a safe and
reasonable default.

[vim-ps1]: http://www.vim.org/scripts/script.php?script_id=1327

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2020-02-16 14:03:41 -07:00
Joe Reynolds 07080066e4 Add sql-lint as linter 2020-01-31 11:11:12 +00:00
davidsierradz 0cea55924b allow passing custom options to markdownlint 2019-12-19 13:11:25 -05:00
patrick96 1e9f870b74
verilog: Add filename to vlog linter output 2019-12-05 19:35:34 +01:00
Conrad Irwin efe120ce9a Fix prettier_standard to respect the configuration file
Before this change, prettier_standard would run and ignore any
.prettierrc, now it will respect the configuration of the file being
linted.

This change relies on prettier-standard 16.1.0 for the --stdin-filepath
flag, but is backward compatible: older versions of prettier-standard
will ignore the unknown flag and continue to run with no configuration
file.
2019-12-04 23:15:41 -08:00
Horacio Sanson 8fbcba0091 Fix 2913 - checkstyle config file ignored.
If checkstyle is configured with custom options that contain "-c" then
the checkstyle config file option is ignored. This PR modifies the
regular expression when creating the checkstyle command to avoid this.
2019-11-27 23:19:44 +09:00
Eddie Lebow ece229c06f
shell: Make description more accurate
The shell linter does more than just bash.
2019-11-23 00:34:40 -05:00
Eddie Lebow 1997a8f7e2
ShellDetect: fall back to filetype if no hashbang
Some files lack a hashbang line but still have an unambiguous filetype.
For example, the file `.zshrc` has the filetype `zsh`.

Augment ale#handlers#sh#GetShellType to fall back to the filetype if
no hashbang line can be found.
2019-11-23 00:34:40 -05:00
Donnie West 4222f32cc4
Include documentation item for removing warnings 2019-11-08 16:41:39 -06:00
Donnie West 4bdde36661
Check kind safely 2019-11-08 16:41:38 -06:00
Donnie West db5fe5659f
Allow the user to remove warnings from completions 2019-11-08 16:41:37 -06:00
Bartek thindil Jasicki b6828ac5c5 Merge remote-tracking branch 'upstream/master' 2019-11-07 22:07:26 +01:00
Bartek thindil Jasicki b8d69cb0d5 fixed typo 2019-11-05 18:59:13 +01:00
Bartek Jasicki b454e43143
Update test/command_callback/test_adals_command_callbacks.vader
Co-Authored-By: timlag1305 <timlag1305@gmail.com>
2019-11-05 18:00:16 +01:00
Bartek Jasicki f63fd23f2e
Update doc/ale-ada.txt
Co-Authored-By: timlag1305 <timlag1305@gmail.com>
2019-11-05 17:59:51 +01:00
Bartek Jasicki 09209dc54b
Update ale_linters/ada/adals.vim
Co-Authored-By: timlag1305 <timlag1305@gmail.com>
2019-11-05 17:59:17 +01:00
Bartek Jasicki 3c80c67633
Update ale_linters/ada/adals.vim
Co-Authored-By: timlag1305 <timlag1305@gmail.com>
2019-11-05 17:58:53 +01:00
Bartek thindil Jasicki 3e4a23cb14 Merge remote-tracking branch 'upstream/master' 2019-10-31 09:42:58 +01:00
Bartek thindil Jasicki 2f181658e6 rename command variable to *_adals_* instead of *_lsp_* and whole name to adals instead of adalsp 2019-10-18 18:26:08 +02:00
Bartek thindil Jasicki 8239b76c5a Merge remote-tracking branch 'upstream/master' 2019-10-18 18:15:05 +02:00
Bartek thindil Jasicki 6d5d3fa4dd fixed documentation headers 2019-10-11 11:10:02 +02:00
Bartek thindil Jasicki 5cbf7007ff fixed documentation 2019-10-11 11:00:49 +02:00
Bartek thindil Jasicki c30869617f another fix for test 2019-10-11 10:48:50 +02:00
Bartek thindil Jasicki 321a3892a7 fixed test again (this time for sure) 2019-10-11 10:41:19 +02:00
Bartek thindil Jasicki c74cc93140 fixed test 2019-10-11 10:35:54 +02:00
Bartek thindil Jasicki 38e0e3feef added adalsp test 2019-10-11 10:08:36 +02:00
Bartek thindil Jasicki 489b7d64e4 updated documentation 2019-10-11 09:55:05 +02:00
Bartek thindil Jasicki 87a0227d01 added support for Ada Language Server 2019-10-11 09:43:55 +02:00
Kamil Grzywacz e5e39a939a credo now recognizes umbrella projects
Use ale#handlers#elixir#FindMixUmbrellaRoot to determine project root
instead of ale#handlers#elixir#FindMixProjectRoot
2019-09-07 15:40:35 +02:00
1598 changed files with 33595 additions and 10712 deletions

View File

@ -19,6 +19,9 @@ init:
# Stop git from changing newlines
- git config --global core.autocrlf input
# NOTE: If you change the Vim or Vader versions here, please also update the
# instructions for running tests on Windows in ale-development.txt
install:
# Download and unpack Vim
- ps: >-

6
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,6 @@
---
blank_issues_enabled: false
contact_links:
- name: Ask for Help
url: https://github.com/dense-analysis/ale/discussions/new?category=q-a-ask-for-help-with-problems
about: Ask for Help in ALE Discussions

View File

@ -40,7 +40,9 @@ Are you having trouble configuring ALE? Try asking for help on [Stack Exchange](
2. Then this happened.
### :ALEInfo
<!-- Paste the output of :ALEInfo here. Try :ALEInfoToClipboard -->
<!-- Make sure to run :ALEInfo from the buffer where the bug occurred. -->
<!-- Read the output. You might figure out what went wrong yourself. -->
<details>
<summary>Expand</summary>
<!-- Paste the output of :ALEInfo here. Try :ALEInfoToClipboard -->
<!-- Make sure to run :ALEInfo from the buffer where the bug occurred. -->
<!-- Read the output. You might figure out what went wrong yourself. -->
</details>

17
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,17 @@
---
# This configuration closes stale PRs after 56 + 7 days.
# That's 8 weeks until stale bot complains, and a week until it closes a PR.
# Issues in ALE are never, ever stale. They are either resolved or not.
only: pulls
daysUntilStale: 56
daysUntilClose: 7
exemptLabels: []
staleLabel: stale
markComment: >
This pull request has been automatically marked as stale because it has not
been updated recently. Make sure to write tests and document your changes.
See `:help ale-dev` for information on writing tests.
If your pull request is good to merge, bother w0rp or another maintainer
again, and get them to merge it.
closeComment: false

37
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,37 @@
---
name: CI
on: # yamllint disable-line rule:truthy
push:
branches: [ master ] # yamllint disable-line rule:brackets
tags:
- v[0-9]+.[0-9]+.x
- v[0-9]+.[0-9]+.[0-9]+
pull_request:
branches: [ master ] # yamllint disable-line rule:brackets
jobs:
build_image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build docker run image
shell: bash
env:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
run: ./run-tests --build-image
test_ale:
needs: build_image
runs-on: ubuntu-latest
strategy:
matrix:
vim-version:
- '--vim-80-only'
- '--vim-82-only'
- '--neovim-02-only'
- '--neovim-07-only'
- '--linters-only'
steps:
- uses: actions/checkout@v2
- name: Run tests
run: ./run-tests -v ${{ matrix.vim-version }}

5
.gitignore vendored
View File

@ -1,11 +1,12 @@
!.editorconfig
*.obj
*.pyc
# Ignore all hidden files everywhere.
# Use `git add -f` to add hidden files.
.*
__pycache__
*.pyc
/doc/tags
/init.vim
/test/ale-info-test-file
/vader_output
__pycache__
tags

View File

@ -1,16 +0,0 @@
---
sudo: required
services:
- docker
language: generic
branches:
only:
- master
- /^v\d+\.\d+\.(x|\d+)$/
env:
- OPTIONS=--vim-80-only
- OPTIONS=--vim-81-only
- OPTIONS=--neovim-only
- OPTIONS=--linters-only
script: |
./run-tests -v $OPTIONS

5
.vintrc.yaml Normal file
View File

@ -0,0 +1,5 @@
policies:
# Disable a violation that is thrown randomly for reasons I still
# do not understand.
ProhibitMissingScriptEncoding:
enabled: false

View File

@ -1,20 +1,27 @@
FROM tweekmonster/vim-testbed:latest
FROM testbed/vim:20
RUN install_vim -tag v8.0.0027 -build \
-tag v8.1.0519 -build \
-tag v8.2.4693 -build \
-tag neovim:v0.2.0 -build \
-tag neovim:v0.3.5 -build
-tag neovim:v0.7.0 -build
ENV PACKAGES="\
bash \
git \
python \
py-pip \
python2 \
python3 \
py3-pip \
grep \
sed \
"
RUN apk --update add $PACKAGES && \
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
RUN pip install vim-vint==0.3.15
RUN pip install vim-vint==0.3.21
RUN git clone https://github.com/junegunn/vader.vim vader && \
cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
ARG GIT_VERSION
LABEL Version=${GIT_VERSION}
LABEL Name=denseanalysis/ale

View File

@ -1,4 +1,4 @@
Copyright (c) 2016-2019, w0rp <devw0rp@gmail.com>
Copyright (c) 2016-2020, w0rp <devw0rp@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without

237
README.md
View File

@ -1,4 +1,4 @@
# Asynchronous Lint Engine [![Travis CI Build Status](https://travis-ci.com/dense-analysis/ale.svg?branch=master)](https://travis-ci.com/dense-analysis/ale) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/r0ef1xu8xjmik58d/branch/master?svg=true)](https://ci.appveyor.com/project/dense-analysis/ale) [![Join the chat at https://gitter.im/vim-ale/Lobby](https://badges.gitter.im/vim-ale/Lobby.svg)](https://gitter.im/vim-ale/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# Asynchronous Lint Engine [![GitHub Build Status](https://github.com/dense-analysis/ale/workflows/CI/badge.svg)](https://github.com/dense-analysis/ale/actions?query=event%3Apush+workflow%3ACI+branch%3Amaster++) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/r0ef1xu8xjmik58d/branch/master?svg=true)](https://ci.appveyor.com/project/dense-analysis/ale) [![Join the Dense Analysis Discord server](https://img.shields.io/badge/chat-Discord-5865F2)](https://discord.gg/5zFD6pQxDk)
![ALE Logo by Mark Grealish - https://www.bhalash.com/](https://user-images.githubusercontent.com/3518142/59195920-2c339500-8b85-11e9-9c22-f6b7f69637b8.jpg)
@ -53,6 +53,7 @@ other content at [w0rp.com](https://w0rp.com).
5. [Find References](#usage-find-references)
6. [Hovering](#usage-hover)
7. [Symbol Search](#usage-symbol-search)
8. [Refactoring: Rename, Actions](#usage-refactoring)
3. [Installation](#installation)
1. [Installation with Vim package management](#standard-installation)
2. [Installation with Pathogen](#installation-with-pathogen)
@ -61,23 +62,27 @@ other content at [w0rp.com](https://w0rp.com).
4. [Contributing](#contributing)
5. [FAQ](#faq)
1. [How do I disable particular linters?](#faq-disable-linters)
2. [How can I keep the sign gutter open?](#faq-keep-signs)
3. [How can I change the signs ALE uses?](#faq-change-signs)
4. [How can I change or disable the highlights ALE uses?](#faq-change-highlights)
5. [How can I show errors or warnings in my statusline?](#faq-statusline)
6. [How can I show errors or warnings in my lightline?](#faq-lightline)
7. [How can I change the format for echo messages?](#faq-echo-format)
8. [How can I execute some code when ALE starts or stops linting?](#faq-autocmd)
9. [How can I navigate between errors quickly?](#faq-navigation)
10. [How can I run linters only when I save files?](#faq-lint-on-save)
11. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
12. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
13. [How can I check Vue files with ESLint?](#faq-vue-eslint)
14. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
15. [How can I configure my C or C++ project?](#faq-c-configuration)
16. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
17. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
18. [How can I see what ALE has configured for the current file?](#faq-get-info)
2. [How can I see what ALE has configured for the current file?](#faq-get-info)
3. [How can I use ALE and coc.nvim together?](#faq-coc-nvim)
4. [How can I keep the sign gutter open?](#faq-keep-signs)
5. [How can I change the signs ALE uses?](#faq-change-signs)
6. [How can I change or disable the highlights ALE uses?](#faq-change-highlights)
7. [How can I show errors or warnings in my statusline?](#faq-statusline)
8. [How can I show errors or warnings in my lightline?](#faq-lightline)
9. [How can I change the format for echo messages?](#faq-echo-format)
10. [How can I execute some code when ALE starts or stops linting?](#faq-autocmd)
11. [How can I navigate between errors quickly?](#faq-navigation)
12. [How can I run linters only when I save files?](#faq-lint-on-save)
13. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
14. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
15. [How can I check Vue files with ESLint?](#faq-vue-eslint)
16. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
17. [How can I configure my C or C++ project?](#faq-c-configuration)
18. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
19. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
20. [How can I run linters or fixers via Docker or a VM?](#faq-vm)
21. [How can I change the borders for floating preview windows?](#faq-window-borders)
22. [How can I use ALE and vim-lsp together?](#faq-vim-lsp)
<a name="supported-languages"></a>
@ -102,7 +107,7 @@ programs for checking the syntax and semantics of your programs. By default,
linters will be re-run in the background to check your syntax when you open
new buffers or as you make edits to your files.
The behaviour of linting can be configured with a variety of options,
The behavior of linting can be configured with a variety of options,
documented in [the Vim help file](doc/ale.txt). For more information on the
options ALE offers, consult `:help ale-options` for global options and `:help
ale-integration-options` for options specified to particular linters.
@ -193,15 +198,15 @@ completion manually with `<C-x><C-o>`.
set omnifunc=ale#completion#OmniFunc
```
When working with TypeScript files, ALE supports automatic imports from
external modules. This behavior is disabled by default and can be enabled by
setting:
ALE supports automatic imports from external modules. This behavior is enabled
by default and can be disabled by setting:
```vim
let g:ale_completion_tsserver_autoimport = 1
let g:ale_completion_autoimport = 0
```
See `:help ale-completion` for more information.
Note that disabling auto import can result in missing completion items from some
LSP servers (e.g. eclipselsp). See `:help ale-completion` for more information.
<a name="usage-go-to-definition"></a>
@ -231,6 +236,9 @@ ALE supports "hover" information for printing brief information about symbols at
the cursor taken from Language Server Protocol linters and `tsserver` with the
`ALEHover` command.
Truncated information will be displayed when the cursor rests on a symbol by
default, as long as there are no problems on the same line.
The information can be displayed in a `balloon` tooltip in Vim or GVim by
hovering your mouse over symbols. Mouse hovering is enabled by default in GVim,
and needs to be configured for Vim 8.1+ in terminals.
@ -249,6 +257,21 @@ similar to a given query string.
See `:help ale-symbol-search` for more information.
<a name="usage-refactoring"></a>
### 2.viii Refactoring: Rename, Actions
ALE supports renaming symbols in symbols in code such as variables or class
names with the `ALERename` command.
`ALEFileRename` will rename file and fix import paths (tsserver
only).
`ALECodeAction` will execute actions on the cursor or applied to a visual
range selection, such as automatically fixing errors.
See `:help ale-refactor` for more information.
<a name="installation"></a>
## 3. Installation
@ -324,26 +347,31 @@ git clone https://github.com/dense-analysis/ale.git
### 3.iii. Installation with Vundle
You can install this plugin using [Vundle](https://github.com/VundleVim/Vundle.vim)
by using the path on GitHub for this repository.
by adding the GitHub path for this repository to your `~/.vimrc`:
```vim
Plugin 'dense-analysis/ale'
```
Then run the command `:PluginInstall` in Vim.
See the Vundle documentation for more information.
<a name="installation-with-vim-plug"></a>
### 3.iiii. Installation with Vim-Plug
### 3.iv. Installation with Vim-Plug
You can install this plugin using [Vim-Plug](https://github.com/junegunn/vim-plug)
by adding the GitHub path for this repository to your `~/.vimrc`
and running `:PlugInstall`.
by adding the GitHub path for this repository to your `~/.vimrc`:
```vim
Plug 'dense-analysis/ale'
```
Then run the command `:PlugInstall` in Vim.
See the Vim-Plug documentation for more information.
<a name="contributing"></a>
## 4. Contributing
@ -358,8 +386,8 @@ If you are interested in the general direction of the project, check out the
[wiki home page](https://github.com/dense-analysis/ale/wiki). The wiki includes
a Roadmap for the future, and more.
If you'd liked to discuss the project more directly, check out the `#vim-ale` channel
on Freenode. Web chat is available [here](https://webchat.freenode.net/?channels=vim-ale).
If you'd liked to discuss ALE and more check out the Dense Analysis Discord
server here: https://discord.gg/5zFD6pQxDk
<a name="faq"></a>
@ -413,9 +441,56 @@ This plugin will look for linters in the [`ale_linters`](ale_linters) directory.
Each directory within corresponds to a particular filetype in Vim, and each file
in each directory corresponds to the name of a particular linter.
<a name="faq-get-info"></a>
### 5.ii. How can I see what ALE has configured for the current file?
Run the following to see what is currently configured:
```vim
:ALEInfo
```
<a name="faq-coc-nvim"></a>
### 5.iii. How can I use ALE and coc.nvim together?
[coc.nvim](https://github.com/neoclide/coc.nvim) is a popular Vim plugin written
in TypeScript and dependent on the [npm](https://www.npmjs.com/) ecosystem for
providing full IDE features to Vim. Both ALE and coc.nvim implement
[Language Server Protocol](https://microsoft.github.io/language-server-protocol/)
(LSP) clients for supporting diagnostics (linting with a live server), and other
features like auto-completion, and others listed above.
ALE is primarily focused on integrating with external programs through virtually
any means, provided the plugin remains almost entirely written in Vim script.
coc.nvim is primarily focused on bringing IDE features to Vim. If you want to
run external programs on your files to check for errors, and also use the most
advanced IDE features, you might want to use both plugins at the same time.
The easiest way to get both plugins to work together is to configure coc.nvim to
send diagnostics to ALE, so ALE controls how all problems are presented to you,
and to disable all LSP features in ALE, so ALE doesn't try to provide LSP
features already provided by coc.nvim, such as auto-completion.
1. Open your coc.nvim configuration file with `:CocConfig` and add
`"diagnostic.displayByAle": true` to your settings.
2. Add `let g:ale_disable_lsp = 1` to your vimrc file, before plugins are
loaded.
You can also use `b:ale_disable_lsp` in your ftplugin files to enable or disable
LSP features in ALE for different filetypes. After you configure coc.nvim and
ALE this way, you can further configure how problems appear to you by using all
of the settings mentioned in ALE's help file, including how often diagnostics
are requested. See `:help ale-lint`.
The integration between ALE and coc.nvim works using an API ALE offers for
letting any other plugin integrate with ALE. If you are interested in writing a
similar integration, see `:help ale-lint-other-sources`.
<a name="faq-keep-signs"></a>
### 5.ii. How can I keep the sign gutter open?
### 5.iv. How can I keep the sign gutter open?
You can keep the sign gutter open at all times by setting the
`g:ale_sign_column_always` to 1
@ -426,7 +501,7 @@ let g:ale_sign_column_always = 1
<a name="faq-change-signs"></a>
### 5.iii. How can I change the signs ALE uses?
### 5.v. How can I change the signs ALE uses?
Use these options to specify what text should be used for signs:
@ -446,7 +521,7 @@ highlight clear ALEWarningSign
<a name="faq-change-highlights"></a>
### 5.iv. How can I change or disable the highlights ALE uses?
### 5.vi. How can I change or disable the highlights ALE uses?
ALE's highlights problems with highlight groups which link to `SpellBad`,
`SpellCap`, `error`, and `todo` groups by default. The characters that are
@ -472,7 +547,7 @@ See `:help ale-highlights` for more information.
<a name="faq-statusline"></a>
### 5.v. How can I show errors or warnings in my statusline?
### 5.vii. How can I show errors or warnings in my statusline?
[vim-airline](https://github.com/vim-airline/vim-airline) integrates with ALE
for displaying error information in the status bar. If you want to see the
@ -521,7 +596,7 @@ for more information.
<a name="faq-lightline"></a>
### 5.vi. How can I show errors or warnings in my lightline?
### 5.viii. 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 there is a plugin that adds this functionality: [maximbaz/lightline-ale](https://github.com/maximbaz/lightline-ale).
@ -530,7 +605,7 @@ For more information, check out the sources of that plugin, `:help ale#statuslin
<a name="faq-echo-format"></a>
### 5.vii. How can I change the format for echo messages?
### 5.ix. How can I change the format for echo messages?
There are 3 global options that allow customizing the echoed message.
@ -559,7 +634,7 @@ See `:help g:ale_echo_msg_format` for more information.
<a name="faq-autocmd"></a>
### 5.viii. How can I execute some code when ALE starts or stops linting?
### 5.x. How can I execute some code when ALE starts or stops linting?
ALE runs its own [autocmd](http://vimdoc.sourceforge.net/htmldoc/autocmd.html)
events when a lint or fix cycle are started and stopped. There is also an event
@ -582,7 +657,7 @@ augroup END
<a name="faq-navigation"></a>
### 5.ix. How can I navigate between errors quickly?
### 5.xi. How can I navigate between errors quickly?
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
@ -598,7 +673,7 @@ For more information, consult the online documentation with
<a name="faq-lint-on-save"></a>
### 5.x. How can I run linters only when I save files?
### 5.xii. How can I run linters only when I save files?
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
@ -619,7 +694,7 @@ files, you can set `g:ale_lint_on_save` to `0`.
<a name="faq-quickfix"></a>
### 5.xi. How can I use the quickfix list instead of the loclist?
### 5.xiii. How can I use the quickfix list instead of the loclist?
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
@ -649,7 +724,7 @@ instead of the default horizontally.
<a name="faq-jsx-stylelint-eslint"></a>
### 5.xii. How can I check JSX files with both stylelint and eslint?
### 5.xiv. How can I check JSX files with both stylelint and eslint?
If you configure ALE options correctly in your vimrc file, and install
the right tools, you can check JSX files with stylelint and eslint.
@ -691,7 +766,7 @@ no linter will be run twice for the same file.
<a name="faq-vue-eslint"></a>
### 5.xiii. How can I check Vue files with ESLint?
### 5.xv. How can I check Vue files with ESLint?
To check Vue files with ESLint, your ESLint project configuration file must be
configured to use the [Vue plugin](https://github.com/vuejs/eslint-plugin-vue).
@ -722,7 +797,7 @@ let g:ale_linters = {'vue': ['eslint', 'vls']}
<a name="faq-my-battery-is-sad"></a>
### 5.xiv. Will this plugin eat all of my laptop battery power?
### 5.xvi. 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
course means that CPU time will be used to continuously check your code. If you
@ -735,7 +810,7 @@ while you type. ALE uses a timeout which is cancelled and reset every time you
type, and this delay can be increased so linters are run less often. See
`:help g:ale_lint_delay` for more information.
If you don't wish to run linters while you type, you can disable that behaviour.
If you don't wish to run linters while you type, you can disable that behavior.
Set `g:ale_lint_on_text_changed` to `never`. You won't get as frequent error
checking, but ALE shouldn't block your ability to edit a document after you save
a file, so the asynchronous nature of the plugin will still be an advantage.
@ -746,7 +821,7 @@ including the option `g:ale_lint_on_enter`, and you can run ALE manually with
<a name="faq-c-configuration"></a>
### 5.xv. How can I configure my C or C++ project?
### 5.xvii. How can I configure my C or C++ project?
The structure of C and C++ projects varies wildly from project to project, with
many different build tools being used for building them, and many different
@ -766,13 +841,24 @@ setting. Consult the documentation for that setting for more information.
`b:ale_linters` can be used to select which tools you want to run, say if you
want to use only `gcc` for one project, and only `clang` for another.
ALE will attempt to parse `compile_commands.json` files to discover compiler
flags to use when linting code. See `:help g:ale_c_parse_compile_commands` for
more information. See Clang's documentation for
[compile_commands.json files](https://clang.llvm.org/docs/JSONCompilationDatabase.html).
You should strongly consider generating them in your builds, which is easy to do
with CMake.
You can also configure ALE to automatically run `make -n` to run dry runs on
`Makefile`s to discover compiler flags. This can execute arbitrary code, so the
option is disabled by default. See `:help g:ale_c_parse_makefile`.
You may also configure buffer-local settings for linters with project-specific
vimrc files. [local_vimrc](https://github.com/LucHermitte/local_vimrc) can be
used for executing local vimrc files which can be shared in your project.
<a name="faq-buffer-configuration"></a>
### 5.xvi. How can I configure ALE differently for different buffers?
### 5.xviii. How can I configure ALE differently for different buffers?
ALE offers various ways to configure which linters or fixers are run, and
other settings. For the majority of ALE's settings, they can either be
@ -808,7 +894,7 @@ Buffer-local variables for settings always override the global settings.
<a name="faq-list-window-height"></a>
### 5.xvii. How can I configure the height of the list in which ALE displays errors?
### 5.xix. How can I configure the height of the list in which ALE displays errors?
To set a default height for the error list, use the `g:ale_list_window_size` variable.
@ -817,12 +903,61 @@ To set a default height for the error list, use the `g:ale_list_window_size` var
let g:ale_list_window_size = 5
```
<a name="faq-get-info"></a>
<a name="faq-vm"></a>
### 5.xviii. How can I see what ALE has configured for the current file?
### 5.xx. How can I run linters or fixers via Docker or a VM?
Run the following to see what is currently configured:
ALE supports running linters or fixers via Docker, virtual machines, or in
combination with any remote machine with a different file system, so long as the
tools are well-integrated with ALE, and ALE is properly configured to run the
correct commands and map filename paths between different file systems. See
`:help ale-lint-other-machines` for the full documentation on how to configure
ALE to support this.
<a name="faq-window-borders"></a>
### 5.xxi. How can I change the borders for floating preview windows?
Borders for floating preview windows are enabled by default. You can use the
`g:ale_floating_window_border` setting to configure them.
You could disable the border with an empty list.
```vim
:ALEInfo
let g:ale_floating_window_border = []
```
If the terminal supports Unicode, you might try setting the value like below, to
make it look nicer.
```vim
let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰', '│', '─']
```
Since vim's default uses nice unicode characters when possible, you can trick
ale into using that default with
```vim
let g:ale_floating_window_border = repeat([''], 8)
```
<a name="faq-vim-lsp"></a>
### 5.xxii. How can I use ALE and vim-lsp together?
[vim-lsp](https://github.com/prabirshrestha/vim-lsp) is a popular plugin as
implementation of Language Server Protocol (LSP) client for Vim. It provides
all the LSP features including auto completion, diagnostics, go to definitions,
etc.
ALE also provides LSP support for diagnostics. When you use both ALE and
vim-lsp, one option is disabling ALE's LSP support by
`let g:ale_disable_lsp = 1`. However ALE provides integration of external
programs. Showing errors from language servers by vim-lsp and showing errors
from other external programs by ALE are confusing and problematic.
[vim-lsp-ale](https://github.com/rhysd/vim-lsp-ale) is a bridge plugin to solve
the problem when using both ALE and vim-lsp. With the plugin, diagnostics are
provided by vim-lsp and ALE can handle all the errors. Please read
[vim-lsp-ale's documentation](https://github.com/rhysd/vim-lsp-ale/blob/master/doc/vim-lsp-ale.txt)
for more details.

26
ale_linters/ada/adals.vim Normal file
View File

@ -0,0 +1,26 @@
" Author: Bartek Jasicki http://github.com/thindil
" Description: Support for Ada Language Server
call ale#Set('ada_adals_executable', 'ada_language_server')
call ale#Set('ada_adals_project', 'default.gpr')
call ale#Set('ada_adals_encoding', 'utf-8')
function! ale_linters#ada#adals#GetAdaLSConfig(buffer) abort
return {
\ 'ada.projectFile': ale#Var(a:buffer, 'ada_adals_project'),
\ 'ada.defaultCharset': ale#Var(a:buffer, 'ada_adals_encoding')
\}
endfunction
function! ale_linters#ada#adals#GetRootDirectory(buffer) abort
return fnamemodify(bufname(a:buffer), ':p:h')
endfunction
call ale#linter#Define('ada', {
\ 'name': 'adals',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'ada_adals_executable')},
\ 'command': '%e',
\ 'project_root': function('ale_linters#ada#adals#GetRootDirectory'),
\ 'lsp_config': function('ale_linters#ada#adals#GetAdaLSConfig')
\})

View File

@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for Ada files.
call ale#handlers#cspell#DefineLinter('ada')

View File

@ -18,7 +18,7 @@ function! ale_linters#ada#gcc#GetCommand(buffer) abort
" -gnatc: Check syntax and semantics only (no code generation attempted)
return '%e -x ada -c -gnatc'
\ . ' -o ' . ale#Escape(l:out_file)
\ . ' -I ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
\ . ' -I %s:h'
\ . ale#Pad(ale#Var(a:buffer, 'ada_gcc_options'))
\ . ' %t'
endfunction

View File

@ -1,4 +1,4 @@
" Author: Bjorn Neergaard <bjorn@neersighted.com>
" Authors: Bjorn Neergaard <bjorn@neersighted.com>, Vytautas Macionis <vytautas.macionis@manomail.de>
" Description: ansible-lint for ansible-yaml files
call ale#Set('ansible_ansible_lint_executable', 'ansible-lint')
@ -7,7 +7,7 @@ function! ale_linters#ansible#ansible_lint#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'ansible_ansible_lint_executable')
endfunction
function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort
function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
for l:line in a:lines[:10]
if match(l:line, '^Traceback') >= 0
return [{
@ -18,39 +18,111 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort
endif
endfor
" Matches patterns line the following:
"
" test.yml:35: [EANSIBLE0002] Trailing whitespace
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?: \[?([[:alnum:]]+)\]? (.*)$'
let l:version_group = ale#semver#GTE(a:version, [6, 0, 0]) ? '>=6.0.0' :
\ ale#semver#GTE(a:version, [5, 0, 0]) ? '>=5.0.0' :
\ '<5.0.0'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:code = l:match[4]
if '>=6.0.0' is# l:version_group
let l:error_codes = { 'blocker': 'E', 'critical': 'E', 'major': 'W', 'minor': 'W', 'info': 'I' }
let l:linter_issues = json_decode(join(a:lines, ''))
if l:code is# 'EANSIBLE0002'
\&& !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
" Skip warnings for trailing whitespace if the option is off.
continue
endif
for l:issue in l:linter_issues
if ale#path#IsBufferPath(a:buffer, l:issue.location.path)
call add(l:output, {
\ 'lnum': exists('l:issue.location.lines.begin.column') ? l:issue.location.lines.begin.line :
\ l:issue.location.lines.begin,
\ 'col': exists('l:issue.location.lines.begin.column') ? l:issue.location.lines.begin.column : 0,
\ 'text': l:issue.check_name,
\ 'detail': l:issue.description,
\ 'code': l:issue.severity,
\ 'type': l:error_codes[l:issue.severity],
\})
endif
endfor
endif
if ale#path#IsBufferPath(a:buffer, l:match[1])
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'text': l:match[5],
\ 'code': l:code,
\ 'type': l:code[:0] is# 'E' ? 'E' : 'W',
\})
endif
endfor
if '>=5.0.0' is# l:version_group
" Matches patterns line the following:
" test.yml:3:148: syntax-check 'var' is not a valid attribute for a Play
" roles/test/tasks/test.yml:8: [package-latest] [VERY_LOW] Package installs should not use latest
" D:\test\tasks\test.yml:8: [package-latest] [VERY_LOW] package installs should not use latest
let l:pattern = '\v^(%([a-zA-Z]:)?[^:]+):(\d+):%((\d+):)? %(\[([-[:alnum:]]+)\]) %(\[([_[:alnum:]]+)\]) (.*)$'
let l:error_codes = { 'VERY_HIGH': 'E', 'HIGH': 'E', 'MEDIUM': 'W', 'LOW': 'W', 'VERY_LOW': 'W', 'INFO': 'I' }
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if ale#path#IsBufferPath(a:buffer, l:match[1])
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'text': l:match[6],
\ 'code': l:match[4],
\ 'type': l:error_codes[l:match[5]],
\})
endif
endfor
endif
if '<5.0.0' is# l:version_group
" Matches patterns line the following:
" test.yml:35: [EANSIBLE0002] Trailing whitespace
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?: \[?([[:alnum:]]+)\]? (.*)$'
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:code = l:match[4]
if l:code is# 'EANSIBLE0002'
\&& !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
" Skip warnings for trailing whitespace if the option is off.
continue
endif
if ale#path#IsBufferPath(a:buffer, l:match[1])
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'text': l:match[5],
\ 'code': l:code,
\ 'type': l:code[:0] is# 'E' ? 'E' : 'W',
\})
endif
endfor
endif
return l:output
endfunction
function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort
let l:commands = {
\ '>=6.0.0': '%e --nocolor -f json -x yaml %s',
\ '>=5.0.0': '%e --nocolor --parseable-severity -x yaml %s',
\ '<5.0.0': '%e --nocolor -p %t'
\}
let l:command = ale#semver#GTE(a:version, [6, 0]) ? l:commands['>=6.0.0'] :
\ ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] :
\ l:commands['<5.0.0']
return l:command
endfunction
call ale#linter#Define('ansible', {
\ 'name': 'ansible_lint',
\ 'aliases': ['ansible', 'ansible-lint'],
\ 'executable': function('ale_linters#ansible#ansible_lint#GetExecutable'),
\ 'command': '%e -p %t',
\ 'callback': 'ale_linters#ansible#ansible_lint#Handle',
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#ansible#ansible_lint#GetExecutable(buffer),
\ '%e --version',
\ function('ale_linters#ansible#ansible_lint#GetCommand'),
\ )},
\ 'lint_file': 1,
\ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#ansible#ansible_lint#GetExecutable(buffer),
\ '%e --version',
\ {buffer, version -> ale_linters#ansible#ansible_lint#Handle(
\ buffer,
\ l:version,
\ lines)},
\ )},
\})

View File

@ -0,0 +1,12 @@
" Author: Leo <thinkabit.ukim@gmail.com>
" Description: apkbuild-lint from atools linter for APKBUILDs
call ale#Set('apkbuild_apkbuild_lint_executable', 'apkbuild-lint')
call ale#linter#Define('apkbuild', {
\ 'name': 'apkbuild_lint',
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'apkbuild_apkbuild_lint_executable')},
\ 'command': '%e %t',
\ 'callback': 'ale#handlers#atools#Handle',
\})

View File

@ -0,0 +1,12 @@
" Author: Leo <thinkabit.ukim@gmail.com>
" Description: secfixes-check from atools linter for APKBUILDs
call ale#Set('apkbuild_secfixes_check_executable', 'secfixes-check')
call ale#linter#Define('apkbuild', {
\ 'name': 'secfixes_check',
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'apkbuild_secfixes_check_executable')},
\ 'command': '%e %t',
\ 'callback': 'ale#handlers#atools#Handle',
\})

View File

@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for ASCIIDoc files.
call ale#handlers#cspell#DefineLinter('asciidoc')

View File

@ -0,0 +1,5 @@
" Author: Horacio Sanson (hsanson [ät] gmail.com)
" Description: languagetool for asciidoc files, copied from markdown.
call ale#handlers#languagetool#DefineLinter('asciidoc')

View File

@ -9,7 +9,7 @@ function! ale_linters#asm#gcc#GetCommand(buffer) abort
" -fsyntax-only doesn't catch everything.
return '%e -x assembler'
\ . ' -o ' . g:ale#util#nul_file
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
\ . '-iquote %s:h'
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
endfunction

36
ale_linters/avra/avra.vim Normal file
View File

@ -0,0 +1,36 @@
" Author: Utkarsh Verma <utkarshverma@protonmail.com>
" Description: AVRA linter for avra syntax.
call ale#Set('avra_avra_executable', 'avra')
call ale#Set('avra_avra_options', '')
function! ale_linters#avra#avra#GetCommand(buffer) abort
return '%e'
\ . ' %t'
\ . ale#Pad(ale#Var(a:buffer, 'avra_avra_options'))
\ . ' -o ' . g:ale#util#nul_file
endfunction
function! ale_linters#avra#avra#Handle(buffer, lines) abort
" Note that we treat 'fatal' as errors.
let l:pattern = '^\S\+(\(\d\+\))\s\+:\s\+\(\S\+\)\s\+:\s\+\(.\+\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'type': l:match[2] =~? 'Error' ? 'E' : 'W',
\ 'text': l:match[3],
\})
endfor
return l:output
endfunction
call ale#linter#Define('avra', {
\ 'name': 'avra',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'avra_avra_executable')},
\ 'command': function('ale_linters#avra#avra#GetCommand'),
\ 'callback': 'ale_linters#avra#avra#Handle',
\})

View File

@ -9,8 +9,9 @@ function! ale_linters#awk#gawk#GetCommand(buffer) abort
" gawk from attempting to execute the body of the script
" it is linting.
return '%e --source ' . ale#Escape('BEGIN { exit } END { exit 1 }')
\ . ' --lint'
\ . ale#Pad(ale#Var(a:buffer, 'awk_gawk_options'))
\ . ' -f %t --lint /dev/null'
\ . ' -f %t /dev/null'
endfunction
call ale#linter#Define('awk', {

View File

@ -18,7 +18,12 @@ function! ale_linters#bib#bibclean#get_type(str) abort
endfunction
function! ale_linters#bib#bibclean#match_msg(line) abort
return matchlist(a:line, '^\(.*\) "stdin", line \(.*\): \(.*\)$')
" Legacy message pattern works for bibclean <= v2.11.4. If empty, try
" the new message pattern for bibtex > v2.11.4
let l:matches_legacy = matchlist(a:line, '^\(.*\) "stdin", line \(\d\+\): \(.*\)$')
return ! empty(l:matches_legacy) ? l:matches_legacy
\ : matchlist(a:line, '^\(.*\) stdin:\(\d\+\):\(.*\)$')
endfunction
function! ale_linters#bib#bibclean#match_entry(line) abort

View File

@ -0,0 +1,47 @@
" Author: offa
" Description: oelint-adv for BitBake files
call ale#Set('bitbake_oelint_adv_executable', 'oelint-adv')
call ale#Set('bitbake_oelint_adv_options', '')
call ale#Set('bitbake_oelint_adv_config', '.oelint.cfg')
function! ale_linters#bitbake#oelint_adv#Command(buffer) abort
let l:config_file = ale#path#FindNearestFile(a:buffer,
\ ale#Var(a:buffer, 'bitbake_oelint_adv_config'))
return ((!empty(l:config_file))
\ ? 'OELINT_CONFIG=' . ale#Escape(l:config_file) . ' '
\ : '')
\ . '%e --quiet '
\ . ale#Pad(ale#Var(a:buffer, 'bitbake_oelint_adv_options')) . '%s'
endfunction
function! ale_linters#bitbake#oelint_adv#Handle(buffer, lines) abort
let l:pattern = '\v^(.+):(.+):(.+):(.+):(.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': str2nr(l:match[2]),
\ 'type': l:match[3] is# 'error'
\ ? 'E' : (l:match[3] is# 'warning' ? 'W' : 'I'),
\ 'text': StripAnsiCodes(l:match[5]),
\ 'code': l:match[4]
\ })
endfor
return l:output
endfunction
function! StripAnsiCodes(line) abort
return substitute(a:line, '\e\[[0-9;]\+[mK]', '', 'g')
endfunction
call ale#linter#Define('bitbake', {
\ 'name': 'oelint_adv',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#Var(b, 'bitbake_oelint_adv_executable')},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#bitbake#oelint_adv#Command'),
\ 'callback': 'ale_linters#bitbake#oelint_adv#Handle',
\ })

53
ale_linters/c/cc.vim Normal file
View File

@ -0,0 +1,53 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: A C compiler linter for C files with gcc/clang, etc.
call ale#Set('c_cc_executable', '<auto>')
call ale#Set('c_cc_options', '-std=c11 -Wall')
function! ale_linters#c#cc#GetExecutable(buffer) abort
let l:executable = ale#Var(a:buffer, 'c_cc_executable')
" Default to either clang or gcc.
if l:executable is# '<auto>'
if ale#engine#IsExecutable(a:buffer, 'clang')
let l:executable = 'clang'
else
let l:executable = 'gcc'
endif
endif
return l:executable
endfunction
function! ale_linters#c#cc#GetCommand(buffer, output) abort
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
let l:ale_flags = ale#Var(a:buffer, 'c_cc_options')
if l:cflags =~# '-std='
let l:ale_flags = substitute(
\ l:ale_flags,
\ '-std=\(c\|gnu\)[0-9]\{2\}',
\ '',
\ 'g')
endif
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
"
" `-o /dev/null` or `-o null` is needed to catch all errors,
" -fsyntax-only doesn't catch everything.
return '%e -S -x c'
\ . ' -o ' . g:ale#util#nul_file
\ . ' -iquote %s:h'
\ . ale#Pad(l:cflags)
\ . ale#Pad(l:ale_flags) . ' -'
endfunction
call ale#linter#Define('c', {
\ 'name': 'cc',
\ 'aliases': ['gcc', 'clang'],
\ 'output_stream': 'stderr',
\ 'executable': function('ale_linters#c#cc#GetExecutable'),
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#cc#GetCommand'))},
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
\})

View File

@ -3,6 +3,7 @@
call ale#Set('c_ccls_executable', 'ccls')
call ale#Set('c_ccls_init_options', {})
call ale#Set('c_build_dir', '')
call ale#linter#Define('c', {
\ 'name': 'ccls',
@ -10,5 +11,5 @@ call ale#linter#Define('c', {
\ 'executable': {b -> ale#Var(b, 'c_ccls_executable')},
\ 'command': '%e',
\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'),
\ 'initialization_options': {b -> ale#Var(b, 'c_ccls_init_options')},
\ 'initialization_options': {b -> ale#handlers#ccls#GetInitOpts(b, 'c_ccls_init_options')},
\})

View File

@ -1,24 +0,0 @@
" Author: Masahiro H https://github.com/mshr-h
" Description: clang linter for c files
call ale#Set('c_clang_executable', 'clang')
call ale#Set('c_clang_options', '-std=c11 -Wall')
function! ale_linters#c#clang#GetCommand(buffer, output) abort
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
return '%e -S -x c -fsyntax-only'
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
\ . ale#Pad(l:cflags)
\ . ale#Pad(ale#Var(a:buffer, 'c_clang_options')) . ' -'
endfunction
call ale#linter#Define('c', {
\ 'name': 'clang',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'c_clang_executable')},
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#clang#GetCommand'))},
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
\})

View File

@ -5,14 +5,14 @@ call ale#Set('c_cppcheck_executable', 'cppcheck')
call ale#Set('c_cppcheck_options', '--enable=style')
function! ale_linters#c#cppcheck#GetCommand(buffer) abort
let l:cd_command = ale#handlers#cppcheck#GetCdCommand(a:buffer)
let l:compile_commands_option = ale#handlers#cppcheck#GetCompileCommandsOptions(a:buffer)
let l:buffer_path_include = empty(l:compile_commands_option)
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
\ : ''
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
return l:cd_command
\ . '%e -q --language=c'
return '%e -q --language=c'
\ . l:template
\ . ale#Pad(l:compile_commands_option)
\ . ale#Pad(ale#Var(a:buffer, 'c_cppcheck_options'))
\ . l:buffer_path_include
@ -23,6 +23,7 @@ call ale#linter#Define('c', {
\ 'name': 'cppcheck',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#Var(b, 'c_cppcheck_executable')},
\ 'cwd': function('ale#handlers#cppcheck#GetCwd'),
\ 'command': function('ale_linters#c#cppcheck#GetCommand'),
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
\})

20
ale_linters/c/cpplint.vim Normal file
View File

@ -0,0 +1,20 @@
" Author: Justin Huang <justin.y.huang@live.com>
" Description: cpplint for c files
call ale#Set('c_cpplint_executable', 'cpplint')
call ale#Set('c_cpplint_options', '')
function! ale_linters#c#cpplint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'c_cpplint_options')
return '%e' . ale#Pad(l:options) . ' %s'
endfunction
call ale#linter#Define('c', {
\ 'name': 'cpplint',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'c_cpplint_executable')},
\ 'command': function('ale_linters#c#cpplint#GetCommand'),
\ 'callback': 'ale#handlers#cpplint#HandleCppLintFormat',
\ 'lint_file': 1,
\})

5
ale_linters/c/cspell.vim Normal file
View File

@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for C files.
call ale#handlers#cspell#DefineLinter('c')

View File

@ -1,28 +0,0 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: gcc linter for c files
call ale#Set('c_gcc_executable', 'gcc')
call ale#Set('c_gcc_options', '-std=c11 -Wall')
function! ale_linters#c#gcc#GetCommand(buffer, output) abort
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
"
" `-o /dev/null` or `-o null` is needed to catch all errors,
" -fsyntax-only doesn't catch everything.
return '%e -S -x c'
\ . ' -o ' . g:ale#util#nul_file
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
\ . ale#Pad(l:cflags)
\ . ale#Pad(ale#Var(a:buffer, 'c_gcc_options')) . ' -'
endfunction
call ale#linter#Define('c', {
\ 'name': 'gcc',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'c_gcc_executable')},
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#gcc#GetCommand'))},
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
\})

View File

@ -0,0 +1,37 @@
" Author: 0xHyoga <0xHyoga@gmx.com>
" Description: Report starknet-compile errors in cairo code
call ale#Set('cairo_starknet_executable', 'starknet-compile')
call ale#Set('cairo_starknet_options', '')
function! ale_linters#cairo#starknet#Handle(buffer, lines) abort
" Error always on the first line
" e.g ex01.cairo:20:6: Could not find module 'contracts.utils.ex00_base'. Searched in the following paths:
let l:pattern = '\v\.cairo:(\d+):(\d+):+ (.*)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': str2nr(l:match[1]),
\ 'col': str2nr(l:match[2]),
\ 'type': 'E',
\ 'text': l:match[3],
\})
endfor
return l:output
endfunction
function! ale_linters#cairo#starknet#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'cairo_starknet_executable')
return l:executable . ale#Pad(ale#Var(a:buffer, 'cairo_starknet_options')) . ' %s'
endfunction
call ale#linter#Define('cairo', {
\ 'name': 'starknet',
\ 'executable': {b -> ale#Var(b, 'cairo_starknet_executable')},
\ 'command': function('ale_linters#cairo#starknet#GetCommand'),
\ 'callback': 'ale_linters#cairo#starknet#Handle',
\ 'output_stream': 'stderr',
\})

View File

@ -1,10 +1,22 @@
" Author: Masashi Iizuka <liquidz.uo@gmail.com>
" Description: linter for clojure using clj-kondo https://github.com/borkdude/clj-kondo
call ale#Set('clojure_clj_kondo_options', '--cache')
function! ale_linters#clojure#clj_kondo#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'clojure_clj_kondo_options')
let l:command = 'clj-kondo'
\ . ale#Pad(l:options)
\ . ' --lint %t'
return l:command
endfunction
function! ale_linters#clojure#clj_kondo#HandleCljKondoFormat(buffer, lines) abort
" output format
" <filename>:<line>:<column>: <issue type>: <message>
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+):? ((Exception|error|warning): ?(.+))$'
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+)?:(\d+)?:? ((Exception|error|warning): ?(.+))$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
@ -29,6 +41,6 @@ call ale#linter#Define('clojure', {
\ 'name': 'clj-kondo',
\ 'output_stream': 'stdout',
\ 'executable': 'clj-kondo',
\ 'command': 'clj-kondo --cache --lint %t',
\ 'command': function('ale_linters#clojure#clj_kondo#GetCommand'),
\ 'callback': 'ale_linters#clojure#clj_kondo#HandleCljKondoFormat',
\})

View File

@ -29,6 +29,7 @@ endfunction
call ale#linter#Define('cloudformation', {
\ 'name': 'cloudformation',
\ 'aliases': ['cfn-lint'],
\ 'executable': 'cfn-lint',
\ 'command': 'cfn-lint --template %t --format parseable',
\ 'callback': 'ale_linters#cloudformation#cfn_python_lint#Handle',

View File

@ -0,0 +1,43 @@
" Author: Carl Smedstad <carl.smedstad at protonmail dot com>
" Description: cmake-lint for cmake files
let g:ale_cmake_cmake_lint_executable =
\ get(g:, 'ale_cmake_cmake_lint_executable', 'cmake-lint')
let g:ale_cmake_cmake_lint_options =
\ get(g:, 'ale_cmake_cmake_lint_options', '')
function! ale_linters#cmake#cmake_lint#Executable(buffer) abort
return ale#Var(a:buffer, 'cmake_cmake_lint_executable')
endfunction
function! ale_linters#cmake#cmake_lint#Command(buffer) abort
let l:executable = ale_linters#cmake#cmake_lint#Executable(a:buffer)
let l:options = ale#Var(a:buffer, 'cmake_cmake_lint_options')
return ale#Escape(l:executable) . ' ' . l:options . ' %t'
endfunction
function! ale_linters#cmake#cmake_lint#Handle(buffer, lines) abort
let l:pattern = '\v^[^:]+:(\d+),?(\d+)?:\s\[([A-Z]\d+)\]\s(.+)$'
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': 'W',
\ 'code': l:match[3],
\ 'text': l:match[4],
\})
endfor
return l:output
endfunction
call ale#linter#Define('cmake', {
\ 'name': 'cmake_lint',
\ 'executable': function('ale_linters#cmake#cmake_lint#Executable'),
\ 'command': function('ale_linters#cmake#cmake_lint#Command'),
\ 'callback': 'ale_linters#cmake#cmake_lint#Handle',
\})

53
ale_linters/cpp/cc.vim Normal file
View File

@ -0,0 +1,53 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: A C++ compiler linter for C++ files with gcc/clang, etc.
call ale#Set('cpp_cc_executable', '<auto>')
call ale#Set('cpp_cc_options', '-std=c++14 -Wall')
function! ale_linters#cpp#cc#GetExecutable(buffer) abort
let l:executable = ale#Var(a:buffer, 'cpp_cc_executable')
" Default to either clang++ or gcc.
if l:executable is# '<auto>'
if ale#engine#IsExecutable(a:buffer, 'clang++')
let l:executable = 'clang++'
else
let l:executable = 'gcc'
endif
endif
return l:executable
endfunction
function! ale_linters#cpp#cc#GetCommand(buffer, output) abort
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
let l:ale_flags = ale#Var(a:buffer, 'cpp_cc_options')
if l:cflags =~# '-std='
let l:ale_flags = substitute(
\ l:ale_flags,
\ '-std=\(c\|gnu\)++[0-9]\{2\}',
\ '',
\ 'g')
endif
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
"
" `-o /dev/null` or `-o null` is needed to catch all errors,
" -fsyntax-only doesn't catch everything.
return '%e -S -x c++'
\ . ' -o ' . g:ale#util#nul_file
\ . ' -iquote %s:h'
\ . ale#Pad(l:cflags)
\ . ale#Pad(l:ale_flags) . ' -'
endfunction
call ale#linter#Define('cpp', {
\ 'name': 'cc',
\ 'aliases': ['gcc', 'clang', 'g++', 'clang++'],
\ 'output_stream': 'stderr',
\ 'executable': function('ale_linters#cpp#cc#GetExecutable'),
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#cc#GetCommand'))},
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
\})

View File

@ -3,6 +3,7 @@
call ale#Set('cpp_ccls_executable', 'ccls')
call ale#Set('cpp_ccls_init_options', {})
call ale#Set('c_build_dir', '')
call ale#linter#Define('cpp', {
\ 'name': 'ccls',
@ -10,5 +11,5 @@ call ale#linter#Define('cpp', {
\ 'executable': {b -> ale#Var(b, 'cpp_ccls_executable')},
\ 'command': '%e',
\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'),
\ 'initialization_options': {b -> ale#Var(b, 'cpp_ccls_init_options')},
\ 'initialization_options': {b -> ale#handlers#ccls#GetInitOpts(b, 'cpp_ccls_init_options')},
\})

View File

@ -1,24 +0,0 @@
" Author: Tomota Nakamura <https://github.com/tomotanakamura>
" Description: clang linter for cpp files
call ale#Set('cpp_clang_executable', 'clang++')
call ale#Set('cpp_clang_options', '-std=c++14 -Wall')
function! ale_linters#cpp#clang#GetCommand(buffer, output) abort
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
return '%e -S -x c++ -fsyntax-only'
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
\ . ale#Pad(l:cflags)
\ . ale#Pad(ale#Var(a:buffer, 'cpp_clang_options')) . ' -'
endfunction
call ale#linter#Define('cpp', {
\ 'name': 'clang',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'cpp_clang_executable')},
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#clang#GetCommand'))},
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
\})

View File

@ -23,6 +23,13 @@ function! ale_linters#cpp#clangtidy#GetCommand(buffer, output) abort
let l:options = ale#Var(a:buffer, 'cpp_clangtidy_options')
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
let l:options .= !empty(l:options) ? ale#Pad(l:cflags) : l:cflags
" Tell clang-tidy a .h header with a C++ filetype in Vim is a C++ file
" only when compile-commands.json file is not there. Adding these
" flags makes clang-tidy completely ignore compile commmands.
if expand('#' . a:buffer) =~# '\.h$'
let l:options .= !empty(l:options) ? ' -x c++' : '-x c++'
endif
endif
" Get the options to pass directly to clang-tidy

View File

@ -5,14 +5,14 @@ call ale#Set('cpp_cppcheck_executable', 'cppcheck')
call ale#Set('cpp_cppcheck_options', '--enable=style')
function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
let l:cd_command = ale#handlers#cppcheck#GetCdCommand(a:buffer)
let l:compile_commands_option = ale#handlers#cppcheck#GetCompileCommandsOptions(a:buffer)
let l:buffer_path_include = empty(l:compile_commands_option)
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
\ : ''
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
return l:cd_command
\ . '%e -q --language=c++'
return '%e -q --language=c++'
\ . l:template
\ . ale#Pad(l:compile_commands_option)
\ . ale#Pad(ale#Var(a:buffer, 'cpp_cppcheck_options'))
\ . l:buffer_path_include
@ -23,6 +23,7 @@ call ale#linter#Define('cpp', {
\ 'name': 'cppcheck',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#Var(b, 'cpp_cppcheck_executable')},
\ 'cwd': function('ale#handlers#cppcheck#GetCwd'),
\ 'command': function('ale_linters#cpp#cppcheck#GetCommand'),
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
\})

View File

@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for C++ files.
call ale#handlers#cspell#DefineLinter('cpp')

View File

@ -1,29 +0,0 @@
" Author: geam <mdelage@student.42.fr>
" Description: gcc linter for cpp files
"
call ale#Set('cpp_gcc_executable', 'gcc')
call ale#Set('cpp_gcc_options', '-std=c++14 -Wall')
function! ale_linters#cpp#gcc#GetCommand(buffer, output) abort
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
"
" `-o /dev/null` or `-o null` is needed to catch all errors,
" -fsyntax-only doesn't catch everything.
return '%e -S -x c++'
\ . ' -o ' . g:ale#util#nul_file
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
\ . ale#Pad(l:cflags)
\ . ale#Pad(ale#Var(a:buffer, 'cpp_gcc_options')) . ' -'
endfunction
call ale#linter#Define('cpp', {
\ 'name': 'gcc',
\ 'aliases': ['g++'],
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'cpp_gcc_executable')},
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#gcc#GetCommand'))},
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
\})

View File

@ -3,14 +3,10 @@ call ale#Set('cs_csc_source', '')
call ale#Set('cs_csc_assembly_path', [])
call ale#Set('cs_csc_assemblies', [])
function! s:GetWorkingDirectory(buffer) abort
let l:working_directory = ale#Var(a:buffer, 'cs_csc_source')
function! ale_linters#cs#csc#GetCwd(buffer) abort
let l:cwd = ale#Var(a:buffer, 'cs_csc_source')
if !empty(l:working_directory)
return l:working_directory
endif
return expand('#' . a:buffer . ':p:h')
return !empty(l:cwd) ? l:cwd : expand('#' . a:buffer . ':p:h')
endfunction
function! ale_linters#cs#csc#GetCommand(buffer) abort
@ -34,8 +30,7 @@ function! ale_linters#cs#csc#GetCommand(buffer) abort
" The code is compiled as a module and the output is redirected to a
" temporary file.
return ale#path#CdString(s:GetWorkingDirectory(a:buffer))
\ . 'csc /unsafe'
return 'csc /unsafe'
\ . ale#Pad(ale#Var(a:buffer, 'cs_csc_options'))
\ . ale#Pad(l:lib_option)
\ . ale#Pad(l:r_option)
@ -57,8 +52,7 @@ function! ale_linters#cs#csc#Handle(buffer, lines) abort
\ '^\v([^ ]+)\s+([Cc][sS][^ ]+):\s+(.+)$',
\]
let l:output = []
let l:dir = s:GetWorkingDirectory(a:buffer)
let l:dir = ale_linters#cs#csc#GetCwd(a:buffer)
for l:match in ale#util#GetMatches(a:lines, l:patterns)
if len(l:match) > 6 && strlen(l:match[5]) > 2 && l:match[5][:1] is? 'CS'
@ -89,6 +83,7 @@ call ale#linter#Define('cs',{
\ 'name': 'csc',
\ 'output_stream': 'stdout',
\ 'executable': 'csc',
\ 'cwd': function('ale_linters#cs#csc#GetCwd'),
\ 'command': function('ale_linters#cs#csc#GetCommand'),
\ 'callback': 'ale_linters#cs#csc#Handle',
\ 'lint_file': 1

View File

@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for C# files.
call ale#handlers#cspell#DefineLinter('cs')

View File

@ -3,14 +3,10 @@ call ale#Set('cs_mcsc_source', '')
call ale#Set('cs_mcsc_assembly_path', [])
call ale#Set('cs_mcsc_assemblies', [])
function! s:GetWorkingDirectory(buffer) abort
let l:working_directory = ale#Var(a:buffer, 'cs_mcsc_source')
function! ale_linters#cs#mcsc#GetCwd(buffer) abort
let l:cwd = ale#Var(a:buffer, 'cs_mcsc_source')
if !empty(l:working_directory)
return l:working_directory
endif
return expand('#' . a:buffer . ':p:h')
return !empty(l:cwd) ? l:cwd : expand('#' . a:buffer . ':p:h')
endfunction
function! ale_linters#cs#mcsc#GetCommand(buffer) abort
@ -34,8 +30,7 @@ function! ale_linters#cs#mcsc#GetCommand(buffer) abort
" The code is compiled as a module and the output is redirected to a
" temporary file.
return ale#path#CdString(s:GetWorkingDirectory(a:buffer))
\ . 'mcs -unsafe'
return 'mcs -unsafe'
\ . ale#Pad(ale#Var(a:buffer, 'cs_mcsc_options'))
\ . ale#Pad(l:lib_option)
\ . ale#Pad(l:r_option)
@ -58,7 +53,7 @@ function! ale_linters#cs#mcsc#Handle(buffer, lines) abort
\]
let l:output = []
let l:dir = s:GetWorkingDirectory(a:buffer)
let l:dir = ale_linters#cs#mcsc#GetCwd(a:buffer)
for l:match in ale#util#GetMatches(a:lines, l:patterns)
if len(l:match) > 6 && strlen(l:match[5]) > 2 && l:match[5][:1] is? 'CS'
@ -89,6 +84,7 @@ call ale#linter#Define('cs',{
\ 'name': 'mcsc',
\ 'output_stream': 'stderr',
\ 'executable': 'mcs',
\ 'cwd': function('ale_linters#cs#mcsc#GetCwd'),
\ 'command': function('ale_linters#cs#mcsc#GetCommand'),
\ 'callback': 'ale_linters#cs#mcsc#Handle',
\ 'lint_file': 1

View File

@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for CSS files.
call ale#handlers#cspell#DefineLinter('css')

View File

@ -11,7 +11,7 @@ endfunction
call ale#linter#Define('css', {
\ 'name': 'stylelint',
\ 'executable': {b -> ale#node#FindExecutable(b, 'css_stylelint', [
\ 'executable': {b -> ale#path#FindExecutable(b, 'css_stylelint', [
\ 'node_modules/.bin/stylelint',
\ ])},
\ 'command': function('ale_linters#css#stylelint#GetCommand'),

View File

@ -0,0 +1,16 @@
" Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
" Description: VSCode css language server
function! ale_linters#css#vscodecss#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
endfunction
call ale#linter#Define('css', {
\ 'name': 'vscodecss',
\ 'lsp': 'stdio',
\ 'executable': 'vscode-css-language-server',
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#css#vscodecss#GetProjectRoot'),
\})

View File

@ -0,0 +1,23 @@
" Author: Tommy Chiang <ty1208chiang@gmail.com>
" Description: Clangd language server for CUDA (modified from Andrey
" Melentyev's implementation for C++)
call ale#Set('cuda_clangd_executable', 'clangd')
call ale#Set('cuda_clangd_options', '')
call ale#Set('c_build_dir', '')
function! ale_linters#cuda#clangd#GetCommand(buffer) abort
let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
return '%e'
\ . ale#Pad(ale#Var(a:buffer, 'cuda_clangd_options'))
\ . (!empty(l:build_dir) ? ' -compile-commands-dir=' . ale#Escape(l:build_dir) : '')
endfunction
call ale#linter#Define('cuda', {
\ 'name': 'clangd',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'cuda_clangd_executable')},
\ 'command': function('ale_linters#cuda#clangd#GetCommand'),
\ 'project_root': function('ale#c#FindProjectRoot'),
\})

View File

@ -5,9 +5,6 @@ call ale#Set('cuda_nvcc_executable', 'nvcc')
call ale#Set('cuda_nvcc_options', '-std=c++11')
function! ale_linters#cuda#nvcc#GetCommand(buffer) abort
" Unused: use ale#util#nul_file
" let l:output_file = ale#util#Tempname() . '.ii'
" call ale#command#ManageFile(a:buffer, l:output_file)
return '%e -cuda'
\ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
\ . ale#Pad(ale#Var(a:buffer, 'cuda_nvcc_options'))

View File

@ -1,64 +1,106 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: "dmd for D files"
function! ale_linters#d#dmd#GetDUBCommand(buffer) abort
function! s:GetDUBCommand(buffer) abort
" If we can't run dub, then skip this command.
if !executable('dub')
if executable('dub')
" Returning an empty string skips to the DMD command.
return ''
let l:config = ale#d#FindDUBConfig(a:buffer)
" To support older dub versions, we just change the directory to the
" directory where we found the dub config, and then run `dub describe`
" from that directory.
if !empty(l:config)
return [fnamemodify(l:config, ':h'), 'dub describe --data-list
\ --data=import-paths
\ --data=string-import-paths
\ --data=versions
\ --data=debug-versions
\']
endif
endif
let l:dub_file = ale#d#FindDUBConfig(a:buffer)
if empty(l:dub_file)
return ''
endif
" To support older dub versions, we just change the directory to
" the directory where we found the dub config, and then run `dub describe`
" from that directory.
return 'cd ' . ale#Escape(fnamemodify(l:dub_file, ':h'))
\ . ' && dub describe --import-paths'
return ['', '']
endfunction
function! ale_linters#d#dmd#RunDUBCommand(buffer) abort
let l:command = ale_linters#d#dmd#GetDUBCommand(a:buffer)
let [l:cwd, l:command] = s:GetDUBCommand(a:buffer)
if empty(l:command)
" If we can't run DUB, just run DMD.
return ale_linters#d#dmd#DMDCommand(a:buffer, [], {})
endif
return ale#command#Run(a:buffer, l:command, function('ale_linters#d#dmd#DMDCommand'))
return ale#command#Run(
\ a:buffer,
\ l:command,
\ function('ale_linters#d#dmd#DMDCommand'),
\ {'cwd': l:cwd},
\)
endfunction
function! ale_linters#d#dmd#DMDCommand(buffer, dub_output, meta) abort
let l:import_list = []
let l:str_import_list = []
let l:versions_list = []
let l:deb_versions_list = []
let l:list_ind = 1
let l:seen_line = 0
" Build a list of import paths generated from DUB, if available.
" Build a list of options generated from DUB, if available.
" DUB output each path or version on a single line.
" Each list is separated by a blank line.
" Empty list are represented by a blank line (followed and/or
" preceded by a separation blank line)
for l:line in a:dub_output
" line still has end of line char on windows
let l:line = substitute(l:line, '[\r\n]*$', '', '')
if !empty(l:line)
" The arguments must be '-Ifilename', not '-I filename'
call add(l:import_list, '-I' . ale#Escape(l:line))
if l:list_ind == 1
call add(l:import_list, '-I' . ale#Escape(l:line))
elseif l:list_ind == 2
call add(l:str_import_list, '-J' . ale#Escape(l:line))
elseif l:list_ind == 3
call add(l:versions_list, '-version=' . ale#Escape(l:line))
elseif l:list_ind == 4
call add(l:deb_versions_list, '-debug=' . ale#Escape(l:line))
endif
let l:seen_line = 1
elseif !l:seen_line
" if list is empty must skip one empty line
let l:seen_line = 1
else
let l:seen_line = 0
let l:list_ind += 1
endif
endfor
return 'dmd '. join(l:import_list) . ' -o- -wi -vcolumns -c %t'
return 'dmd ' . join(l:import_list) . ' ' .
\ join(l:str_import_list) . ' ' .
\ join(l:versions_list) . ' ' .
\ join(l:deb_versions_list) . ' -o- -wi -vcolumns -c %t'
endfunction
function! ale_linters#d#dmd#Handle(buffer, lines) abort
" Matches patterns lines like the following:
" /tmp/tmp.qclsa7qLP7/file.d(1): Error: function declaration without return type. (Note that constructors are always named 'this')
" /tmp/tmp.G1L5xIizvB.d(8,8): Error: module weak_reference is in file 'dstruct/weak_reference.d' which cannot be read
let l:pattern = '^[^(]\+(\([0-9]\+\)\,\?\([0-9]*\)): \([^:]\+\): \(.\+\)'
let l:pattern = '\v^(\f+)\((\d+)(,(\d+))?\): (\w+): (.+)$'
let l:output = []
let l:dir = expand('#' . a:buffer . ':p:h')
for l:match in ale#util#GetMatches(a:lines, l:pattern)
" If dmd was invoked with relative path, match[1] is relative, otherwise it is absolute.
" As we invoke dmd with the buffer path (in /tmp), this will generally be absolute already
let l:fname = ale#path#GetAbsPath(l:dir, l:match[1])
call add(l:output, {
\ 'lnum': l:match[1],
\ 'col': l:match[2],
\ 'type': l:match[3] is# 'Warning' ? 'W' : 'E',
\ 'text': l:match[4],
\ 'filename': l:fname,
\ 'lnum': l:match[2],
\ 'col': l:match[4],
\ 'type': l:match[5] is# 'Warning' || l:match[5] is# 'Deprecation' ? 'W' : 'E',
\ 'text': l:match[6],
\})
endfor

View File

@ -6,7 +6,7 @@ function! ale_linters#dafny#dafny#Handle(buffer, lines) abort
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'filename': l:match[1],
\ 'col': l:match[3] + 0,
\ 'lnum': l:match[2] + 0,
\ 'text': l:match[5],
@ -14,13 +14,28 @@ function! ale_linters#dafny#dafny#Handle(buffer, lines) abort
\ })
endfor
for l:match in ale#util#GetMatches(a:lines, '\v(.*)\((\d+),(\d+)\): (Verification of .{-} timed out after \d+ seconds)')
call add(l:output, {
\ 'filename': l:match[1],
\ 'col': l:match[3] + 0,
\ 'lnum': l:match[2] + 0,
\ 'text': l:match[4],
\ 'type': 'E',
\ })
endfor
return l:output
endfunction
function! ale_linters#dafny#dafny#GetCommand(buffer) abort
return printf('dafny %%s /compile:0 /timeLimit:%d', ale#Var(a:buffer, 'dafny_dafny_timelimit'))
endfunction
call ale#Set('dafny_dafny_timelimit', 10)
call ale#linter#Define('dafny', {
\ 'name': 'dafny',
\ 'executable': 'dafny',
\ 'command': 'dafny %s /compile:0',
\ 'command': function('ale_linters#dafny#dafny#GetCommand'),
\ 'callback': 'ale_linters#dafny#dafny#Handle',
\ 'lint_file': 1,
\ })

View File

@ -0,0 +1,29 @@
" Author: Nelson Yeung <nelsyeung@gmail.com>
" Description: Check Dart files with dart analysis server LSP
call ale#Set('dart_analysis_server_executable', 'dart')
function! ale_linters#dart#analysis_server#GetProjectRoot(buffer) abort
" Note: pub only looks for pubspec.yaml, there's no point in adding
" support for pubspec.yml
let l:pubspec = ale#path#FindNearestFile(a:buffer, 'pubspec.yaml')
return !empty(l:pubspec) ? fnamemodify(l:pubspec, ':h:h') : '.'
endfunction
function! ale_linters#dart#analysis_server#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'dart_analysis_server_executable')
let l:dart = resolve(exepath(l:executable))
return '%e '
\ . fnamemodify(l:dart, ':h') . '/snapshots/analysis_server.dart.snapshot'
\ . ' --lsp'
endfunction
call ale#linter#Define('dart', {
\ 'name': 'analysis_server',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'dart_analysis_server_executable')},
\ 'command': function('ale_linters#dart#analysis_server#GetCommand'),
\ 'project_root': function('ale_linters#dart#analysis_server#GetProjectRoot'),
\})

View File

@ -0,0 +1,29 @@
" Author: ghsang <gwonhyuksang@gmail.com>
" Description: Check Dart files with dart analyze
call ale#Set('dart_analyze_executable', 'dart')
function! ale_linters#dart#dart_analyze#Handle(buffer, lines) abort
let l:pattern = '\v([a-z]+) - (.+):(\d+):(\d+) - (.+) - (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let [l:type, l:filename, l:lnum, l:col, l:message, l:code] = l:match[1:6]
call add(l:output, {
\ 'type': l:type is# 'error' ? 'E' : l:type is# 'info' ? 'I' : 'W',
\ 'text': l:code . ': ' . l:message,
\ 'lnum': str2nr(l:lnum),
\ 'col': str2nr(l:col),
\})
endfor
return l:output
endfunction
call ale#linter#Define('dart', {
\ 'name': 'dart_analyze',
\ 'executable': {b -> ale#Var(b, 'dart_analyze_executable')},
\ 'command': '%e analyze --fatal-infos %s',
\ 'callback': 'ale_linters#dart#dart_analyze#Handle',
\ 'lint_file': 1,
\})

View File

@ -1,36 +0,0 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: Check Dart files with dartanalyzer
call ale#Set('dart_dartanalyzer_executable', 'dartanalyzer')
function! ale_linters#dart#dartanalyzer#GetCommand(buffer) abort
let l:path = ale#path#FindNearestFile(a:buffer, '.packages')
return '%e'
\ . (!empty(l:path) ? ' --packages ' . ale#Escape(l:path) : '')
\ . ' %s'
endfunction
function! ale_linters#dart#dartanalyzer#Handle(buffer, lines) abort
let l:pattern = '\v^ ([a-z]+) . (.+) at (.+):(\d+):(\d+) . (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'type': l:match[1] is# 'error' ? 'E' : 'W',
\ 'text': l:match[6] . ': ' . l:match[2],
\ 'lnum': str2nr(l:match[4]),
\ 'col': str2nr(l:match[5]),
\})
endfor
return l:output
endfunction
call ale#linter#Define('dart', {
\ 'name': 'dartanalyzer',
\ 'executable': {b -> ale#Var(b, 'dart_dartanalyzer_executable')},
\ 'command': function('ale_linters#dart#dartanalyzer#GetCommand'),
\ 'callback': 'ale_linters#dart#dartanalyzer#Handle',
\ 'lint_file': 1,
\})

View File

@ -0,0 +1,31 @@
call ale#Set('desktop_desktop_file_validate_options', '')
" Example matches for pattern:
"
" foo.desktop: warning: key "TerminalOptions" in group ...
" foo.desktop: error: action "new-private-window" is defined, ...
let s:pattern = '\v^(.+): ([a-z]+): (.+)$'
function! ale_linters#desktop#desktop_file_validate#Handle(buffer, lines) abort
" The error format doesn't specify lines, so we can just put all of the
" errors on line 1.
return ale#util#MapMatches(a:lines, s:pattern, {match -> {
\ 'lnum': 1,
\ 'col': 1,
\ 'type': match[2] is? 'error' ? 'E' : 'W',
\ 'text': match[3],
\}})
endfunction
call ale#linter#Define('desktop', {
\ 'name': 'desktop_file_validate',
\ 'aliases': ['desktop-file-validate'],
\ 'executable': 'desktop-file-validate',
\ 'command': {b ->
\ '%e'
\ . ale#Pad(ale#Var(b, 'desktop_desktop_file_validate_options'))
\ . ' %t'
\ },
\ 'callback': 'ale_linters#desktop#desktop_file_validate#Handle',
\ 'output_stream': 'both',
\})

View File

@ -32,14 +32,29 @@ function! ale_linters#dockerfile#dockerfile_lint#Handle(buffer, lines) abort
let l:line = get(l:object, 'line', -1)
let l:message = l:object['message']
if get(l:object, 'description', 'None') isnot# 'None'
let l:message = l:message . '. ' . l:object['description']
let l:link = get(l:object, 'reference_url', '')
if type(l:link) == v:t_list
" Somehow, reference_url is returned as two-part list.
" Anchor markers in that list are sometimes duplicated.
" See https://github.com/projectatomic/dockerfile_lint/issues/134
let l:link = join(l:link, '')
let l:link = substitute(l:link, '##', '#', '')
endif
let l:detail = l:message
if get(l:object, 'description', 'None') isnot# 'None'
let l:detail .= "\n\n" . l:object['description']
endif
let l:detail .= "\n\n" . l:link
call add(l:messages, {
\ 'lnum': l:line,
\ 'text': l:message,
\ 'type': ale_linters#dockerfile#dockerfile_lint#GetType(l:type),
\ 'detail': l:detail,
\})
endfor
endfor

View File

@ -7,9 +7,9 @@ call ale#Set('dockerfile_hadolint_docker_image', 'hadolint/hadolint')
function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" /dev/stdin:19 DL3001 Pipe chain should start with a raw value.
" -:19 DL3001 warning: Pipe chain should start with a raw value.
" /dev/stdin:19:3 unexpected thing
let l:pattern = '\v^/dev/stdin:(\d+):?(\d+)? ((DL|SC)(\d+) )?(.+)$'
let l:pattern = '\v^%(/dev/stdin|-):(\d+):?(\d+)? ((DL|SC)(\d+) )?((.+)?: )?(.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
@ -24,10 +24,22 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
let l:colnum = l:match[2] + 0
endif
let l:type = 'W'
let l:text = l:match[6]
let l:detail = l:match[6]
" Shellcheck knows a 'style' severity - pin it to info level as well.
if l:match[7] is# 'style'
let l:type = 'I'
elseif l:match[7] is# 'info'
let l:type = 'I'
elseif l:match[7] is# 'warning'
let l:type = 'W'
else
let l:type = 'E'
endif
let l:text = l:match[8]
let l:detail = l:match[8]
let l:domain = 'https://github.com/hadolint/hadolint/wiki/'
let l:code = ''
let l:link = ''
if l:match[4] is# 'SC'
let l:domain = 'https://github.com/koalaman/shellcheck/wiki/'
@ -36,18 +48,26 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
if l:match[5] isnot# ''
let l:code = l:match[4] . l:match[5]
let l:link = ' ( ' . l:domain . l:code . ' )'
let l:text = l:code . ': ' . l:detail
let l:detail = l:code . l:link . "\n\n" . l:detail
else
let l:type = 'E'
let l:detail = 'hadolint could not parse the file because of a syntax error.'
endif
call add(l:output, {
let l:line_output = {
\ 'lnum': l:lnum,
\ 'col': l:colnum,
\ 'type': l:type,
\ 'text': l:text,
\ 'detail': l:detail
\})
\}
if l:code isnot# ''
let l:line_output['code'] = l:code
endif
call add(l:output, l:line_output)
endfor
return l:output
@ -82,12 +102,15 @@ endfunction
function! ale_linters#dockerfile#hadolint#GetCommand(buffer) abort
let l:command = ale_linters#dockerfile#hadolint#GetExecutable(a:buffer)
let l:opts = '--no-color -'
if l:command is# 'docker'
return 'docker run --rm -i ' . ale#Var(a:buffer, 'dockerfile_hadolint_docker_image')
return printf('docker run --rm -i %s hadolint %s',
\ ale#Var(a:buffer, 'dockerfile_hadolint_docker_image'),
\ l:opts)
endif
return 'hadolint -'
return 'hadolint ' . l:opts
endfunction

View File

@ -45,19 +45,27 @@ function! ale_linters#elixir#credo#GetMode() abort
endif
endfunction
function! ale_linters#elixir#credo#GetCommand(buffer) abort
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
let l:mode = ale_linters#elixir#credo#GetMode()
function! ale_linters#elixir#credo#GetConfigFile() abort
let l:config_file = get(g:, 'ale_elixir_credo_config_file', '')
return ale#path#CdString(l:project_root)
\ . 'mix help credo && '
if empty(l:config_file)
return ''
endif
return ' --config-file ' . l:config_file
endfunction
function! ale_linters#elixir#credo#GetCommand(buffer) abort
return 'mix help credo && '
\ . 'mix credo ' . ale_linters#elixir#credo#GetMode()
\ . ale_linters#elixir#credo#GetConfigFile()
\ . ' --format=flycheck --read-from-stdin %s'
endfunction
call ale#linter#Define('elixir', {
\ 'name': 'credo',
\ 'executable': 'mix',
\ 'cwd': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
\ 'command': function('ale_linters#elixir#credo#GetCommand'),
\ 'callback': 'ale_linters#elixir#credo#Handle',
\})

View File

@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for Elixir files.
call ale#handlers#cspell#DefineLinter('elixir')

View File

@ -25,17 +25,10 @@ function! ale_linters#elixir#dialyxir#Handle(buffer, lines) abort
return l:output
endfunction
function! ale_linters#elixir#dialyxir#GetCommand(buffer) abort
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
return ale#path#CdString(l:project_root)
\ . ' mix help dialyzer && mix dialyzer'
endfunction
call ale#linter#Define('elixir', {
\ 'name': 'dialyxir',
\ 'executable': 'mix',
\ 'command': function('ale_linters#elixir#dialyxir#GetCommand'),
\ 'cwd': function('ale#handlers#elixir#FindMixProjectRoot'),
\ 'command': 'mix help dialyzer && mix dialyzer',
\ 'callback': 'ale_linters#elixir#dialyxir#Handle',
\})

View File

@ -29,17 +29,11 @@ function! ale_linters#elixir#dogma#Handle(buffer, lines) abort
return l:output
endfunction
function! ale_linters#elixir#dogma#GetCommand(buffer) abort
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
return ale#path#CdString(l:project_root)
\ . ' mix help dogma && mix dogma %s --format=flycheck'
endfunction
call ale#linter#Define('elixir', {
\ 'name': 'dogma',
\ 'executable': 'mix',
\ 'command': function('ale_linters#elixir#dogma#GetCommand'),
\ 'cwd': function('ale#handlers#elixir#FindMixProjectRoot'),
\ 'command': 'mix help dogma && mix dogma %s --format=flycheck',
\ 'lint_file': 1,
\ 'callback': 'ale_linters#elixir#dogma#Handle',
\})

View File

@ -30,22 +30,15 @@ function! ale_linters#elixir#mix#Handle(buffer, lines) abort
endfunction
function! ale_linters#elixir#mix#GetCommand(buffer) abort
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
let l:temp_dir = ale#command#CreateDirectory(a:buffer)
let l:mix_build_path = has('win32')
\ ? 'set MIX_BUILD_PATH=' . ale#Escape(l:temp_dir) . ' &&'
\ : 'MIX_BUILD_PATH=' . ale#Escape(l:temp_dir)
return ale#path#CdString(l:project_root)
\ . l:mix_build_path
\ . ' mix compile %s'
return ale#Env('MIX_BUILD_PATH', l:temp_dir) . 'mix compile %s'
endfunction
call ale#linter#Define('elixir', {
\ 'name': 'mix',
\ 'executable': 'mix',
\ 'cwd': function('ale#handlers#elixir#FindMixProjectRoot'),
\ 'command': function('ale_linters#elixir#mix#GetCommand'),
\ 'callback': 'ale_linters#elixir#mix#Handle',
\ 'lint_file': 1,

View File

@ -28,7 +28,7 @@ endfunction
call ale#linter#Define('elm', {
\ 'name': 'elm_ls',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#node#FindExecutable(b, 'elm_ls', [
\ 'executable': {b -> ale#path#FindExecutable(b, 'elm_ls', [
\ 'node_modules/.bin/elm-language-server',
\ 'node_modules/.bin/elm-lsp',
\ 'elm-lsp'

View File

@ -186,24 +186,23 @@ function! ale_linters#elm#make#IsTest(buffer) abort
endif
endfunction
function! ale_linters#elm#make#GetCwd(buffer) abort
let l:root_dir = ale_linters#elm#make#GetRootDir(a:buffer)
return !empty(l:root_dir) ? l:root_dir : ''
endfunction
" Return the command to execute the linter in the projects directory.
" If it doesn't, then this will fail when imports are needed.
function! ale_linters#elm#make#GetCommand(buffer) abort
let l:executable = ale_linters#elm#make#GetExecutable(a:buffer)
let l:root_dir = ale_linters#elm#make#GetRootDir(a:buffer)
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
let l:is_using_elm_test = l:executable =~# 'elm-test$'
if empty(l:root_dir)
let l:dir_set_cmd = ''
else
let l:dir_set_cmd = 'cd ' . ale#Escape(l:root_dir) . ' && '
endif
" elm-test needs to know the path of elm-make if elm isn't installed globally.
" https://github.com/rtfeldman/node-test-runner/blob/57728f10668f2d2ab3179e7e3208bcfa9a1f19aa/README.md#--compiler
if l:is_v19 && l:is_using_elm_test
let l:elm_make_executable = ale#node#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
let l:elm_make_executable = ale#path#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
let l:elm_test_compiler_flag = ' --compiler ' . l:elm_make_executable . ' '
else
let l:elm_test_compiler_flag = ' '
@ -213,7 +212,9 @@ function! ale_linters#elm#make#GetCommand(buffer) abort
" a sort of flag to tell the compiler not to generate an output file,
" which is why this is hard coded here.
" Source: https://github.com/elm-lang/elm-compiler/blob/19d5a769b30ec0b2fc4475985abb4cd94cd1d6c3/builder/src/Generate/Output.hs#L253
return l:dir_set_cmd . '%e make --report=json --output=/dev/null' . l:elm_test_compiler_flag . '%t'
return '%e make --report=json --output=/dev/null'
\ . l:elm_test_compiler_flag
\ . '%t'
endfunction
function! ale_linters#elm#make#GetExecutable(buffer) abort
@ -221,13 +222,13 @@ function! ale_linters#elm#make#GetExecutable(buffer) abort
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
if l:is_test && l:is_v19
return ale#node#FindExecutable(
return ale#path#FindExecutable(
\ a:buffer,
\ 'elm_make',
\ ['node_modules/.bin/elm-test', 'node_modules/.bin/elm']
\)
else
return ale#node#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
return ale#path#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
endif
endfunction
@ -235,6 +236,7 @@ call ale#linter#Define('elm', {
\ 'name': 'make',
\ 'executable': function('ale_linters#elm#make#GetExecutable'),
\ 'output_stream': 'both',
\ 'cwd': function('ale_linters#elm#make#GetCwd'),
\ 'command': function('ale_linters#elm#make#GetCommand'),
\ 'callback': 'ale_linters#elm#make#Handle'
\})

View File

@ -3,6 +3,11 @@
let g:ale_erlang_dialyzer_executable =
\ get(g:, 'ale_erlang_dialyzer_executable', 'dialyzer')
let g:ale_erlang_dialyzer_options =
\ get(g:, 'ale_erlang_dialyzer_options', '-Wunmatched_returns'
\ . ' -Werror_handling'
\ . ' -Wrace_conditions'
\ . ' -Wunderspecs')
let g:ale_erlang_dialyzer_plt_file =
\ get(g:, 'ale_erlang_dialyzer_plt_file', '')
let g:ale_erlang_dialyzer_rebar3_profile =
@ -47,13 +52,12 @@ function! ale_linters#erlang#dialyzer#GetExecutable(buffer) abort
endfunction
function! ale_linters#erlang#dialyzer#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'erlang_dialyzer_options')
let l:command = ale#Escape(ale_linters#erlang#dialyzer#GetExecutable(a:buffer))
\ . ' -n'
\ . ' --plt ' . ale#Escape(ale_linters#erlang#dialyzer#GetPlt(a:buffer))
\ . ' -Wunmatched_returns'
\ . ' -Werror_handling'
\ . ' -Wrace_conditions'
\ . ' -Wunderspecs'
\ . ' ' . l:options
\ . ' %s'
return l:command

View File

@ -0,0 +1,40 @@
" Author: Dmitri Vereshchagin <dmitri.vereshchagin@gmail.com>
" Description: Elvis linter for Erlang files
call ale#Set('erlang_elvis_executable', 'elvis')
function! ale_linters#erlang#elvis#Handle(buffer, lines) abort
let l:pattern = '\v:(\d+):[^:]+:(.+)'
let l:loclist = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:loclist, {
\ 'lnum': str2nr(l:match[1]),
\ 'text': s:AbbreviateMessage(l:match[2]),
\ 'type': 'W',
\ 'sub_type': 'style',
\})
endfor
return l:loclist
endfunction
function! s:AbbreviateMessage(text) abort
let l:pattern = '\v\c^(line \d+ is too long):.*$'
return substitute(a:text, l:pattern, '\1.', '')
endfunction
function! s:GetCommand(buffer) abort
let l:file = ale#Escape(expand('#' . a:buffer . ':.'))
return '%e rock --output-format=parsable ' . l:file
endfunction
call ale#linter#Define('erlang', {
\ 'name': 'elvis',
\ 'callback': 'ale_linters#erlang#elvis#Handle',
\ 'executable': {b -> ale#Var(b, 'erlang_elvis_executable')},
\ 'command': function('s:GetCommand'),
\ 'lint_file': 1,
\})

View File

@ -1,14 +1,22 @@
" Author: Magnus Ottenklinger - https://github.com/evnu
let g:ale_erlang_erlc_executable = get(g:, 'ale_erlang_erlc_executable', 'erlc')
let g:ale_erlang_erlc_options = get(g:, 'ale_erlang_erlc_options', '')
function! ale_linters#erlang#erlc#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'erlang_erlc_executable')
endfunction
function! ale_linters#erlang#erlc#GetCommand(buffer) abort
let l:output_file = ale#util#Tempname()
call ale#command#ManageFile(a:buffer, l:output_file)
return 'erlc -o ' . ale#Escape(l:output_file)
\ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
\ . ' %t'
let l:command = ale#Escape(ale_linters#erlang#erlc#GetExecutable(a:buffer))
\ . ' -o ' . ale#Escape(l:output_file)
\ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
\ . ' %t'
return l:command
endfunction
function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
@ -17,7 +25,7 @@ function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
" error.erl:4: variable 'B' is unbound
" error.erl:3: Warning: function main/0 is unused
" error.erl:4: Warning: variable 'A' is unused
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+): (Warning: )?(.+)$'
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+:)? (Warning: )?(.+)$'
" parse_transforms are a special case. The error message does not indicate a location:
" error.erl: undefined parse transform 'some_parse_transform'
@ -57,8 +65,8 @@ function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
endif
let l:line = l:match[2]
let l:warning_or_text = l:match[3]
let l:text = l:match[4]
let l:warning_or_text = l:match[4]
let l:text = l:match[5]
" If this file is a header .hrl, ignore the following expected messages:
" - 'no module definition'
@ -90,7 +98,7 @@ endfunction
call ale#linter#Define('erlang', {
\ 'name': 'erlc',
\ 'executable': 'erlc',
\ 'executable': function('ale_linters#erlang#erlc#GetExecutable'),
\ 'command': function('ale_linters#erlang#erlc#GetCommand'),
\ 'callback': 'ale_linters#erlang#erlc#Handle',
\})

View File

@ -0,0 +1,51 @@
" Author: Roeland Moors - https://github.com/roelandmoors
" based on the ale ruumba and robocop linters
" Description: ERB Lint, support for https://github.com/Shopify/erb-lint
call ale#Set('eruby_erblint_executable', 'erblint')
call ale#Set('eruby_erblint_options', '')
function! ale_linters#eruby#erblint#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'eruby_erblint_executable')
return ale#ruby#EscapeExecutable(l:executable, 'erblint')
\ . ' --format json '
\ . ale#Var(a:buffer, 'eruby_erblint_options')
\ . ' --stdin %s'
endfunction
function! ale_linters#eruby#erblint#Handle(buffer, lines) abort
if empty(a:lines)
return []
endif
let l:errors = ale#util#FuzzyJSONDecode(a:lines[0], [])
if !has_key(l:errors, 'summary')
\|| l:errors['summary']['offenses'] == 0
\|| empty(l:errors['files'])
return []
endif
let l:output = []
for l:error in l:errors['files'][0]['offenses']
call add(l:output, {
\ 'lnum': l:error['location']['start_line'] + 0,
\ 'col': l:error['location']['start_column'] + 0,
\ 'end_col': l:error['location']['last_column'] + 0,
\ 'code': l:error['linter'],
\ 'text': l:error['message'],
\ 'type': 'W',
\})
endfor
return l:output
endfunction
call ale#linter#Define('eruby', {
\ 'name': 'erblint',
\ 'executable': {b -> ale#Var(b, 'eruby_erblint_executable')},
\ 'command': function('ale_linters#eruby#erblint#GetCommand'),
\ 'callback': 'ale_linters#eruby#erblint#Handle',
\})

View File

@ -11,7 +11,7 @@ function! ale_linters#eruby#ruumba#GetCommand(buffer) abort
return ale#ruby#EscapeExecutable(l:executable, 'ruumba')
\ . ' --format json --force-exclusion '
\ . ale#Var(a:buffer, 'eruby_ruumba_options')
\ . ' --stdin ' . ale#Escape(expand('#' . a:buffer . ':p'))
\ . ' --stdin %s'
endfunction
function! ale_linters#eruby#ruumba#Handle(buffer, lines) abort

View File

@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for Go files.
call ale#handlers#cspell#DefineLinter('go')

View File

@ -10,8 +10,7 @@ function! ale_linters#go#gobuild#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'go_gobuild_options')
" Run go test in local directory with relative path
return ale#path#BufferCdString(a:buffer)
\ . ale#go#EnvString(a:buffer)
return ale#go#EnvString(a:buffer)
\ . ale#Var(a:buffer, 'go_go_executable') . ' test'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' -c -o /dev/null ./'
@ -50,6 +49,7 @@ call ale#linter#Define('go', {
\ 'name': 'gobuild',
\ 'aliases': ['go build'],
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#go#gobuild#GetCommand'),
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#go#gobuild#Handler',

View File

@ -6,7 +6,6 @@ function! ale_linters#go#gofmt#GetCommand(buffer) abort
\ . '%e -e %t'
endfunction
call ale#linter#Define('go', {
\ 'name': 'gofmt',
\ 'output_stream': 'stderr',

View File

@ -12,21 +12,19 @@ function! ale_linters#go#golangci_lint#GetCommand(buffer) abort
if l:lint_package
return ale#path#BufferCdString(a:buffer)
\ . ale#go#EnvString(a:buffer)
return ale#go#EnvString(a:buffer)
\ . '%e run '
\ . l:options
endif
return ale#path#BufferCdString(a:buffer)
\ . ale#go#EnvString(a:buffer)
return ale#go#EnvString(a:buffer)
\ . '%e run '
\ . ale#Escape(l:filename)
\ . ' ' . l:options
endfunction
function! ale_linters#go#golangci_lint#GetMatches(lines) abort
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?:?\s\*?(.+)$'
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?:?\s\*?(.+)\s+\((.+)\)$'
return ale#util#GetMatches(a:lines, l:pattern)
endfunction
@ -36,14 +34,20 @@ function! ale_linters#go#golangci_lint#Handler(buffer, lines) abort
let l:output = []
for l:match in ale_linters#go#golangci_lint#GetMatches(a:lines)
if l:match[5] is# 'typecheck'
let l:msg_type = 'E'
else
let l:msg_type = 'W'
endif
" l:match[1] will already be an absolute path, output from
" golangci_lint
call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'type': 'E',
\ 'text': l:match[4],
\ 'type': l:msg_type,
\ 'text': l:match[4] . ' (' . l:match[5] . ')',
\})
endfor
@ -53,6 +57,7 @@ endfunction
call ale#linter#Define('go', {
\ 'name': 'golangci-lint',
\ 'executable': {b -> ale#Var(b, 'go_golangci_lint_executable')},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#go#golangci_lint#GetCommand'),
\ 'callback': 'ale_linters#go#golangci_lint#Handler',
\ 'lint_file': 1,

View File

@ -13,14 +13,12 @@ function! ale_linters#go#gometalinter#GetCommand(buffer) abort
" BufferCdString is used so that we can be sure the paths output from gometalinter can
" be calculated to absolute paths in the Handler
if l:lint_package
return ale#path#BufferCdString(a:buffer)
\ . ale#go#EnvString(a:buffer)
return ale#go#EnvString(a:buffer)
\ . '%e'
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
endif
return ale#path#BufferCdString(a:buffer)
\ . ale#go#EnvString(a:buffer)
return ale#go#EnvString(a:buffer)
\ . '%e'
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(l:filename))
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
@ -53,6 +51,7 @@ endfunction
call ale#linter#Define('go', {
\ 'name': 'gometalinter',
\ 'executable': {b -> ale#Var(b, 'go_gometalinter_executable')},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#go#gometalinter#GetCommand'),
\ 'callback': 'ale_linters#go#gometalinter#Handler',
\ 'lint_file': 1,

View File

@ -4,6 +4,8 @@
call ale#Set('go_gopls_executable', 'gopls')
call ale#Set('go_gopls_options', '--mode stdio')
call ale#Set('go_gopls_init_options', {})
call ale#Set('go_gopls_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#go#gopls#GetCommand(buffer) abort
return ale#go#EnvString(a:buffer)
@ -28,7 +30,10 @@ endfunction
call ale#linter#Define('go', {
\ 'name': 'gopls',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'go_gopls_executable')},
\ 'executable': {b -> ale#path#FindExecutable(b, 'go_gopls', [
\ ale#go#GetGoPathExecutable('bin/gopls'),
\ ])},
\ 'command': function('ale_linters#go#gopls#GetCommand'),
\ 'project_root': function('ale_linters#go#gopls#FindProjectRoot'),
\ 'initialization_options': {b -> ale#Var(b, 'go_gopls_init_options')},
\})

View File

@ -1,15 +1,11 @@
" Author: Ben Reedy <https://github.com/breed808>
" Description: gosimple for Go files
function! ale_linters#go#gosimple#GetCommand(buffer) abort
return ale#path#BufferCdString(a:buffer) . ' '
\ . ale#go#EnvString(a:buffer) . 'gosimple .'
endfunction
call ale#linter#Define('go', {
\ 'name': 'gosimple',
\ 'executable': 'gosimple',
\ 'command': function('ale_linters#go#gosimple#GetCommand'),
\ 'cwd': '%s:h',
\ 'command': {b -> ale#go#EnvString(b) . 'gosimple .'},
\ 'callback': 'ale#handlers#go#Handler',
\ 'output_stream': 'both',
\ 'lint_file': 1,

View File

@ -1,19 +1,23 @@
" Author: Jelte Fennema <github-public@jeltef.nl>
" Description: gotype for Go files
function! ale_linters#go#gotype#GetCommand(buffer) abort
function! ale_linters#go#gotype#GetExecutable(buffer) abort
if expand('#' . a:buffer . ':p') =~# '_test\.go$'
return ''
endif
return ale#path#BufferCdString(a:buffer) . ' '
\ . ale#go#EnvString(a:buffer) . 'gotype -e .'
return 'gotype'
endfunction
function! ale_linters#go#gotype#GetCommand(buffer) abort
return ale#go#EnvString(a:buffer) . 'gotype -e .'
endfunction
call ale#linter#Define('go', {
\ 'name': 'gotype',
\ 'output_stream': 'stderr',
\ 'executable': 'gotype',
\ 'executable': function('ale_linters#go#gotype#GetExecutable'),
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#go#gotype#GetCommand'),
\ 'callback': 'ale#handlers#go#Handler',
\ 'lint_file': 1,

View File

@ -10,8 +10,7 @@ call ale#Set('go_govet_options', '')
function! ale_linters#go#govet#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'go_govet_options')
return ale#path#BufferCdString(a:buffer) . ' '
\ . ale#go#EnvString(a:buffer)
return ale#go#EnvString(a:buffer)
\ . ale#Var(a:buffer, 'go_go_executable') . ' vet '
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' .'
@ -22,6 +21,7 @@ call ale#linter#Define('go', {
\ 'aliases': ['go vet'],
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#go#govet#GetCommand'),
\ 'callback': 'ale#handlers#go#Handler',
\ 'lint_file': 1,

View File

@ -1,32 +1,32 @@
" Author: Ben Reedy <https://github.com/breed808>
" Description: staticcheck for Go files
call ale#Set('go_staticcheck_executable', 'staticcheck')
call ale#Set('go_staticcheck_options', '')
call ale#Set('go_staticcheck_lint_package', 0)
call ale#Set('go_staticcheck_lint_package', 1)
call ale#Set('go_staticcheck_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#go#staticcheck#GetCommand(buffer) abort
let l:filename = expand('#' . a:buffer . ':t')
let l:options = ale#Var(a:buffer, 'go_staticcheck_options')
let l:lint_package = ale#Var(a:buffer, 'go_staticcheck_lint_package')
let l:env = ale#go#EnvString(a:buffer)
" BufferCdString is used so that we can be sure the paths output from
" staticcheck can be calculated to absolute paths in the Handler
if l:lint_package
return ale#path#BufferCdString(a:buffer)
\ . l:env . 'staticcheck'
return l:env . '%e'
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
endif
return ale#path#BufferCdString(a:buffer)
\ . l:env . 'staticcheck'
return l:env . '%e'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' ' . ale#Escape(l:filename)
\ . ' %s:t'
endfunction
call ale#linter#Define('go', {
\ 'name': 'staticcheck',
\ 'executable': 'staticcheck',
\ 'executable': {b -> ale#path#FindExecutable(b, 'go_staticcheck', [
\ ale#go#GetGoPathExecutable('bin/staticcheck'),
\ ])},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#go#staticcheck#GetCommand'),
\ 'callback': 'ale#handlers#go#Handler',
\ 'output_stream': 'both',

View File

@ -4,6 +4,7 @@
call ale#linter#Define('graphql', {
\ 'name': 'eslint',
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
\ 'command': function('ale#handlers#eslint#GetCommand'),
\ 'callback': 'ale#handlers#eslint#HandleJSON',
\})

View File

@ -1,15 +1,10 @@
" Author: Michiel Westerbeek <happylinks@gmail.com>
" Description: Linter for GraphQL Schemas
function! ale_linters#graphql#gqlint#GetCommand(buffer) abort
return ale#path#BufferCdString(a:buffer)
\ . 'gqlint'
\ . ' --reporter=simple %t'
endfunction
call ale#linter#Define('graphql', {
\ 'name': 'gqlint',
\ 'executable': 'gqlint',
\ 'command': function('ale_linters#graphql#gqlint#GetCommand'),
\ 'cwd': '%s:h',
\ 'command': 'gqlint --reporter=simple %t',
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})

View File

@ -4,6 +4,35 @@
call ale#Set('handlebars_embertemplatelint_executable', 'ember-template-lint')
call ale#Set('handlebars_embertemplatelint_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#handlebars#embertemplatelint#GetExecutable(buffer) abort
return ale#path#FindExecutable(a:buffer, 'handlebars_embertemplatelint', [
\ 'node_modules/.bin/ember-template-lint',
\])
endfunction
function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer, version) abort
if ale#semver#GTE(a:version, [4, 0, 0])
" --json was removed in favor of --format=json in ember-template-lint@4.0.0
return '%e --format=json --filename %s'
endif
if ale#semver#GTE(a:version, [1, 6, 0])
" Reading from stdin was introduced in ember-template-lint@1.6.0
return '%e --json --filename %s'
endif
return '%e --json %t'
endfunction
function! ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck(buffer) abort
return ale#semver#RunWithVersionCheck(
\ a:buffer,
\ ale_linters#handlebars#embertemplatelint#GetExecutable(a:buffer),
\ '%e --version',
\ function('ale_linters#handlebars#embertemplatelint#GetCommand'),
\)
endfunction
function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
let l:output = []
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})
@ -30,10 +59,9 @@ function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
endfunction
call ale#linter#Define('handlebars', {
\ 'name': 'ember-template-lint',
\ 'executable': {b -> ale#node#FindExecutable(b, 'handlebars_embertemplatelint', [
\ 'node_modules/.bin/ember-template-lint',
\ ])},
\ 'command': '%e --json %t',
\ 'name': 'embertemplatelint',
\ 'aliases': ['ember-template-lint'],
\ 'executable': function('ale_linters#handlebars#embertemplatelint#GetExecutable'),
\ 'command': function('ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck'),
\ 'callback': 'ale_linters#handlebars#embertemplatelint#Handle',
\})

View File

@ -4,8 +4,7 @@
call ale#Set('haskell_cabal_ghc_options', '-fno-code -v0')
function! ale_linters#haskell#cabal_ghc#GetCommand(buffer) abort
return ale#path#BufferCdString(a:buffer)
\ . 'cabal exec -- ghc '
return 'cabal exec -- ghc '
\ . ale#Var(a:buffer, 'haskell_cabal_ghc_options')
\ . ' %t'
endfunction
@ -15,6 +14,7 @@ call ale#linter#Define('haskell', {
\ 'aliases': ['cabal-ghc'],
\ 'output_stream': 'stderr',
\ 'executable': 'cabal',
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#haskell#cabal_ghc#GetCommand'),
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})

View File

@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for Haskell files.
call ale#handlers#cspell#DefineLinter('haskell')

View File

@ -0,0 +1,65 @@
" Author: Yen3 <yen3rc@gmail.com>
" Description: A language server for haskell
" The file is based on hie.vim (author: Luxed
" <devildead13@gmail.com>). It search more project root files.
"
call ale#Set('haskell_hls_executable', 'haskell-language-server-wrapper')
call ale#Set('haskell_hls_config', {})
function! ale_linters#haskell#hls#FindRootFile(buffer) abort
let l:serach_root_files = [
\ 'stack.yaml',
\ 'cabal.project',
\ 'package.yaml',
\ 'hie.yaml'
\ ]
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
for l:root_file in l:serach_root_files
if filereadable(l:path . l:root_file)
return l:path
endif
endfor
endfor
return ''
endfunction
function! ale_linters#haskell#hls#GetProjectRoot(buffer) abort
" Search for the project file first
let l:project_file = ale_linters#haskell#hls#FindRootFile(a:buffer)
" If it's empty, search for the cabal file
if empty(l:project_file)
" Search all of the paths except for the root filesystem path.
let l:paths = join(
\ ale#path#Upwards(expand('#' . a:buffer . ':p:h'))[:-2],
\ ','
\)
let l:project_file = globpath(l:paths, '*.cabal')
endif
" If we still can't find one, use the current file.
if empty(l:project_file)
let l:project_file = expand('#' . a:buffer . ':p')
endif
return fnamemodify(l:project_file, ':h')
endfunction
function! ale_linters#haskell#hls#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'haskell_hls_executable')
return ale#handlers#haskell_stack#EscapeExecutable(l:executable,
\ 'haskell-language-server-wrapper')
\ . ' --lsp'
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'hls',
\ 'lsp': 'stdio',
\ 'command': function('ale_linters#haskell#hls#GetCommand'),
\ 'executable': {b -> ale#Var(b, 'haskell_hls_executable')},
\ 'project_root': function('ale_linters#haskell#hls#GetProjectRoot'),
\ 'lsp_config': {b -> ale#Var(b, 'haskell_hls_config')},
\})

View File

@ -4,8 +4,7 @@
call ale#Set('haskell_stack_ghc_options', '-fno-code -v0')
function! ale_linters#haskell#stack_ghc#GetCommand(buffer) abort
return ale#path#BufferCdString(a:buffer)
\ . ale#handlers#haskell#GetStackExecutable(a:buffer)
return ale#handlers#haskell#GetStackExecutable(a:buffer)
\ . ' ghc -- '
\ . ale#Var(a:buffer, 'haskell_stack_ghc_options')
\ . ' %t'
@ -16,6 +15,7 @@ call ale#linter#Define('haskell', {
\ 'aliases': ['stack-ghc'],
\ 'output_stream': 'stderr',
\ 'executable': function('ale#handlers#haskell#GetStackExecutable'),
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#haskell#stack_ghc#GetCommand'),
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})

View File

@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for help files.
call ale#handlers#cspell#DefineLinter('help')

View File

@ -0,0 +1,56 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: tsserver integration for ALE
call ale#Set('html_angular_executable', 'ngserver')
call ale#Set('html_angular_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#html#angular#GetProjectRoot(buffer) abort
return ale#path#Dirname(
\ ale#path#FindNearestDirectory(a:buffer, 'node_modules')
\)
endfunction
function! ale_linters#html#angular#GetExecutable(buffer) abort
return 'node'
endfunction
function! ale_linters#html#angular#GetCommand(buffer) abort
let l:language_service_dir = ale#path#Simplify(
\ ale#path#FindNearestDirectory(
\ a:buffer,
\ 'node_modules/@angular/language-service'
\ )
\)
if empty(l:language_service_dir)
return ''
endif
let l:language_service_dir = fnamemodify(l:language_service_dir, ':h')
let l:typescript_dir = ale#path#Simplify(
\ fnamemodify(l:language_service_dir, ':h:h')
\ . '/typescript'
\)
let l:script = ale#path#FindExecutable(a:buffer, 'html_angular', [
\ 'node_modules/@angular/language-server/bin/ngserver',
\ 'node_modules/@angular/language-server/index.js',
\])
if !filereadable(l:script)
return ''
endif
return ale#Escape('node') . ' ' . ale#Escape(l:script)
\ . ' --ngProbeLocations ' . ale#Escape(l:language_service_dir)
\ . ' --tsProbeLocations ' . ale#Escape(l:typescript_dir)
\ . ' --stdio'
endfunction
call ale#linter#Define('html', {
\ 'name': 'angular',
\ 'aliases': ['angular-language-server'],
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#html#angular#GetExecutable'),
\ 'command': function('ale_linters#html#angular#GetCommand'),
\ 'project_root': function('ale_linters#html#angular#GetProjectRoot'),
\})

View File

@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for HTML files.
call ale#handlers#cspell#DefineLinter('html')

View File

@ -24,7 +24,7 @@ endfunction
call ale#linter#Define('html', {
\ 'name': 'htmlhint',
\ 'executable': {b -> ale#node#FindExecutable(b, 'html_htmlhint', [
\ 'executable': {b -> ale#path#FindExecutable(b, 'html_htmlhint', [
\ 'node_modules/.bin/htmlhint',
\ ])},
\ 'command': function('ale_linters#html#htmlhint#GetCommand'),

View File

@ -5,7 +5,7 @@ call ale#Set('html_stylelint_options', '')
call ale#Set('html_stylelint_use_global', 0)
function! ale_linters#html#stylelint#GetExecutable(buffer) abort
return ale#node#FindExecutable(a:buffer, 'html_stylelint', [
return ale#path#FindExecutable(a:buffer, 'html_stylelint', [
\ 'node_modules/.bin/stylelint',
\])
endfunction

View File

@ -0,0 +1,16 @@
" Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
" Description: VSCode html language server
function! ale_linters#html#vscodehtml#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
endfunction
call ale#linter#Define('html', {
\ 'name': 'vscodehtml',
\ 'lsp': 'stdio',
\ 'executable': 'vscode-html-language-server',
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#html#vscodehtml#GetProjectRoot'),
\})

View File

@ -6,7 +6,7 @@ call ale#Set('ink_ls_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('ink_ls_initialization_options', {})
function! ale_linters#ink#ls#GetExecutable(buffer) abort
return ale#node#FindExecutable(a:buffer, 'ink_ls', [
return ale#path#FindExecutable(a:buffer, 'ink_ls', [
\ 'ink-language-server',
\ 'node_modules/.bin/ink-language-server',
\])

33
ale_linters/inko/inko.vim Normal file
View File

@ -0,0 +1,33 @@
" Author: Yorick Peterse <yorick@yorickpeterse.com>
" Description: linting of Inko source code using the Inko compiler
call ale#Set('inko_inko_executable', 'inko')
function! ale_linters#inko#inko#GetCommand(buffer) abort
let l:include = ''
" Include the tests source directory, but only for test files.
if expand('#' . a:buffer . ':p') =~? '\vtests[/\\]test[/\\]'
let l:test_dir = ale#path#FindNearestDirectory(a:buffer, 'tests')
if isdirectory(l:test_dir)
let l:include = '--include ' . ale#Escape(l:test_dir)
endif
endif
" We use %s instead of %t so the compiler determines the correct module
" names for the file being edited. Not doing so may lead to errors in
" certain cases.
return '%e build --check --format=json'
\ . ale#Pad(l:include)
\ . ' %s'
endfunction
call ale#linter#Define('inko', {
\ 'name': 'inko',
\ 'executable': {b -> ale#Var(b, 'inko_inko_executable')},
\ 'command': function('ale_linters#inko#inko#GetCommand'),
\ 'callback': 'ale#handlers#inko#Handle',
\ 'output_stream': 'stderr',
\ 'lint_file': 1
\})

View File

@ -9,11 +9,12 @@ function! ale_linters#java#checkstyle#Handle(buffer, lines) abort
let l:output = []
" modern checkstyle versions
let l:pattern = '\v\[(WARN|ERROR)\] [a-zA-Z]?:?[^:]+:(\d+):(\d+)?:? (.*) \[(.+)\]$'
let l:pattern = '\v\[(WARN|ERROR)\] [a-zA-Z]?:?[^:]+:(\d+):(\d+)?:? (.*) \[(.+)\]'
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'type': l:match[1] is? 'WARN' ? 'W' : 'E',
\ 'sub_type': 'style',
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'text': l:match[4],
@ -31,6 +32,7 @@ function! ale_linters#java#checkstyle#Handle(buffer, lines) abort
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'type': l:match[3] is? 'warning' ? 'W' : 'E',
\ 'sub_type': 'style',
\ 'lnum': l:match[2] + 0,
\ 'text': l:match[4],
\})
@ -52,7 +54,7 @@ endfunction
function! ale_linters#java#checkstyle#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'java_checkstyle_options')
let l:config_option = ale#Var(a:buffer, 'java_checkstyle_config')
let l:config = l:options !~# '\v(^| )-c' && !empty(l:config_option)
let l:config = l:options !~# '\v(^| )-c ' && !empty(l:config_option)
\ ? s:GetConfig(a:buffer, l:config_option)
\ : ''

View File

@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for Java files.
call ale#handlers#cspell#DefineLinter('java')

View File

@ -20,25 +20,39 @@ endfunction
function! ale_linters#java#eclipselsp#JarPath(buffer) abort
let l:path = ale_linters#java#eclipselsp#TargetPath(a:buffer)
" Search jar file within repository path when manually built using mvn
let l:repo_path = l:path . '/org.eclipse.jdt.ls.product/target/repository'
let l:files = globpath(l:repo_path, '**/plugins/org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
if has('win32')
let l:platform = 'win32'
elseif has('macunix')
let l:platform = 'macosx'
else
let l:platform = 'linux'
endif
if len(l:files) == 1
" Search jar file within repository path when manually built using mvn
let l:files = globpath(l:path, '**/'.l:platform.'/**/plugins/org.eclipse.equinox.launcher_*\.jar', 1, 1)
if len(l:files) >= 1
return l:files[0]
endif
" Search jar file within VSCode extensions folder.
let l:files = globpath(l:path, '**/plugins/org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
let l:files = globpath(l:path, '**/'.l:platform.'/plugins/org.eclipse.equinox.launcher_*\.jar', 1, 1)
if len(l:files) == 1
if len(l:files) >= 1
return l:files[0]
endif
" Search jar file within unzipped tar.gz file
let l:files = globpath(l:path, 'plugins/org.eclipse.equinox.launcher_*\.jar', 1, 1)
if len(l:files) >= 1
return l:files[0]
endif
" Search jar file within system package path
let l:files = globpath('/usr/share/java/jdtls/plugins', 'org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
let l:files = globpath('/usr/share/java/jdtls/plugins', 'org.eclipse.equinox.launcher_*\.jar', 1, 1)
if len(l:files) == 1
if len(l:files) >= 1
return l:files[0]
endif
@ -166,7 +180,8 @@ function! ale_linters#java#eclipselsp#RunWithVersionCheck(buffer) abort
return ale#command#Run(
\ a:buffer,
\ l:command,
\ function('ale_linters#java#eclipselsp#CommandWithVersion')
\ function('ale_linters#java#eclipselsp#CommandWithVersion'),
\ { 'output_stream': 'both' }
\)
endfunction
@ -177,4 +192,9 @@ call ale#linter#Define('java', {
\ 'command': function('ale_linters#java#eclipselsp#RunWithVersionCheck'),
\ 'language': 'java',
\ 'project_root': function('ale#java#FindProjectRoot'),
\ 'initialization_options': {
\ 'extendedClientCapabilities': {
\ 'classFileContentsSupport': v:true
\ }
\ }
\})

View File

@ -9,22 +9,16 @@ call ale#Set('java_javac_classpath', '')
call ale#Set('java_javac_sourcepath', '')
function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
let l:command = ''
let l:pom_path = ale#path#FindNearestFile(a:buffer, 'pom.xml')
if !empty(l:pom_path) && executable('mvn')
let l:command = ale#path#CdString(fnamemodify(l:pom_path, ':h'))
\ . 'mvn dependency:build-classpath'
endif
let [l:cwd, l:command] = ale#maven#BuildClasspathCommand(a:buffer)
" Try to use Gradle if Maven isn't available.
if empty(l:command)
let l:command = ale#gradle#BuildClasspathCommand(a:buffer)
let [l:cwd, l:command] = ale#gradle#BuildClasspathCommand(a:buffer)
endif
" Try to use Ant if Gradle and Maven aren't available
if empty(l:command)
let l:command = ale#ant#BuildClasspathCommand(a:buffer)
let [l:cwd, l:command] = ale#ant#BuildClasspathCommand(a:buffer)
endif
if empty(l:command)
@ -34,7 +28,8 @@ function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
return ale#command#Run(
\ a:buffer,
\ l:command,
\ function('ale_linters#java#javac#GetCommand')
\ function('ale_linters#java#javac#GetCommand'),
\ {'cwd': l:cwd},
\)
endfunction
@ -116,8 +111,7 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths, meta) abort
" Always run javac from the directory the file is in, so we can resolve
" relative paths correctly.
return ale#path#BufferCdString(a:buffer)
\ . '%e -Xlint'
return '%e -Xlint'
\ . ale#Pad(l:cp_option)
\ . ale#Pad(l:sp_option)
\ . ' -d ' . ale#Escape(l:class_file_directory)
@ -138,7 +132,9 @@ function! ale_linters#java#javac#Handle(buffer, lines) abort
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])
let l:output[-1].col = len(l:match[1])
if !empty(l:match[1]) && !empty(l:output)
let l:output[-1].col = len(l:match[1])
endif
elseif empty(l:match[3])
" Add symbols to 'cannot find symbol' errors.
if l:output[-1].text is# 'error: cannot find symbol'
@ -160,6 +156,7 @@ endfunction
call ale#linter#Define('java', {
\ 'name': 'javac',
\ 'executable': {b -> ale#Var(b, 'java_javac_executable')},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#java#javac#RunWithImportPaths'),
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#java#javac#Handle',

View File

@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for JavaScript files.
call ale#handlers#cspell#DefineLinter('javascript')

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