Compare commits

..

71 Commits

Author SHA1 Message Date
yoan667
ca1da76d5e add markdownlint fixer for markdown (#5066)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-11-22 21:16:50 +09:00
pmonson711
962a932ed4 add support for expert (#5036)
* add support for expert

* Refactor elixir expert linter from feedback

- Simplify configuration by removing executable lookup logic
- Update documentation to reflect current configuration options
- Rename test file and update assertions for the new configuration

* default to expert for the lsp

The install instructions included something I missed. It includes a
global install, where the default executable is just `expert`. I'll
default to that and review if I should should add a configuration for a
global config.

---------

Co-authored-by: Your Name <pmonson711@nfiindustries.com>
2025-11-22 21:15:52 +09:00
yoan667
395d9fa2aa Add SuperHTML linter for HTML (#5055) 2025-11-22 21:15:28 +09:00
FouMalade
5f286eb909 add unimport fixer (#5068) 2025-11-22 21:14:57 +09:00
FouMalade
1f0f9ef28d fix option pymarkdown linter (#5060) 2025-11-22 21:12:51 +09:00
FouMalade
e56b55b65d Fix j2lint linter (#5065)
* fix option pymarkdown linter

* fix-j2lint-linter
2025-11-22 21:12:18 +09:00
Albert Peschar
260c756a9b biome: use --stdin-file-path for fixer (#5051) 2025-11-22 21:03:14 +09:00
Ben Boeckel
86d8ada5cb tombi: support toml_tombi_online flag to control remote schema fetching (#5032) 2025-11-22 21:02:24 +09:00
Steve Matney
de2d3da738 Adding --no-color flag to stylelint args (#5050)
* Adding --no-color flag to sass stylelint

* Adding --no-color to all stylelint args

* Adding --no-color expectation to stylelint tests

* Properly handling SyntaxError for stylelint; adding corresponding test

* Fixing CSS stylelint parameters and adding regression test
2025-11-22 21:00:41 +09:00
rymdbar
b9d7f56471 Use FindNearestFileOrDirectory, perl languageserver (#5038)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Update to use mentioned function to find both .git/ directories and .git
worktree files.

Co-authored-by: cos <cos>
2025-10-28 21:16:17 +09:00
rymdbar
6d8e4a641c Make documentation mirror custom_linting_rules (#5056)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Co-authored-by: cos <cos>
2025-10-27 21:56:35 +09:00
Nicolas Derumigny
d2f4090c33 doc(slang): fix minor typo (#5047)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-10-26 16:16:04 +09:00
Bill Ruddock
59c6b4f7b0 phpstan: support config phpstan.dist.neon (#5052)
phpstan will load config from (in order) phpstan.neon, phpstan.neon.dist, or
phpstan.dist.neon.
2025-10-26 15:55:40 +09:00
Bill Ruddock
21d5de18b2 fix phpstan: use configured level 0 (#5053)
Use configured g:ale_php_phpstan_level if it is 0 (as a number rather
than string).

0 (number) is considered to be empty, but '0' (string) is not.
2025-10-26 15:51:03 +09:00
Max Jacobson
ed26d1f1d9 Add --editor-mode flag when invoking rubocop (#5049)
* Add --editor-mode flag when invoking rubocop

Since RuboCop 1.61.0 (released in February 2024), RuboCop accepts an
`--editor-mode` flag which improves editor integrations like ale.

Some of RuboCop's auto-corrections can be surprising or annoying to run
on save. When RuboCop is running via an LSP or when the `--editor-mode`
flag is passed, it will understand that it is running in an editor, and
it will hold off on making changes that might be surprising or annoying.

For example, if I write

```ruby
def call
  results = some_process
end
```

This has an unused variable, and RuboCop will remove the unused variable
when you run it. However, if you're in the middle of editing, you may
not want it to remove that unused variable, because you may be about to
add a usage of it.

More context:

- PR which introduced it: https://github.com/rubocop/rubocop/pull/12682
- Release notes for 1.61: https://github.com/rubocop/rubocop/releases/tag/v1.61.0
- Docs: https://docs.rubocop.org/rubocop/1.80/configuration.html#contextual

This will be a breaking change for anyone who is running an old version
of RuboCop, because the flag will not exist for them. If they would like
to opt out of this change, they can set an option to omit the flag. I
think this ought to be enabled by default so that people will get this
benefit out of the box.

In the meantime, I am opting into this behavior by setting this option:

```vim
let g:ale_ruby_rubocop_options = "--editor-mode"
```

So I appreciate that this seam was already introduced.

* Make this a non-breaking change

This will detect the current rubocop version and auto-enable
--editor-mode for newer version of rubocop without affecting users of
older versions of rubocop.
2025-10-26 15:14:30 +09:00
FouMalade
9811114948 Add j2lint linter for Jinja2 templates (#5048)
Co-authored-by: Nicolas SCHMAUCH <nic.schmauch@i-0330135t.ac-bordeaux.fr>
2025-10-26 14:54:22 +09:00
Shigma
4217461c48 fix issue 5037. "/s/c/" to "/s/c" (#5043)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
a bug on windows.
link: https://github.com/dense-analysis/ale/issues/5037
2025-09-06 16:36:44 +09:00
Ben Boeckel
528e25954b ale: add FindNearestFileOrDirectory function (#5033)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
* test: rename `FindNearestFile` test file

It matches the API name better and now lives beside the test file for
`FindNearestDirectory`.

* ale: add `FindNearestFileOrDirectory` function

Some anchor paths can be files or directories (e.g., `.git` is a
directory normally, but a file for worktrees). Add a function that finds
either type of path and returns the nearest.
2025-08-21 12:59:18 +01:00
rymdbar
b415dddf9f Make phpactor configurable and documented (#5027)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Add php_phpactor_executable for phpactor and make it configurable
through php_phpactor_config.

When phpactor was first added in 3b8ff65, it had no configuration. Thus
the documentation for it could be completely blank. That is why it now
seems like an initial addition

Co-authored-by: cos <cos>
2025-08-15 12:27:58 +01:00
rymdbar
55acb6536e Update two broken links to golang tools (#5031)
Co-authored-by: cos <cos>
2025-08-15 12:26:37 +01:00
Yining
34d1fd266b chore: remove some unused files and minor typo fix (#5029)
removed some files that seem not needed any longer and a minor typo in
code comment
2025-08-15 12:23:31 +01:00
rymdbar
84eae97bf2 Correct typo in documented python command (#5030)
Co-authored-by: cos <cos>
2025-08-15 12:22:56 +01:00
w0rp
9acafa8018 Close #5019 - Mention Sponsorship page
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-08-14 20:26:42 +01:00
w0rp
11cbd96667 Stop oelint_adv functions possibly conflicting 2025-08-14 20:21:50 +01:00
offa
ce1ee7c598 Update oelint pattern (#5016)
* Update oelint pattern
* Handle optional branch output
2025-08-14 20:18:00 +01:00
rymdbar
a083d58c7f Fix lua_language_server_config variable name (#5025)
Since added in commit f2a21c9, the implementation and documentation has
differed in their naming. The latter has had an additional lua_-prefix.

With this fix, setting the variable as documented actually results in a
'workspace/didChangeConfiguration' method being executed on the luals.

Adding a reference to the documentation of which configurations the lsp
supports doesn't hurt, so that's done too.

Co-authored-by: cos <cos>
2025-08-14 20:16:18 +01:00
w0rp
3539f39d4d Add checkov linter for cloudformation
Co-Authored-By: jhandsel <64368631+jhandsel@users.noreply.github.com>
2025-08-14 17:34:25 +01:00
Kyle Behrens
37e64b5caf fixes ruff#GetCommand checking packagemanger verison and not ruff (#5026)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-08-14 11:57:46 +00:00
Woshiluo Luo
822d9a1bf3 linter/scala/metals: add build.mill as project root detect file (#5012)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Signed-off-by: Woshiluo Luo <woshiluo.luo@outlook.com>
2025-08-13 15:58:33 +00:00
rymdbar
92dd497e6c Add support for perl language server (#5003)
* Fix perl test case clean-up
* Add support for perl language server

Co-authored-by: cos <cos>
2025-08-13 16:57:11 +01:00
Nicolas Derumigny
6d7bc15d9a Add support for verible: language server + fixer (#4994)
* Add support for verible: language server + fixer
* verible: add default flag, rules support for verible-ls
2025-08-13 14:41:56 +00:00
w0rp
29f1ff2579 Add support for fortitude (fortran linter) #5004
* add support for fortitude fortran linter
* add fortitude fortran linter doc
* Add a fortitude linter test file
* docs listings are now alphabetically sorted

Co-Authored-By: gomfol12 <info@marekb.de>
2025-08-13 15:24:35 +01:00
bretello
7df94447c1 add preview for ALEFindReferences (#5001)
* add preview for ALEFindReferences
* ALEFindReferences: add -contents options and g:ale_references_show_contents option to configure default behaviour
* tests: add tests for ALEFindReferences -contents feature
* tests: update tsserver references tests with show_contents args
2025-08-13 14:21:48 +01:00
Yining
c74b917648 add: support project-local ansible-lint (#5015)
Add support for project-local `ansible-lint` (via `uv`, `poetry`, and `pipenv`) 
when using the system-wide installed one is not possible or not desirable.
2025-08-13 14:19:15 +01:00
w0rp
206b414120 Save redpen_options when running tests
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-08-13 13:07:28 +01:00
Jason Weir
5dfd1fdb9a Add configurable options support for redpen linter (#5006)
Redpen linter previously had hardcoded command-line options and duplicated
linter definitions across all supported file types (asciidoc, markdown,
review, rst, tex, text). This refactoring centralizes the linter definition
and adds support for user-configurable options via g:ale_redpen_options.

Key changes:
- Created ale#handlers#redpen#DefineLinter() to eliminate code duplication
- Added ale#handlers#redpen#GetCommand() to support configurable options
- All file types now use shared configuration and command building
- Added comprehensive test coverage for option handling
- Updated documentation for all affected file types

This allows users to customize redpen behavior with additional command-line
options while maintaining backward compatibility and reducing maintenance
overhead.
2025-08-13 13:06:06 +01:00
F-Kearney
ac691b0b89 Appended 💬 emoji to any line containing an lsp (#5011) 2025-08-13 12:45:33 +01:00
w0rp
28573c8ada Reduce lines of code for tombi 2025-08-13 12:45:26 +01:00
Ben Boeckel
d6f1a47647 tombi: support its LSP (#5022)
* tombi: support its LSP
* tombi: support linting and formatting
2025-08-13 12:30:46 +01:00
Ben Boeckel
487d915984 doc/ale-rust: fix rust-analyzer typo (#5021) 2025-08-13 12:27:00 +01:00
w0rp
c7f3ba9d41 Take Vim binaries from ALE release assets 2025-08-13 12:21:22 +01:00
w0rp
295752ff3e Skip empty or unparseable ruff items 2025-08-13 12:18:58 +01:00
Benjamin Block
3d68ec7857 Only strip newlines for echo, otherwise full messages (#4964)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
* Updates `ale#lsp#response#ReadDiagnostics` to always store the full, unaltered diagnostic message from the LSP in question. The current process is to replace all newline characters with whitespace (' '), which then leads to broken formatting when viewing complex output from an LSP with `:ALEDetail` and other commands.
* Updates `ale#cursor#TruncatedEcho` to replace newline characters with a space ' ' instead of an empty string '' to retain the previous style of formatting for echoed messages.

Fixes: #2356
Fixes: #3068
Fixes: #2301
2025-07-20 11:47:26 +01:00
Tarik Graba
e670c9781c Slang verilog Linter: set default searchpath and output filename (#4999)
* Sets module search path to file directory for slang/verilog linter

Similar to iverilog behaviour.
See 699c0dbe80

Reasonable default behaviour, can be changed by adding '-y%s:h' to
`b:ale_verilog_slang_options` buffer variable.

* Adds filename to slang/verilog linter output

slang can parse other files based on the modules instances names find in
the current file and returns warning/error messages related to those
files that have the same pattern.

Adding the file name to the outputs avoid polluting the active buffer
with those messages.

* Absolute paths in slang/verilog linter messages

Otherwise temp files are not correctly detected
2025-07-20 11:27:25 +01:00
Tarik Graba
0d1d0a9f81 Add explicit module search path to the verilator linter (#5000)
Adds the origin file directory as a module search path.
This is the default behaviour, this commit makes it explicit.

Note from the doc:

'-I' -> include search path
'-y' -> module search path

The space after '-y' seems mandatory, at least when I tested it with
vresion 5.032-46-g447ab12ce
2025-07-20 11:15:15 +01:00
Leo Correa
c8890af8d4 Add initialization_options to Sorbet LSP linter (#4954)
* Add initialization_options to Sorbet LSP linter

Using a predefined object will ensure that Sorbet always receives an
object instead of an array. LSP defines the initializationOptions as
anything. Unfortunately Sorbet is too strict and raises an error when
anything other than an object is passed which causes the linter to fail

* Document empty objects will prevent Sorbet from properly initializing
2025-07-20 11:13:33 +01:00
F-Kearney
9abe393961 Added 'build/Debug' and 'build/Release' to g:ale_c_build_dir_names (#4322) (#5008) 2025-07-20 10:01:56 +00:00
w0rp
4b1bf3ee8f Disable unreachable errors from shellcheck in run-tests
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-07-12 13:02:49 +01:00
w0rp
edccdfa9ef Make shellcheck respect ale_warn_about_trailing_whitespace
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-07-06 18:47:46 +01:00
Andrey Starodubtsev
9e49019a26 Some absolute paths are not recognized for Windows (#4987)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
* Some abs paths are not recognized for win32

Paths like "c:/abc/def.cpp" were not recognized as absolute on Windows.

* Fix test for mypy_handler

mypy handler not just simplifies path, but tries to convert path to
absolute.
2025-06-24 11:05:11 +01:00
w0rp
a0572359ae Remove pytest.ini from project detection files
This breaks detecting the project root when editing tests with a nested
pytest.ini file where other project files are available. The other files
are so common we can just removes this entirely and test that we
ignore it in one case.
2025-06-24 07:47:15 +01:00
w0rp
80ff84db84 Skip whitespace warnings from ruff, if so configured
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-05-20 16:59:42 +01:00
w0rp
c8c33e7217 Add bash-language-server as an alias for it 2025-05-20 15:55:26 +01:00
Horacio Sanson
5098dfd27e Fix golangci-lint fixer with version 2 (#4960)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-05-17 20:28:17 +09:00
Oliver Albertini
7cdaaa645d [python/pyre.vim] use pyrefly executable (#4972)
https://github.com/facebook/pyrefly

The pyre project has evolved to pyrefly. This replaces the pyre linter
with a pyrefly one and removes the test files that were added for
finding the project root in the old pyre world.

Co-authored-by: Oliver Ruben Albertini <oliverruben@gmail.com>
2025-05-17 20:08:52 +09:00
Nikita Korolev
2f4a866591 Add initial support for named-checkzone linter (#4961)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Co-authored-by: ds <ds@local>
2025-05-05 15:05:51 +09:00
Benjamin Block
f9de268816 Adding Roc language linters and fixers. (#4966)
* `roc_language_server`

* `roc format`

* `roc format annotate`
2025-05-05 15:01:45 +09:00
w0rp
1aaeb2cdae Add other issue types
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-04-26 04:32:53 +01:00
w0rp
05e22db9a2 Add Bug as a bug issue template type 2025-04-26 04:31:16 +01:00
Benjamin Block
d0cdde7516 Add support for the Lean 4 LSP, served by lake. (#4952) 2025-04-26 10:48:39 +09:00
Mikhail Velikikh
baaca9a5d7 Use ale#Escape in c_clangformat_style_option (#4949)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
* Use ale#Escape in c_clangformat_style_option
* Update Vader test
2025-04-16 02:29:57 +00:00
Jean-Philippe Guérard
aac34cd45a Add bash to the linter aliases (#4948) 2025-04-16 02:28:32 +00:00
w0rp
366de225fd Mention, but do not scream when a file changes before it is fixed
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-04-10 15:17:35 +01:00
PizZaKatZe
22185c4c5c Remove ANSI color codes from nix linter messages (#4944)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
* Remove ANSI color codes from nix linter messages

* Add test for color-coded nix linter findings

* Fix test: Escape backslashes

---------

Co-authored-by: Sebastian Neuser <sebastian.neuser@fnordkollektiv.de>
Co-authored-by: Sebastian Neuser <haggl@sineband.de>
2025-04-07 20:23:13 +09:00
Josh Pencheon
2883260ade Correctly identify tempfiles once symlinks are resolved (#3726)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Some linters will expand the paths of symlinked tempfiles when
reporting them back to ALE. This ensures that if they do, the filename
is still flagged appropriately as being temporary.
2025-04-02 21:48:32 +09:00
Dmitri Vereshchagin
090d31b79a Always use safe file local variables for erlang-mode fixer (#4942)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
File local variables in Emacs are used in a way similar to Vim
modelines.  For example, at the end of the file you might find something
like the following:

    %% Local Variables:
    %% erlang-indent-level: 2
    %% something-weird: t
    %% End:

The `erlang-indent-level' variable in this list instructs the Erlang
mode to use two columns per indentation level.  But since the
`something-weird' variable is likely unknown, both may be ignored.

By default, Emacs in batch mode ignores all variable/value pairs if it
encounters at least one that is not known to be safe.  Setting
`enable-local-variables' to `:safe' tells Emacs to use only safe values
and ignore the rest.
2025-04-01 20:44:57 +09:00
Horacio Sanson
067e74fee8 Add support for glnagci-lint v2 (#4936)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Version 2 of golangci-lint introduces several breaking changes to the
command line arguments and the configuration file.

Thi PR updates ale integration to support both version 1.6x.x and 2.x.x
of golangci-lint.
2025-03-31 11:46:42 +01:00
Dmitri Vereshchagin
ff8fe94494 Remove hadolint rule code from location list entry text (#4939)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
The code is already passed with the code key of location list entry.
Before this change, when using the default message format, it appeared
twice in the description of each location list entry and twice in each
echo message.
2025-03-30 13:58:04 +09:00
w0rp
6433d31f47 Update ale_disable_lsp documentation to clarify options
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-03-29 13:34:22 +00:00
w0rp
f3f0b05240 Fix #4935 - Send tsserver messsages to tsserver in Neovim 2025-03-29 13:25:49 +00:00
w0rp
add538213f Set up Lua development for Macs with Homebrew
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-03-28 16:20:18 +00:00
191 changed files with 3368 additions and 409 deletions

View File

@@ -41,10 +41,10 @@ install:
- ps: >-
if (!(Test-Path -Path C:\vim)){
Add-Type -A System.IO.Compression.FileSystem
Invoke-WebRequest ftp://ftp.vim.org/pub/vim/pc/vim80-586w32.zip `
Invoke-WebRequest https://github.com/dense-analysis/ale/releases/download/v4.0.0/vim80-586w32.zip `
-OutFile C:\vim.zip
[IO.Compression.ZipFile]::ExtractToDirectory('C:\vim.zip', 'C:\vim')
Invoke-WebRequest ftp://ftp.vim.org/pub/vim/pc/vim80-586rt.zip `
Invoke-WebRequest https://github.com/dense-analysis/ale/releases/download/v4.0.0/vim80-586rt.zip `
-OutFile C:\rt.zip
[IO.Compression.ZipFile]::ExtractToDirectory('C:\rt.zip', 'C:\vim')
}

View File

@@ -1,6 +1,7 @@
---
name: Report a bug
labels: bug
type: Bug
about: Report a bug with ALE.
---

View File

@@ -1,6 +1,7 @@
---
name: Suggest a new linter or fixer
labels: new tool
type: Task
about: Suggest a new tool ALE can officially integrate with.
---

View File

@@ -1,6 +1,7 @@
---
name: Suggest an improvement
labels: enhancement
type: Feature
about: Suggest some way to improve ALE, or add a new feature.
---

View File

@@ -7,7 +7,8 @@
"test"
],
"workspace.library": [
"/usr/share/nvim/runtime/lua"
"/usr/share/nvim/runtime/lua",
"/opt/homebrew/share/nvim/runtime/lua"
],
"runtime.pathStrict": true,
"runtime.path": [

View File

@@ -61,6 +61,14 @@ linting and fixing of code in Vim. ALE offers the following.
* Windows support
* Well-integrated with other plugins
## Sponsorship
If you would like to donate to Dense Analysis to say thank you for ALE, please
consider visiting our [Sponsorship page](https://denseanalysis.org/sponsors/).
Funds will be used to pay for our hosting fees and research. Whilst visiting our
site, please feel free to make use of our educational resources and other
recommended tools.
## Supported Languages and Tools
ALE supports a wide variety of languages and tools. See the

View File

@@ -2,11 +2,44 @@
" Description: ansible-lint for ansible-yaml files
call ale#Set('ansible_ansible_lint_executable', 'ansible-lint')
call ale#Set('ansible_ansible_lint_auto_pipenv', 0)
call ale#Set('ansible_ansible_lint_auto_poetry', 0)
call ale#Set('ansible_ansible_lint_auto_uv', 0)
call ale#Set('ansible_ansible_lint_change_directory', 1)
function! ale_linters#ansible#ansible_lint#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv')
\ || ale#Var(a:buffer, 'ansible_ansible_lint_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry')
\ || ale#Var(a:buffer, 'ansible_ansible_lint_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if (ale#Var(a:buffer, 'python_auto_uv')
\ || ale#Var(a:buffer, 'ansible_ansible_lint_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#Var(a:buffer, 'ansible_ansible_lint_executable')
endfunction
function! ale_linters#ansible#ansible_lint#GetCwd(buffer) abort
if ale#Var(a:buffer, 'ansible_ansible_lint_change_directory')
" Run from project root if found, else from buffer dir.
let l:project_root = ale#python#FindProjectRoot(a:buffer)
return !empty(l:project_root) ? l:project_root : '%s:h'
endif
return ''
endfunction
function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
for l:line in a:lines[:10]
if match(l:line, '^Traceback') >= 0
@@ -103,28 +136,50 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
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:executable = ale_linters#ansible#ansible_lint#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run ansible-lint'
\ : ''
let l:opts_map = {
\ '>=6.0.0': ' --nocolor -f json -x yaml %s',
\ '>=5.0.0': ' --nocolor --parseable-severity -x yaml %s',
\ '<5.0.0': ' --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']
let l:cmd_opts = ale#semver#GTE(a:version, [6, 0]) ? l:opts_map['>=6.0.0'] :
\ ale#semver#GTE(a:version, [5, 0]) ? l:opts_map['>=5.0.0'] :
\ l:opts_map['<5.0.0']
let l:command = ale#Escape(l:executable) . l:exec_args . l:cmd_opts
return l:command
endfunction
function! ale_linters#ansible#ansible_lint#RunWithVersionCheck(buffer) abort
let l:executable = ale_linters#ansible#ansible_lint#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run ansible-lint'
\ : ''
let l:command = ale#Escape(l:executable) . l:exec_args . ' --version'
return ale#semver#RunWithVersionCheck(
\ a:buffer,
\ l:executable,
\ l:command,
\ function('ale_linters#ansible#ansible_lint#GetCommand'),
\)
endfunction
call ale#linter#Define('ansible', {
\ 'name': 'ansible_lint',
\ 'aliases': ['ansible', 'ansible-lint'],
\ 'executable': function('ale_linters#ansible#ansible_lint#GetExecutable'),
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#ansible#ansible_lint#GetExecutable(buffer),
\ '%e --version',
\ function('ale_linters#ansible#ansible_lint#GetCommand'),
\ )},
\ 'cwd': function('ale_linters#ansible#ansible_lint#GetCwd'),
\ 'command': function('ale_linters#ansible#ansible_lint#RunWithVersionCheck'),
\ 'lint_file': 1,
\ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck(
\ buffer,

View File

@@ -1,9 +1,4 @@
" Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#linter#Define('asciidoc', {
\ 'name': 'redpen',
\ 'executable': 'redpen',
\ 'command': 'redpen -f asciidoc -r json %t',
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
\})
call ale#handlers#redpen#DefineLinter('asciidoc')

View File

@@ -0,0 +1,43 @@
" Description: named-checkzone for bindzone
call ale#Set('bindzone_checkzone_executable', 'named-checkzone')
call ale#Set('bindzone_checkzone_options', '-c IN')
function! ale_linters#bindzone#checkzone#GetCommand(buffer) abort
return '%e' . ale#Pad(ale#Var(a:buffer, 'bindzone_checkzone_options'))
\ . ' example.com %t'
endfunction
function! ale_linters#bindzone#checkzone#Handle(buffer, lines) abort
let l:warning_pattern = '\vzone example.com/IN: (.+)$'
let l:error_pattern = '\v:(\d+): (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:error_pattern)
let l:lnum = l:match[1]
let l:text = l:match[2]
call add(l:output, {'text': l:text, 'lnum': l:lnum + 0, 'type': 'E'})
endfor
for l:match in ale#util#GetMatches(a:lines, l:warning_pattern)
let l:text = l:match[1]
" Ignore information messages
let l:scrub_match = matchlist(l:text, '\v(loaded serial|not loaded due to) ')
if empty(l:scrub_match)
call add(l:output, {'text': l:text, 'lnum': 0, 'type': 'W'})
endif
endfor
return l:output
endfunction
call ale#linter#Define('bindzone', {
\ 'name': 'checkzone',
\ 'executable': {b -> ale#Var(b, 'bindzone_checkzone_executable')},
\ 'command': function('ale_linters#bindzone#checkzone#GetCommand'),
\ 'callback': 'ale_linters#bindzone#checkzone#Handle',
\ 'read_buffer': 0,
\})

View File

@@ -5,6 +5,14 @@ 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#StripAnsiCodes(line) abort
return substitute(a:line, '\e\[[0-9;]\+[mK]', '', 'g')
endfunction
function! ale_linters#bitbake#oelint_adv#RemoveBranch(line) abort
return substitute(a:line, ' \[branch:.*', '', 'g')
endfunction
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'))
@@ -17,26 +25,25 @@ function! ale_linters#bitbake#oelint_adv#Command(buffer) abort
endfunction
function! ale_linters#bitbake#oelint_adv#Handle(buffer, lines) abort
let l:pattern = '\v^(.+):(.+):(.+):(.+):(.+)$'
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]
\ })
\ 'lnum': str2nr(l:match[2]),
\ 'type': l:match[3] is# 'error'
\ ? 'E'
\ : (l:match[3] is# 'warning' ? 'W' : 'I'),
\ 'text': ale_linters#bitbake#oelint_adv#RemoveBranch(
\ ale_linters#bitbake#oelint_adv#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',

View File

@@ -0,0 +1,41 @@
" Author: J. Handsel <jennpbc@posteo.net>, Thyme-87 <thyme-87@posteo.me>
" Description: use checkov for providing warnings for cloudformation via ale
call ale#Set('cloudformation_checkov_executable', 'checkov')
call ale#Set('cloudformation_checkov_options', '')
function! ale_linters#cloudformation#checkov#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'cloudformation_checkov_executable')
endfunction
function! ale_linters#cloudformation#checkov#GetCommand(buffer) abort
return '%e ' . '-f %t -o json --quiet --framework cloudformation ' . ale#Var(a:buffer, 'cloudformation_checkov_options')
endfunction
function! ale_linters#cloudformation#checkov#Handle(buffer, lines) abort
let l:output = []
let l:results = get(get(ale#util#FuzzyJSONDecode(a:lines, {}), 'results', []), 'failed_checks', [])
for l:violation in l:results
call add(l:output, {
\ 'filename': l:violation['file_path'],
\ 'lnum': l:violation['file_line_range'][0],
\ 'end_lnum': l:violation['file_line_range'][1],
\ 'text': l:violation['check_name'] . ' [' . l:violation['check_id'] . ']',
\ 'detail': l:violation['check_id'] . ': ' . l:violation['check_name'] . "\n" .
\ 'For more information, see: '. l:violation['guideline'],
\ 'type': 'W',
\ })
endfor
return l:output
endfunction
call ale#linter#Define('cloudformation', {
\ 'name': 'checkov',
\ 'output_stream': 'stdout',
\ 'executable': function('ale_linters#cloudformation#checkov#GetExecutable'),
\ 'command': function('ale_linters#cloudformation#checkov#GetCommand'),
\ 'callback': 'ale_linters#cloudformation#checkov#Handle',
\})

View File

@@ -6,7 +6,7 @@ call ale#Set('css_stylelint_use_global', get(g:, 'ale_use_global_executables', 0
function! ale_linters#css#stylelint#GetCommand(buffer) abort
return '%e ' . ale#Pad(ale#Var(a:buffer, 'css_stylelint_options'))
\ . ' --stdin-filename %s'
\ . ' --no-color --stdin-filename %s'
endfunction
call ale#linter#Define('css', {

View File

@@ -49,7 +49,6 @@ 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'

View File

@@ -0,0 +1,12 @@
" Author: Paul Monson <pmonson711@pm.me>
" Description: Expert integration (https://github.com/elixir-lang/expert)
call ale#Set('elixir_expert_executable', 'expert')
call ale#linter#Define('elixir', {
\ 'name': 'expert',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'elixir_expert_executable')},
\ 'command': '%e',
\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
\})

View File

@@ -0,0 +1,47 @@
" Author: gomfol12
" Desciption: A linter for fortran using fortitude.
call ale#Set('fortran_fortitude_executable', 'fortitude')
call ale#Set('fortran_fortitude_options', '')
let s:severity_map = {
\ 'E': 'E',
\ 'C': 'W',
\ 'OB': 'I',
\ 'MOD': 'I',
\ 'S': 'I',
\ 'PORT': 'I',
\ 'FORT': 'I',
\}
function! ale_linters#fortran#fortitude#Handle(buffer, lines) abort
let l:output = []
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
let l:prefix = matchstr(l:error['code'], '^\a\+')
let l:type = get(s:severity_map, l:prefix, 'I')
call add(l:output, {
\ 'lnum': l:error['location']['row'],
\ 'end_lnum': l:error['end_location']['row'],
\ 'col': l:error['location']['column'],
\ 'end_col': l:error['end_location']['column'],
\ 'text': l:error['message'],
\ 'type': l:type,
\ 'code': l:error['code'],
\})
endfor
return l:output
endfunction
call ale#linter#Define('fortran', {
\ 'name': 'fortitude',
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'fortran_fortitude_executable')},
\ 'command': {b ->
\ '%e' . ' check --output-format json' . ale#Pad(ale#Var(b, 'fortran_fortitude_options')) . ' %s'
\ },
\ 'callback': 'ale_linters#fortran#fortitude#Handle',
\ 'lint_file': 1,
\})

View File

@@ -5,26 +5,38 @@ call ale#Set('go_golangci_lint_options', '')
call ale#Set('go_golangci_lint_executable', 'golangci-lint')
call ale#Set('go_golangci_lint_package', 1)
function! ale_linters#go#golangci_lint#GetCommand(buffer) abort
function! ale_linters#go#golangci_lint#GetExecutable(buffer) abort
let l:executable = ale#Var(a:buffer, 'go_golangci_lint_executable')
return l:executable
endfunction
function! ale_linters#go#golangci_lint#GetCommand(buffer, version) abort
let l:filename = expand('#' . a:buffer . ':t')
let l:options = ale#Var(a:buffer, 'go_golangci_lint_options')
let l:lint_package = ale#Var(a:buffer, 'go_golangci_lint_package')
if ale#semver#GTE(a:version, [2, 0, 0])
let l:options = l:options
\ . ' --output.json.path stdout'
\ . ' --output.text.path stderr'
\ . ' --show-stats=0'
else
let l:options = l:options
\ . ' --out-format=json'
\ . ' --show-stats=0'
endif
if l:lint_package
return ale#go#EnvString(a:buffer)
\ . '%e run '
\ . l:options
\ . ' --out-format=json'
\ . ' --show-stats=0'
endif
return ale#go#EnvString(a:buffer)
\ . '%e run '
\ . ale#Escape(l:filename)
\ . ' ' . l:options
\ . ' --out-format=json'
\ . ' --show-stats=0'
endfunction
function! ale_linters#go#golangci_lint#Handler(buffer, lines) abort
@@ -58,9 +70,14 @@ endfunction
call ale#linter#Define('go', {
\ 'name': 'golangci-lint',
\ 'executable': {b -> ale#Var(b, 'go_golangci_lint_executable')},
\ 'executable': function('ale_linters#go#golangci_lint#GetExecutable'),
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#go#golangci_lint#GetCommand'),
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#go#golangci_lint#GetExecutable(buffer),
\ '%e --version',
\ function('ale_linters#go#golangci_lint#GetCommand'),
\ )},
\ 'callback': 'ale_linters#go#golangci_lint#Handler',
\ 'lint_file': 1,
\})

View File

@@ -16,7 +16,7 @@ function! ale_linters#html#stylelint#GetCommand(buffer) abort
return ale#Escape(l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --stdin-filename %s'
\ . ' --no-color --stdin-filename %s'
endfunction
call ale#linter#Define('html', {

View File

@@ -0,0 +1,34 @@
call ale#Set('html_superhtml_executable', 'superhtml')
call ale#Set('html_superhtml_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#html#superhtml#GetCommand(buffer) abort
return '%e check --stdin'
endfunction
function! ale_linters#html#superhtml#Handle(buffer, lines) abort
let l:output = []
let l:pattern = '^\(.*\):\(\d\+\):\(\d\+\): \(.*\)$'
for l:line in a:lines
let l:match = matchlist(l:line, l:pattern)
if !empty(l:match)
call add(l:output, {
\ 'lnum': str2nr(l:match[2]),
\ 'col': str2nr(l:match[3]),
\ 'text': l:match[4],
\ 'type': 'E'
\})
endif
endfor
return l:output
endfunction
call ale#linter#Define('html', {
\ 'name': 'superhtml',
\ 'executable': {b -> ale#Var(b, 'html_superhtml_executable')},
\ 'command': function('ale_linters#html#superhtml#GetCommand'),
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#html#superhtml#Handle',
\})

View File

@@ -0,0 +1,46 @@
" Description: linter for jinja using j2lint
call ale#Set('jinja_j2lint_executable', 'j2lint')
call ale#Set('jinja_j2lint_options', '')
call ale#Set('jinja_j2lint_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('jinja_j2lint_auto_pipenv', 0)
call ale#Set('jinja_j2lint_auto_poetry', 0)
call ale#Set('jinja_j2lint_auto_uv', 0)
function! ale_linters#jinja#j2lint#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'jinja_j2lint_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'jinja_j2lint_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'jinja_j2lint_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'jinja_j2lint', ['j2lint'])
endfunction
function! ale_linters#jinja#j2lint#GetCommand(buffer) abort
let l:executable = ale_linters#jinja#j2lint#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run j2lint'
\ : ''
return ale#Escape(l:executable) . l:exec_args
\ . ale#Pad(ale#Var(a:buffer, 'jinja_j2lint_options'))
\ . ' %t'
endfunction
call ale#linter#Define('jinja', {
\ 'name': 'j2lint',
\ 'executable': function('ale_linters#jinja#j2lint#GetExecutable'),
\ 'command': function('ale_linters#jinja#j2lint#GetCommand'),
\ 'callback': 'ale#handlers#unix#HandleAsError',
\})

28
ale_linters/lean/lake.vim Normal file
View File

@@ -0,0 +1,28 @@
" Author: Benjamin Block <https://github.com/benjamindblock>
" Description: A language server for Lean 4.
function! ale_linters#lean#lake#GetProjectRoot(buffer) abort
let l:lakefile_toml = ale#path#FindNearestFile(a:buffer, 'lakefile.toml')
let l:lakefile_lean = ale#path#FindNearestFile(a:buffer, 'lakefile.lean')
if !empty(l:lakefile_toml)
return fnamemodify(l:lakefile_toml, ':p:h')
elseif !empty(l:lakefile_lean)
return fnamemodify(l:lakefile_lean, ':p:h')
else
return fnamemodify('', ':h')
endif
endfunction
call ale#Set('lean_lake_executable', 'lake')
call ale#Set('lean_lake_config', {})
call ale#linter#Define('lean', {
\ 'name': 'lake',
\ 'lsp': 'stdio',
\ 'language': 'lean',
\ 'lsp_config': {b -> ale#Var(b, 'lean_lake_config')},
\ 'executable': {b -> ale#Var(b, 'lean_lake_executable')},
\ 'command': '%e serve',
\ 'project_root': function('ale_linters#lean#lake#GetProjectRoot'),
\})

View File

@@ -7,7 +7,7 @@ call ale#Set('less_stylelint_use_global', get(g:, 'ale_use_global_executables',
function! ale_linters#less#stylelint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'less_stylelint_options')
return '%e' . ale#Pad(l:options) . ' --stdin-filename %s'
return '%e' . ale#Pad(l:options) . ' --no-color --stdin-filename %s'
endfunction
call ale#linter#Define('less', {

View File

@@ -33,9 +33,8 @@ function! ale_linters#markdown#pymarkdown#GetCommand(buffer) abort
\ : ''
return ale#Escape(l:executable) . l:exec_args
\ . ' '
\ . ale#Var(a:buffer, 'markdown_pymarkdown_options')
\ . 'scan-stdin'
\ . ale#Pad(ale#Var(a:buffer, 'markdown_pymarkdown_options'))
\ . ' scan-stdin'
endfunction
function! ale_linters#markdown#pymarkdown#Handle(buffer, lines) abort

View File

@@ -1,9 +1,4 @@
" Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#linter#Define('markdown', {
\ 'name': 'redpen',
\ 'executable': 'redpen',
\ 'command': 'redpen -f markdown -r json %t',
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
\})
call ale#handlers#redpen#DefineLinter('markdown')

View File

@@ -29,7 +29,7 @@ function! ale_linters#nix#nix#Handle(buffer, lines) abort
\ 'type': 'E',
\ 'lnum': l:result.line,
\ 'col': l:result.column,
\ 'text': l:result.raw_msg
\ 'text': substitute(l:result.raw_msg, '\e\[[0-9;]*m', '', 'g'),
\})
endif
endif

View File

@@ -0,0 +1,49 @@
" Authors: ophirr33 <coghlan.ty@gmail.com>, rymdbar <https://rymdbar.x20.se/>
" Description: Perl::LanguageServer for perl, from cpan.org
" This should have the same value as in perl.vim
call ale#Set('perl_perl_executable', 'perl')
" Please note that perl_perl_options does not exist here.
function! ale_linters#perl#languageserver#GetProjectRoot(buffer) abort
" Makefile.PL, https://perldoc.perl.org/ExtUtils::MakeMaker
" Build.PL, https://metacpan.org/pod/Module::Build
" dist.ini, https://metacpan.org/pod/Dist::Zilla
let l:potential_roots = [ 'Makefile.PL', 'Build.PL', 'dist.ini' ]
for l:root in l:potential_roots
let l:project_root = ale#path#FindNearestFile(a:buffer, l:root)
if !empty(l:project_root)
return fnamemodify(l:project_root . '/', ':p:h:h')
endif
endfor
let l:project_root = ale#path#FindNearestFileOrDirectory(a:buffer, '.git')
if !empty(l:project_root)
return fnamemodify(l:project_root . '/', ':p:h:h')
endif
return fnamemodify(expand('#' . a:buffer . ':p:h'), ':p:h')
endfunction
call ale#Set('perl_languageserver_config', {})
function! s:get_lsp_config(buffer) abort
" This tool doesn't kick in unless workspace/didChangeConfiguration is
" called, thus this function returning a fallback dict when there is no
" config.
let l:lsp_config = ale#Var(a:buffer, 'perl_languageserver_config')
return empty(l:lsp_config) ? { 'perl': { 'enable': 1 } } : l:lsp_config
endfunction
call ale#linter#Define('perl', {
\ 'name': 'languageserver',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'perl_perl_executable')},
\ 'command': '%e -MPerl::LanguageServer -ePerl::LanguageServer::run',
\ 'lsp_config': {b -> s:get_lsp_config(b)},
\ 'project_root': function('ale_linters#perl#languageserver#GetProjectRoot'),
\ })

View File

@@ -1,6 +1,9 @@
" Author: Arizard <https://github.com/Arizard>
" Description: PHPactor integration for ALE
call ale#Set('php_phpactor_executable', 'phpactor')
call ale#Set('php_phpactor_init_options', {})
" Copied from langserver.vim
function! ale_linters#php#phpactor#GetProjectRoot(buffer) abort
let l:composer_path = ale#path#FindNearestFile(a:buffer, 'composer.json')
@@ -17,7 +20,8 @@ endfunction
call ale#linter#Define('php', {
\ 'name': 'phpactor',
\ 'lsp': 'stdio',
\ 'executable': 'phpactor',
\ 'executable': {b -> ale#Var(b, 'php_phpactor_executable')},
\ 'command': '%e language-server',
\ 'initialization_options': {b -> ale#Var(b, 'php_phpactor_init_options')},
\ 'project_root': function('ale_linters#php#phpactor#GetProjectRoot'),
\})

View File

@@ -27,6 +27,10 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
let l:level = ale#Var(a:buffer, 'php_phpstan_level')
if type(l:level) is v:t_number
let l:level = string(l:level)
endif
if empty(l:level) && empty(ale_linters#php#phpstan#FindConfigFile(a:buffer))
" if no configuration file is found, then use 4 as a default level
let l:level = '4'
@@ -83,6 +87,10 @@ function! ale_linters#php#phpstan#FindConfigFile(buffer) abort
let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.neon.dist')
endif
if empty(l:result)
let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.dist.neon')
endif
return l:result
endfunction

View File

@@ -0,0 +1,57 @@
" Author: oliverralbertini <oliver.albertini@gmail.com>
" Description: A performant type-checker supporting LSP for Python 3 created by Facebook
call ale#Set('python_pyrefly_executable', 'pyrefly')
call ale#Set('python_pyrefly_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pyrefly_auto_pipenv', 0)
call ale#Set('python_pyrefly_auto_poetry', 0)
call ale#Set('python_pyrefly_auto_uv', 0)
function! ale_linters#python#pyrefly#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyrefly_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pyrefly_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pyrefly_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_pyrefly', ['pyrefly'])
endfunction
function! ale_linters#python#pyrefly#GetCommand(buffer) abort
let l:executable = ale_linters#python#pyrefly#GetExecutable(a:buffer)
let l:exec_args = [
\ ale#Escape(l:executable)
\ ]
\ + (l:executable =~? '\(pipenv\|poetry\|uv\)$' ? ['run', 'pyrefly'] : [])
\ + [
\ 'lsp',
\ ]
return join(l:exec_args, ' ')
endfunction
function! ale_linters#python#pyrefly#GetCwd(buffer) abort
" Run from project root if found, else from buffer dir.
let l:project_root = ale#python#FindProjectRoot(a:buffer)
return !empty(l:project_root) ? l:project_root : '%s:h'
endfunction
call ale#linter#Define('python', {
\ 'name': 'pyrefly',
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#python#pyrefly#GetExecutable'),
\ 'command': function('ale_linters#python#pyrefly#GetCommand'),
\ 'project_root': function('ale#python#FindProjectRoot'),
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
\ 'cwd': function('ale_linters#python#pyrefly#GetCwd'),
\})

View File

@@ -34,6 +34,22 @@ function! ale_linters#python#ruff#GetExecutable(buffer) abort
return ale#python#FindExecutable(a:buffer, 'python_ruff', ['ruff'])
endfunction
function! ale_linters#python#ruff#RunWithVersionCheck(buffer) abort
let l:executable = ale_linters#python#ruff#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run ruff'
\ : ''
let l:command = ale#Escape(l:executable) . l:exec_args . ' --version'
return ale#semver#RunWithVersionCheck(
\ a:buffer,
\ l:executable,
\ l:command,
\ function('ale_linters#python#ruff#GetCommand'),
\)
endfunction
function! ale_linters#python#ruff#GetCwd(buffer) abort
if ale#Var(a:buffer, 'python_ruff_change_directory')
" Run from project root if found, else from buffer dir.
@@ -72,20 +88,35 @@ function! ale_linters#python#ruff#Handle(buffer, lines) abort
try
let l:item = json_decode(l:line)
catch
let l:item = v:null
" If we can't decode a line, skip it.
continue
endtry
if !empty(l:item)
call add(l:output, {
\ 'lnum': l:item.location.row,
\ 'col': l:item.location.column,
\ 'end_lnum': l:item.end_location.row,
\ 'end_col': l:item.end_location.column - 1,
\ 'code': l:item.code,
\ 'text': l:item.message,
\ 'type': l:item.code =~? '\vE\d+' ? 'E' : 'W',
\})
if empty(l:item)
continue
endif
if (l:item.code is# 'W291' || l:item.code is# 'W293')
\&& !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
" Skip warnings for trailing whitespace if the option is off.
continue
endif
if l:item.code is# 'W391'
\&& !ale#Var(a:buffer, 'warn_about_trailing_blank_lines')
" Skip warnings for trailing blank lines if the option is off
continue
endif
call add(l:output, {
\ 'lnum': l:item.location.row,
\ 'col': l:item.location.column,
\ 'end_lnum': l:item.end_location.row,
\ 'end_col': l:item.end_location.column - 1,
\ 'code': l:item.code,
\ 'text': l:item.message,
\ 'type': l:item.code =~? '\vE\d+' ? 'E' : 'W',
\})
endfor
return l:output
@@ -95,12 +126,7 @@ call ale#linter#Define('python', {
\ 'name': 'ruff',
\ 'executable': function('ale_linters#python#ruff#GetExecutable'),
\ 'cwd': function('ale_linters#python#ruff#GetCwd'),
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#python#ruff#GetExecutable(buffer),
\ '%e --version',
\ function('ale_linters#python#ruff#GetCommand'),
\ )},
\ 'command': function('ale_linters#python#ruff#RunWithVersionCheck'),
\ 'callback': 'ale_linters#python#ruff#Handle',
\ 'output_stream': 'both',
\ 'read_buffer': 1,

View File

@@ -1,9 +1,4 @@
" Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#linter#Define('review', {
\ 'name': 'redpen',
\ 'executable': 'redpen',
\ 'command': 'redpen -f review -r json %t',
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
\})
call ale#handlers#redpen#DefineLinter('review')

View File

@@ -0,0 +1,25 @@
" Author: Benjamin Block <https://github.com/benjamindblock>
" Description: A language server for Roc.
function! ale_linters#roc#roc_language_server#GetProjectRoot(buffer) abort
let l:roc_main_file = ale#path#FindNearestFile(a:buffer, 'main.roc')
if !empty(l:roc_main_file)
return fnamemodify(l:roc_main_file, ':p:h')
else
return fnamemodify('', ':h')
endif
endfunction
call ale#Set('roc_roc_language_server_executable', 'roc_language_server')
call ale#Set('roc_roc_language_server_config', {})
call ale#linter#Define('roc', {
\ 'name': 'roc_language_server',
\ 'lsp': 'stdio',
\ 'language': 'roc',
\ 'lsp_config': {b -> ale#Var(b, 'roc_roc_language_server_config')},
\ 'executable': {b -> ale#Var(b, 'roc_roc_language_server_executable')},
\ 'command': '%e',
\ 'project_root': function('ale_linters#roc#roc_language_server#GetProjectRoot'),
\})

View File

@@ -1,9 +1,4 @@
" Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#linter#Define('rst', {
\ 'name': 'redpen',
\ 'executable': 'redpen',
\ 'command': 'redpen -f rest -r json %t',
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
\})
call ale#handlers#redpen#DefineLinter('rst')

View File

@@ -1,6 +1,7 @@
call ale#Set('ruby_sorbet_executable', 'srb')
call ale#Set('ruby_sorbet_options', '')
call ale#Set('ruby_sorbet_enable_watchman', 0)
call ale#Set('ruby_sorbet_initialization_options', { 'highlightUntyped': v:false })
function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'ruby_sorbet_executable')
@@ -21,6 +22,6 @@ call ale#linter#Define('ruby', {
\ 'language': 'ruby',
\ 'executable': {b -> ale#Var(b, 'ruby_sorbet_executable')},
\ 'command': function('ale_linters#ruby#sorbet#GetCommand'),
\ 'project_root': function('ale#ruby#FindProjectRoot')
\ 'project_root': function('ale#ruby#FindProjectRoot'),
\ 'initialization_options': {b -> ale#Var(b, 'ruby_sorbet_initialization_options')}
\})

View File

@@ -9,6 +9,6 @@ call ale#linter#Define('sass', {
\ 'executable': {b -> ale#path#FindExecutable(b, 'sass_stylelint', [
\ 'node_modules/.bin/stylelint',
\ ])},
\ 'command': '%e --stdin-filename %s',
\ 'command': '%e --no-color --stdin-filename %s',
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
\})

View File

@@ -13,6 +13,7 @@ function! ale_linters#scala#metals#GetProjectRoot(buffer) abort
let l:potential_roots = [
\ 'build.sc',
\ 'build.mill',
\ 'build.sbt',
\ '.bloop',
\ '.metals',

View File

@@ -6,7 +6,7 @@ call ale#Set('scss_stylelint_use_global', get(g:, 'ale_use_global_executables',
function! ale_linters#scss#stylelint#GetCommand(buffer) abort
return '%e ' . ale#Pad(ale#Var(a:buffer, 'scss_stylelint_options'))
\ . ' --stdin-filename %s'
\ . ' --no-color --stdin-filename %s'
endfunction
call ale#linter#Define('scss', {

View File

@@ -25,6 +25,7 @@ endfunction
call ale#linter#Define('sh', {
\ 'name': 'language_server',
\ 'aliases': ['bash-language-server'],
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#sh#language_server#GetExecutable'),
\ 'command': function('ale_linters#sh#language_server#GetCommand'),

View File

@@ -7,7 +7,7 @@ call ale#Set('stylus_stylelint_use_global', get(g:, 'ale_use_global_executables'
function! ale_linters#stylus#stylelint#GetCommand(buffer) abort
return '%e'
\ . ale#Pad(ale#Var(a:buffer, 'stylus_stylelint_options'))
\ . ' --stdin-filename %s'
\ . ' --no-color --stdin-filename %s'
endfunction
call ale#linter#Define('stylus', {

View File

@@ -8,7 +8,7 @@ call ale#Set('sugarss_stylelint_use_global', get(g:, 'ale_use_global_executables
function! ale_linters#sugarss#stylelint#GetCommand(buffer) abort
return '%e ' . ale#Pad(ale#Var(a:buffer, 'sugarss_stylelint_options'))
\ . ' --syntax=sugarss'
\ . ' --stdin-filename %s'
\ . ' --no-color --stdin-filename %s'
endfunction
call ale#linter#Define('sugarss', {

View File

@@ -1,9 +1,4 @@
" Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#linter#Define('tex', {
\ 'name': 'redpen',
\ 'executable': 'redpen',
\ 'command': 'redpen -f latex -r json %t',
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
\})
call ale#handlers#redpen#DefineLinter('tex')

View File

@@ -1,9 +1,4 @@
" Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#linter#Define('text', {
\ 'name': 'redpen',
\ 'executable': 'redpen',
\ 'command': 'redpen -f plain -r json %t',
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
\})
call ale#handlers#redpen#DefineLinter('text')

View File

@@ -0,0 +1,51 @@
" Author: Ben Boeckel <github@me.benboeckel.net>
" Description: TOML Formatter / Linter / Language Server
call ale#Set('toml_tombi_executable', 'tombi')
call ale#Set('toml_tombi_lsp_options', '')
call ale#Set('toml_tombi_online', 0)
function! ale_linters#toml#tombi#GetCommand(buffer) abort
let l:offline = ''
if !ale#Var(a:buffer, 'toml_tombi_online')
let l:offline = '--offline'
endif
return '%e lsp'
\ . ale#Pad(l:offline)
\ . ale#Pad(ale#Var(a:buffer, 'toml_tombi_lsp_options'))
endfunction
function! ale_linters#toml#tombi#GetProjectRoot(buffer) abort
" Try to find nearest tombi.toml
let l:tombiconfig_file = ale#path#FindNearestFile(a:buffer, 'tombi.toml')
if !empty(l:tombiconfig_file)
return fnamemodify(l:tombiconfig_file . '/', ':p:h:h')
endif
" Try to find nearest pyproject.toml
let l:pyproject_file = ale#path#FindNearestFile(a:buffer, 'pyproject.toml')
if !empty(l:pyproject_file)
return fnamemodify(l:pyproject_file . '/', ':p:h:h')
endif
" Try to find nearest `git` directory
let l:gitdir = ale#path#FindNearestFile(a:buffer, '.git')
if !empty(l:gitdir)
return fnamemodify(l:gitdir . '/', ':p:h:h')
endif
return ''
endfunction
call ale#linter#Define('toml', {
\ 'name': 'tombi',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'toml_tombi_executable')},
\ 'command': function('ale_linters#toml#tombi#GetCommand'),
\ 'project_root': function('ale_linters#toml#tombi#GetProjectRoot'),
\})

View File

@@ -9,7 +9,9 @@ endif
" --lint-only
function! ale_linters#verilog#slang#GetCommand(buffer) abort
return 'slang -Weverything '
\ . '--diag-abs-paths '
\ . '-I%s:h '
\ . '-y%s:h '
\ . ale#Var(a:buffer, 'verilog_slang_options') .' '
\ . '%t'
endfunction
@@ -28,6 +30,7 @@ function! ale_linters#verilog#slang#Handle(buffer, lines) abort
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:item = {
\ 'filename': l:match[1],
\ 'lnum': str2nr(l:match[2]),
\ 'type': (l:match[4] is# 'error') ? 'E' : 'W',
\ 'text': s:RemoveUnicodeQuotes(l:match[5]),

View File

@@ -0,0 +1,43 @@
" Author: Nicolas Derumigny <https://github.com/nicolasderumigny>
" Description: Verible LSP for verilog
call ale#Set('verilog_verible_ls_options', '--rules_config_search')
call ale#Set('verilog_verible_ls_rules', '')
call ale#Set('verilog_verible_ls_executable', 'verible-verilog-ls')
call ale#Set('verilog_verible_ls_config', {})
function! ale_linters#verilog#verible_ls#GetProjectRoot(buffer) abort
let l:git_dir = ale#path#FindNearestFile(a:buffer, 'verible.filelist')
if !empty(l:git_dir)
return fnamemodify(l:git_dir, ':p:h')
else
return fnamemodify('', ':h')
endif
endfunction
function! ale_linters#verilog#verible_ls#GetCommand(buffer) abort
let l:command = ale#Escape(ale#Var(a:buffer, 'verilog_verible_ls_executable'))
let l:options = ale#Var(a:buffer, 'verilog_verible_ls_options')
let l:rules = ale#Var(a:buffer, 'verilog_verible_ls_rules')
if l:options isnot# ''
let l:command .= ' ' . l:options
endif
if l:rules isnot# ''
let l:command .= ' --rules=' . l:rules
endif
return l:command
endfunction
call ale#linter#Define('verilog', {
\ 'name': 'verible_ls',
\ 'lsp': 'stdio',
\ 'lsp_config': {b -> ale#Var(b, 'verilog_verible_ls_config')},
\ 'executable': {b -> ale#Var(b, 'verilog_verible_ls_executable')},
\ 'command': function('ale_linters#verilog#verible_ls#GetCommand') ,
\ 'project_root': function('ale_linters#verilog#verible_ls#GetProjectRoot'),
\})

View File

@@ -10,6 +10,7 @@ function! ale_linters#verilog#verilator#GetCommand(buffer) abort
" the path to the current file is systematically added to the search path
return 'verilator --lint-only -Wall -Wno-DECLFILENAME '
\ . '-I%s:h '
\ . '-y %s:h '
\ . ale#Var(a:buffer, 'verilog_verilator_options') .' '
\ . '%t'
endfunction

View File

@@ -12,6 +12,8 @@ let g:__ale_c_project_filenames = ['.git/HEAD', 'configure', 'Makefile', 'CMakeL
let g:ale_c_build_dir_names = get(g:, 'ale_c_build_dir_names', [
\ 'build',
\ 'build/Debug',
\ 'build/Release',
\ 'bin',
\])

View File

@@ -23,7 +23,7 @@ function! ale#cursor#TruncatedEcho(original_message) abort
" Change tabs to spaces.
let l:message = substitute(l:message, "\t", ' ', 'g')
" Remove any newlines in the message.
let l:message = substitute(l:message, "\n", '', 'g')
let l:message = substitute(l:message, "\n", ' ', 'g')
" Convert indentation groups into single spaces for better legibility when
" put on a single line
let l:message = substitute(l:message, ' \+', ' ', 'g')
@@ -93,6 +93,7 @@ function! ale#cursor#EchoCursorWarning(...) abort
if !empty(l:loc)
let l:format = ale#Var(l:buffer, 'echo_msg_format')
let l:msg = ale#GetLocItemMessage(l:loc, l:format)
call ale#cursor#TruncatedEcho(l:msg)
let l:info.echoed = 1
elseif get(l:info, 'echoed')

View File

@@ -78,7 +78,7 @@ function! ale#fix#ApplyFixes(buffer, output) abort
if !l:data.ignore_file_changed_errors
" no-custom-checks
echoerr 'The file was changed before fixing finished'
echom 'The file was changed before fixing finished'
endif
return

View File

@@ -192,6 +192,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['python'],
\ 'description': 'Tidy Python imports with pyflyby.',
\ },
\ 'unimport': {
\ 'function': 'ale#fixers#unimport#Fix',
\ 'suggested_filetypes': ['python'],
\ 'description': 'unimport fixer',
\ },
\ 'importjs': {
\ 'function': 'ale#fixers#importjs#Fix',
\ 'suggested_filetypes': ['javascript'],
@@ -722,6 +727,36 @@ let s:default_registry = {
\ 'suggested_filetypes': ['typst'],
\ 'description': 'A formatter for Typst files',
\ },
\ 'roc_format': {
\ 'function': 'ale#fixers#roc_format#Fix',
\ 'suggested_filetypes': ['roc'],
\ 'description': 'Formats Roc files.',
\ },
\ 'roc_annotate': {
\ 'function': 'ale#fixers#roc_annotate#Fix',
\ 'suggested_filetypes': ['roc'],
\ 'description': 'Annotates all top-level definitions in Roc files.',
\ },
\ 'tombi_format': {
\ 'function': 'ale#fixers#tombi_format#Fix',
\ 'suggested_filetypes': ['toml'],
\ 'description': 'Formats TOML files',
\ },
\ 'tombi_lint': {
\ 'function': 'ale#fixers#tombi_lint#Fix',
\ 'suggested_filetypes': ['toml'],
\ 'description': 'Lints TOML files',
\ },
\ 'verible_format': {
\ 'function': 'ale#fixers#verible_format#Fix',
\ 'suggested_filetypes': ['verilog'],
\ 'description': 'Formats verilog files using verible.',
\ },
\ 'markdownlint': {
\ 'function': 'ale#fixers#markdownlint#Fix',
\ 'suggested_filetypes': ['markdown'],
\ 'description': 'Fix markdown files with markdownlint.',
\ },
\}
" Reset the function registry to the default entries.

View File

@@ -1,12 +1,11 @@
function! ale#fixers#biome#Fix(buffer) abort
let l:executable = ale#handlers#biome#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'biome_options')
let l:apply = ale#Var(a:buffer, 'biome_fixer_apply_unsafe') ? '--write --unsafe' : '--write'
let l:unsafe = ale#Var(a:buffer, 'biome_fixer_apply_unsafe') ? ' --unsafe' : ''
return {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape(l:executable) . ' check ' . l:apply
\ 'command': ale#Escape(l:executable) . ' check '
\ . '--write --stdin-file-path %s' . l:unsafe
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' %t'
\}
endfunction

View File

@@ -22,7 +22,7 @@ function! ale#fixers#clangformat#Fix(buffer) abort
let l:use_local_file = ale#Var(a:buffer, 'c_clangformat_use_local_file')
if l:style_option isnot# ''
let l:style_option = '-style=' . "'" . l:style_option . "'"
let l:style_option = '-style=' . ale#Escape(l:style_option)
endif
if l:use_local_file

View File

@@ -17,10 +17,11 @@ let s:variables = {
\}
function! ale#fixers#erlang_mode#Fix(buffer) abort
let emacs_executable =
let l:emacs_executable =
\ ale#Var(a:buffer, 'erlang_erlang_mode_emacs_executable')
let l:exprs = [
\ '(setq enable-local-variables :safe)',
\ s:SetqDefault(a:buffer, s:variables),
\ '(erlang-mode)',
\ '(font-lock-fontify-region (point-min) (point-max))',

View File

@@ -1,32 +1,48 @@
" Author: Ian Stapleton Cordasco <graffatcolmingov@gmail.com>
" Description: Run golangci-lint with the --fix flag to autofix some issues
call ale#Set('go_golangci_lint_options', '')
call ale#Set('go_golangci_lint_executable', 'golangci-lint')
call ale#Set('go_golangci_lint_package', 1)
call ale#Set('go_golangci_formatter_options', '')
call ale#Set('go_golangci_formatter_executable', 'golangci-lint')
function! ale#fixers#golangci_lint#GetCommand(buffer) abort
function! ale#fixers#golangci_lint#GetExecutable(buffer) abort
let l:executable = ale#Var(a:buffer, 'go_golangci_formatter_executable')
return l:executable
endfunction
function! ale#fixers#golangci_lint#GetCommand(buffer, version) abort
let l:filename = expand('#' . a:buffer . ':t')
let l:executable = ale#Var(a:buffer, 'go_golangci_lint_executable')
let l:options = ale#Var(a:buffer, 'go_golangci_lint_options') . ' --fix'
let l:package_mode = ale#Var(a:buffer, 'go_golangci_lint_package')
let l:executable = ale#fixers#golangci_lint#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'go_golangci_formatter_options')
let l:env = ale#go#EnvString(a:buffer)
if l:package_mode
if ale#semver#GTE(a:version, [2, 0, 0])
return l:env . ale#Escape(l:executable)
\ . ' run '
\ . l:options
\ . ' fmt --stdin '
\ . l:options
else
return l:env . ale#Escape(l:executable)
\ . ' run --fix '
\ . l:options
\ . ' '
\ . ale#Escape(l:filename)
endif
endfunction
return l:env . ale#Escape(l:executable)
\ . ' run '
\ . l:options
\ . ' ' . ale#Escape(l:filename)
function! ale#fixers#golangci_lint#GetCommandForVersion(buffer, version) abort
return {
\ 'command': ale#fixers#golangci_lint#GetCommand(a:buffer, a:version)
\}
endfunction
function! ale#fixers#golangci_lint#Fix(buffer) abort
return {
\ 'command': ale#fixers#golangci_lint#GetCommand(a:buffer),
\}
let l:executable = ale#fixers#golangci_lint#GetExecutable(a:buffer)
let l:command = ale#fixers#golangci_lint#GetExecutable(a:buffer) . ale#Pad('--version')
return ale#semver#RunWithVersionCheck(
\ a:buffer,
\ l:executable,
\ l:command,
\ function('ale#fixers#golangci_lint#GetCommandForVersion'),
\)
endfunction

View File

@@ -0,0 +1,15 @@
:scriptencoding utf-8
call ale#Set('markdownlint_executable', 'markdownlint')
call ale#Set('markdownlint_options', '--fix')
function! ale#fixers#markdownlint#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'markdownlint_executable')
let l:options = ale#Var(a:buffer, 'markdownlint_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' ' . l:options,
\}
endfunction

View File

@@ -0,0 +1,21 @@
" Author: Benjamin Block <https://github.com/benjamindblock>
" Description: Official type annotation tool for Roc.
call ale#Set('roc_roc_annotate_executable', 'roc')
call ale#Set('roc_roc_annotate_options', '')
function! ale#fixers#roc_annotate#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'roc_roc_annotate_executable')
let l:command = l:executable . ' format annotate'
let l:options = ale#Var(a:buffer, 'roc_roc_annotate_options')
if l:options isnot# ''
let l:command .= ' ' . l:options
endif
return {
\ 'command': l:command . ' %t',
\ 'read_temporary_file': 1,
\}
endfunction

View File

@@ -0,0 +1,20 @@
" Author: Benjamin Block <https://github.com/benjamindblock>
" Description: Official formatter for Roc.
call ale#Set('roc_roc_format_executable', 'roc')
call ale#Set('roc_roc_format_options', '')
function! ale#fixers#roc_format#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'roc_roc_format_executable')
let l:command = l:executable . ' format'
let l:options = ale#Var(a:buffer, 'roc_roc_format_options')
if l:options isnot# ''
let l:command .= ' ' . l:options
endif
return {
\ 'command': l:command . ' %t',
\ 'read_temporary_file': 1,
\}
endfunction

View File

@@ -19,20 +19,34 @@ function! ale#fixers#rubocop#PostProcess(buffer, output) abort
return a:output[l:line :]
endfunction
function! ale#fixers#rubocop#GetCommand(buffer) abort
function! ale#fixers#rubocop#GetCommand(buffer, version) abort
let l:executable = ale#Var(a:buffer, 'ruby_rubocop_executable')
let l:options = ale#Var(a:buffer, 'ruby_rubocop_options')
let l:auto_correct_all = ale#Var(a:buffer, 'ruby_rubocop_auto_correct_all')
let l:editor_mode = ale#semver#GTE(a:version, [1, 61, 0])
return ale#ruby#EscapeExecutable(l:executable, 'rubocop')
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . (l:auto_correct_all ? ' --auto-correct-all' : ' --auto-correct')
\ . (l:editor_mode ? ' --editor-mode' : '')
\ . ' --force-exclusion --stdin %s'
endfunction
function! ale#fixers#rubocop#Fix(buffer) abort
function! ale#fixers#rubocop#GetCommandForVersion(buffer, version) abort
return {
\ 'command': ale#fixers#rubocop#GetCommand(a:buffer),
\ 'process_with': 'ale#fixers#rubocop#PostProcess'
\ 'command': ale#fixers#rubocop#GetCommand(a:buffer, a:version),
\ 'process_with': 'ale#fixers#rubocop#PostProcess'
\}
endfunction
function! ale#fixers#rubocop#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'ruby_rubocop_executable')
let l:command = l:executable . ale#Pad('--version')
return ale#semver#RunWithVersionCheck(
\ a:buffer,
\ l:executable,
\ l:command,
\ function('ale#fixers#rubocop#GetCommandForVersion'),
\)
endfunction

View File

@@ -20,7 +20,7 @@ function! ale#fixers#stylelint#Fix(buffer) abort
\ 'cwd': '%s:h',
\ 'command': ale#node#Executable(a:buffer, l:executable)
\ . ale#Pad(l:options)
\ . ' --fix --stdin --stdin-filename %s',
\ . ' --fix --stdin --no-color --stdin-filename %s',
\ 'read_temporary_file': 0,
\}
endfunction

View File

@@ -0,0 +1,22 @@
" Author: Ben Boeckel <github@me.benboeckel.net>
" Description: Integration of tombi formatting with ALE.
call ale#Set('toml_tombi_executable', 'tombi')
call ale#Set('toml_tombi_format_options', '')
call ale#Set('toml_tombi_online', 0)
function! ale#fixers#tombi_format#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'toml_tombi_executable')
let l:offline = ''
if !ale#Var(a:buffer, 'toml_tombi_online')
let l:offline = '--offline'
endif
return {
\ 'command': ale#Escape(l:executable)
\ . ' format'
\ . ale#Pad(l:offline)
\ . ale#Pad(ale#Var(a:buffer, 'toml_tombi_format_options')),
\}
endfunction

View File

@@ -0,0 +1,22 @@
" Author: Ben Boeckel <github@me.benboeckel.net>
" Description: Integration of tombi linting with ALE.
call ale#Set('toml_tombi_executable', 'tombi')
call ale#Set('toml_tombi_lint_options', '')
call ale#Set('toml_tombi_online', 0)
function! ale#fixers#tombi_lint#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'toml_tombi_executable')
let l:offline = ''
if !ale#Var(a:buffer, 'toml_tombi_online')
let l:offline = '--offline'
endif
return {
\ 'command': ale#Escape(l:executable)
\ . ' lint'
\ . ale#Pad(l:offline)
\ . ale#Pad(ale#Var(a:buffer, 'toml_tombi_lint_options')),
\}
endfunction

View File

@@ -0,0 +1,42 @@
call ale#Set('python_unimport_executable', 'unimport')
call ale#Set('python_unimport_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_unimport_options', '')
call ale#Set('python_unimport_auto_pipenv', 0)
call ale#Set('python_unimport_auto_poetry', 0)
call ale#Set('python_unimport_auto_uv', 0)
function! ale#fixers#unimport#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_unimport_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_unimport_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_unimport_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_unimport', ['unimport'])
endfunction
function! ale#fixers#unimport#Fix(buffer) abort
let l:executable = ale#fixers#unimport#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? '\(pipenv\|poetry\|uv\)$'
call extend(l:cmd, ['run', 'unimport'])
endif
let l:options = ale#Var(a:buffer, 'python_unimport_options')
if !empty(l:options)
call add(l:cmd, l:options)
endif
return {'command': join(l:cmd, ' ')}
endfunction

View File

@@ -0,0 +1,17 @@
" Author: Nicolas Derumigny <https://github.com/nicolasderumigny>
" Description: verible formatter for verilog.
call ale#Set('verilog_verible_format_executable', 'verible-verilog-format')
call ale#Set('verilog_verible_format_options', '')
function! ale#fixers#verible_format#Fix(buffer) abort
let l:executable = ale#Escape(ale#Var(a:buffer, 'verilog_verible_format_executable'))
let l:command = l:executable
let l:options = ale#Var(a:buffer, 'verilog_verible_format_options')
if l:options isnot# ''
let l:command .= ' ' . l:options
endif
return {'command': l:command . ' -'}
endfunction

View File

@@ -36,7 +36,7 @@ function! ale#handlers#css#HandleCSSLintFormat(buffer, lines) abort
endfunction
function! ale#handlers#css#HandleStyleLintFormat(buffer, lines) abort
let l:exception_pattern = '\v^Error:'
let l:exception_pattern = '\v^(Syntax)?Error:'
for l:line in a:lines[:10]
if len(matchlist(l:line, l:exception_pattern)) > 0

View File

@@ -1,6 +1,8 @@
" Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#Set('redpen_options', '')
function! ale#handlers#redpen#HandleRedpenOutput(buffer, lines) abort
" Only one file was passed to redpen. So response array has only one
" element.
@@ -63,3 +65,14 @@ function! ale#handlers#redpen#HandleRedpenOutput(buffer, lines) abort
return l:output
endfunction
" Define the redpen linter for a given filetype.
function! ale#handlers#redpen#DefineLinter(filetype) abort
call ale#linter#Define(a:filetype, {
\ 'name': 'redpen',
\ 'executable': 'redpen',
\ 'command': {b -> 'redpen -f ' . a:filetype . ' -r json' . ale#Pad(ale#Var(b, 'redpen_options')) . ' %t'},
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
\})
endfunction

View File

@@ -63,6 +63,12 @@ function! ale#handlers#shellcheck#GetCommand(buffer, version) abort
\ . ' -f ' . l:format . ' -'
endfunction
function! s:ShouldIgnoreErrorCode(buffer, code) abort
" Skip warnings for trailing whitespace if the option is off.
return a:code is# 'SC1101'
\ && !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
endfunction
function! s:HandleShellcheckJSON(buffer, lines) abort
try
let l:errors = json_decode(a:lines[0])
@@ -87,11 +93,17 @@ function! s:HandleShellcheckJSON(buffer, lines) abort
let l:type = 'W'
endif
let l:code = 'SC' . l:error['code']
if s:ShouldIgnoreErrorCode(a:buffer, l:code)
continue
endif
let l:item = {
\ 'lnum': l:error['line'],
\ 'type': l:type,
\ 'text': l:error['message'],
\ 'code': 'SC' . l:error['code'],
\ 'code': l:code,
\ 'detail': l:error['message'] . "\n\nFor more information:\n https://www.shellcheck.net/wiki/SC" . l:error['code'],
\}
@@ -107,7 +119,6 @@ function! s:HandleShellcheckJSON(buffer, lines) abort
let l:item.end_lnum = l:error['endLine']
endif
" If the filename is something like <stdin>, <nofile> or -, then
" this is an error for the file we checked.
if has_key(l:error, 'file')
@@ -135,11 +146,17 @@ function! s:HandleShellcheckGCC(buffer, lines) abort
let l:type = 'W'
endif
let l:code = l:match[6]
if s:ShouldIgnoreErrorCode(a:buffer, l:code)
continue
endif
let l:item = {
\ 'lnum': str2nr(l:match[2]),
\ 'type': l:type,
\ 'text': l:match[5],
\ 'code': l:match[6],
\ 'code': l:code,
\ 'detail': l:match[5] . "\n\nFor more information:\n https://www.shellcheck.net/wiki/" . l:match[6],
\}

View File

@@ -11,6 +11,7 @@ let s:linters = {}
" NOTE: Update the g:ale_linter_aliases documentation when modifying this.
let s:default_ale_linter_aliases = {
\ 'Dockerfile': 'dockerfile',
\ 'bash': 'sh',
\ 'csh': 'sh',
\ 'javascriptreact': ['javascript', 'jsx'],
\ 'plaintex': 'tex',

View File

@@ -531,7 +531,7 @@ function! ale#lsp#StartProgram(conn_id, executable, command) abort
if g:ale_use_neovim_lsp_api && !l:conn.is_tsserver
" For Windows from 'cmd /s/c "foo bar"' we need 'foo bar'
let l:lsp_cmd = has('win32') && type(a:command) is v:t_string
\ ? ['cmd', '/s/c/', a:command[10:-2]]
\ ? ['cmd', '/s/c', a:command[10:-2]]
\ : a:command
" Always call lsp.start, which will either create or re-use a
@@ -706,7 +706,7 @@ function! ale#lsp#Send(conn_id, message) abort
throw 'LSP server not initialized yet!'
endif
if g:ale_use_neovim_lsp_api
if g:ale_use_neovim_lsp_api && !l:conn.is_tsserver
return luaeval('require("ale.lsp").send_message(_A)', {
\ 'client_id': l:conn.client_id,
\ 'is_notification': a:message[0] == 1 ? v:true : v:false,

View File

@@ -28,7 +28,7 @@ function! ale#lsp#response#ReadDiagnostics(diagnostics) abort
for l:diagnostic in a:diagnostics
let l:severity = get(l:diagnostic, 'severity', 0)
let l:loclist_item = {
\ 'text': substitute(l:diagnostic.message, '\(\r\n\|\n\|\r\)', ' ', 'g'),
\ 'text': l:diagnostic.message,
\ 'type': 'E',
\ 'lnum': l:diagnostic.range.start.line + 1,
\ 'col': l:diagnostic.range.start.character + 1,

View File

@@ -62,6 +62,36 @@ function! ale#path#FindNearestDirectory(buffer, directory_name) abort
return ''
endfunction
" Given a buffer and a filename, find the nearest file or directory by
" searching upwards through the paths relative to the given buffer.
function! ale#path#FindNearestFileOrDirectory(buffer, filename) abort
let l:buffer_filename = fnamemodify(bufname(a:buffer), ':p')
let l:buffer_filename = fnameescape(l:buffer_filename)
let l:relative_path_file = findfile(a:filename, l:buffer_filename . ';')
let l:relative_path_dir = finddir(a:filename, l:buffer_filename . ';')
" If we find both a file and directory, choose the shorter response by
" making the longer one empty instead.
if !empty(l:relative_path_file) && !empty(l:relative_path_dir)
if strlen(l:relative_path_file) > strlen(l:relative_path_dir)
let l:relative_path_dir = ''
else
let l:relative_path_file = ''
endif
endif
if !empty(l:relative_path_file)
return fnamemodify(l:relative_path_file, ':p')
endif
if !empty(l:relative_path_dir)
return fnamemodify(l:relative_path_dir, ':p')
endif
return ''
endfunction
" Given a buffer, a string to search for, and a global fallback for when
" the search fails, look for a file in parent paths, and if that fails,
" use the global fallback path instead.
@@ -115,20 +145,24 @@ endfunction
" Return 1 if a path is an absolute path.
function! ale#path#IsAbsolute(filename) abort
if has('win32') && a:filename[:0] is# '\'
return 1
if has('win32')
return a:filename[:0] =~# '[\\/]' || a:filename[0:2] =~? '[A-Z]:[/\\]'
else
return a:filename[:0] is# '/'
endif
" Check for /foo and C:\foo, etc.
return a:filename[:0] is# '/' || a:filename[1:2] is# ':\'
endfunction
let s:temp_dir = ale#path#Simplify(fnamemodify(ale#util#Tempname(), ':h:h'))
let s:resolved_temp_dir = resolve(s:temp_dir)
" Given a filename, return 1 if the file represents some temporary file
" created by Vim.
" created by Vim. If the temporary location is symlinked (e.g. macOS), some
" linters may report the resolved version of the path, so both are checked.
function! ale#path#IsTempName(filename) abort
return ale#path#Simplify(a:filename)[:len(s:temp_dir) - 1] is# s:temp_dir
let l:filename = ale#path#Simplify(a:filename)
return l:filename[:len(s:temp_dir) - 1] is# s:temp_dir
\|| l:filename[:len(s:resolved_temp_dir) - 1] is# s:resolved_temp_dir
endfunction
" Given a base directory, which must not have a trailing slash, and a

View File

@@ -26,7 +26,6 @@ function! ale#python#FindProjectRootIni(buffer) abort
" If you change this, update ale-python-root documentation.
if filereadable(l:path . '/MANIFEST.in')
\|| filereadable(l:path . '/setup.cfg')
\|| filereadable(l:path . '/pytest.ini')
\|| filereadable(l:path . '/tox.ini')
\|| filereadable(l:path . '/.pyre_configuration.local')
\|| filereadable(l:path . '/mypy.ini')
@@ -55,11 +54,12 @@ endfunction
" Given a buffer number, find the project root directory for Python.
" The root directory is defined as the first directory found while searching
" upwards through paths, including the current directory, until a path
" containing an init file (one from MANIFEST.in, setup.cfg, pytest.ini,
" tox.ini) is found. If it is not possible to find the project root directory
" via init file, then it will be defined as the first directory found
" searching upwards through paths, including the current directory, until no
" __init__.py files is found.
" containing an configuration file is found. (See list above)
"
" If it is not possible to find the project root directory via configuration
" file, then it will be defined as the first directory found searching upwards
" through paths, including the current directory, until no __init__.py files
" is found.
function! ale#python#FindProjectRoot(buffer) abort
let l:ini_root = ale#python#FindProjectRootIni(a:buffer)
@@ -200,7 +200,7 @@ function! ale#python#PoetryPresent(buffer) abort
return findfile('poetry.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# ''
endfunction
" Detects whether a poetry environment is present.
" Detects whether a uv environment is present.
function! ale#python#UvPresent(buffer) abort
return findfile('uv.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# ''
endfunction

View File

@@ -1,4 +1,5 @@
let g:ale_default_navigation = get(g:, 'ale_default_navigation', 'buffer')
let g:ale_references_show_contents = get(g:, 'ale_references_show_contents', 1)
let s:references_map = {}
@@ -67,17 +68,33 @@ function! ale#references#HandleTSServerResponse(conn_id, response) abort
endfunction
function! ale#references#FormatLSPResponseItem(response_item, options) abort
let l:line_text = ''
let l:line= a:response_item.range.start.line
let l:col = a:response_item.range.start.character
let l:filename = ale#util#ToResource(a:response_item.uri)
if get(a:options, 'show_contents') == 1
try
let l:line_text = substitute(readfile(l:filename)[l:line], '^\s*\(.\{-}\)\s*$', '\1', '')
catch
" This happens in tests
endtry
endif
if get(a:options, 'open_in') is# 'quickfix'
return {
\ 'filename': ale#util#ToResource(a:response_item.uri),
\ 'filename': l:filename,
\ 'lnum': a:response_item.range.start.line + 1,
\ 'col': a:response_item.range.start.character + 1,
\ 'text': l:line_text,
\}
else
return {
\ 'filename': ale#util#ToResource(a:response_item.uri),
\ 'line': a:response_item.range.start.line + 1,
\ 'column': a:response_item.range.start.character + 1,
\ 'filename': l:filename,
\ 'line': l:line + 1,
\ 'column': l:col + 1,
\ 'match': l:line_text,
\}
endif
endfunction
@@ -147,6 +164,7 @@ function! s:OnReady(line, column, options, linter, lsp_details) abort
let s:references_map[l:request_id] = {
\ 'use_relative_paths': has_key(a:options, 'use_relative_paths') ? a:options.use_relative_paths : 0,
\ 'open_in': get(a:options, 'open_in', 'current-buffer'),
\ 'show_contents': a:options.show_contents,
\}
endfunction
@@ -165,6 +183,8 @@ function! ale#references#Find(...) abort
let l:options.open_in = 'vsplit'
elseif l:option is? '-quickfix'
let l:options.open_in = 'quickfix'
elseif l:option is? '-contents'
let l:options.show_contents = 1
endif
endfor
endif
@@ -177,6 +197,10 @@ function! ale#references#Find(...) abort
endif
endif
if !has_key(l:options, 'show_contents')
let l:options.show_contents = ale#Var(bufnr(''), 'references_show_contents')
endif
let l:buffer = bufnr('')
let [l:line, l:column] = getpos('.')[1:2]
let l:column = min([l:column, len(getline(l:line))])

View File

@@ -44,5 +44,39 @@ g:ale_ansible_ansible_lint_executable
This variable can be changed to modify the executable used for ansible-lint.
*ale-options.ansible_ansible_lint_auto_pipenv*
*g:ale_ansible_ansible_lint_auto_pipenv*
*b:ale_ansible_ansible_lint_auto_pipenv*
ansible_ansible_lint_auto_pipenv
g:ale_ansible_ansible_lint_auto_pipenv
Type: |Number|
Default: `0`
Detect whether the file is inside a pipenv, and set the executable to `pipenv`
if true. This is overridden by a manually-set executable.
*ale-options.ansible_ansible_lint_auto_poetry*
*g:ale_ansible_ansible_lint_auto_poetry*
*b:ale_ansible_ansible_lint_auto_poetry*
ansible_ansible_lint_auto_poetry
g:ale_ansible_ansible_lint_auto_poetry
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
*ale-options.ansible_ansible_lint_auto_uv*
*g:ale_ansible_ansible_lint_auto_uv*
*b:ale_ansible_ansible_lint_auto_uv*
ansible_ansible_lint_auto_uv
g:ale_ansible_ansible_lint_auto_uv
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@@ -20,5 +20,11 @@ textlint *ale-asciidoc-textlint*
See |ale-text-textlint|
===============================================================================
redpen *ale-asciidoc-redpen*
See |ale-redpen-options|
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

32
doc/ale-bindzone.txt Normal file
View File

@@ -0,0 +1,32 @@
===============================================================================
ALE BINDZone Integration *ale-bindzone-options*
===============================================================================
checkzone *ale-bindzone-checkzone*
*ale-options.bindzone_checkzone_executable*
*g:ale_bindzone_checkzone_executable*
*b:ale_bindzone_checkzone_executable*
bindzone_checkzone_executable
g:ale_bindzone_checkzone_executable
Type: |String|
Default: `named-checkzone`
This variable can be changed to set the path to named-checkzone executable.
*ale-options.bindzone_checkzone_options*
*g:ale_bindzone_checkzone_options*
*b:ale_bindzone_checkzone_options*
bindzone_checkzone_options
g:ale_bindzone_checkzone_options
Type: |String|
Default: `-c IN`
This variable can be changed to add additional command-line arguments.
All available options can be found at:
https://bind9.readthedocs.io/en/stable/manpages.html#named-checkzone-zone-file-validation-tool
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@@ -26,7 +26,7 @@ g:ale_c_always_make
c_build_dir_names
g:ale_c_build_dir_names
Type: |List|
Default: `['build', 'bin']`
Default: `['build', 'build/Debug', 'build/Release', 'bin']`
A list of directory names to be used when searching upwards from C files
to discover compilation databases with. For directory named `'foo'`, ALE

View File

@@ -41,5 +41,51 @@ Just put the following in `ftdetect/cloudformation.vim`: >
This will get both cloudformation and yaml linters to work on any file with
`.template.yaml` extension.
===============================================================================
checkov *ale-cloudformation-checkov*
*ale-options.cloudformation_checkov_executable*
*g:ale_cloudformation_checkov_executable*
*b:ale_cloudformation_checkov_executable*
cloudformation_checkov_executable
g:ale_cloudformation_checkov_executable
Type: |String|
Default: `'checkov'`
This variable can be changed to use a different executable for checkov.
*ale-options.cloudformation_checkov_options*
*g:ale_cloudformation_checkov_options*
*b:ale_cloudformation_checkov_options*
cloudformation_checkov_options
g:ale_cloudformation_checkov_options
Type: |String|
Default: `''`
This variable can be changed to set additional options for checkov.
-------------------------------------------------------------------------------
Configuration
To get chekov to work with cloudformation files (rather than general yaml
files) we must set the buffer |filetype| to `yaml.cloudformation`. This
causes ALE to lint the file with linters configured for cloudformation and
YAML files.
One option is to put the following in `ftdetect/cloudformation.vim`: >
au BufRead,BufNewFile *.template.yaml set filetype=yaml.cloudformation
This will get both cloudformation and yaml linters to work on any file with
`.template.yaml` extension.
Another option is to check for the presence of 'AWSTemplateFormatVersion' in
the yaml file: >
au BufRead,BufNewFile *.yaml,*.yml if search('AWSTemplateFormatVersion', 'nw') | set filetype=yaml.cloudformation | endif
<
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@@ -85,9 +85,11 @@ The following general coding standards should be adhered to for Vim code.
* Try to keep lines no longer than 80 characters, but this isn't an absolute
requirement.
* Use 4 spaces for every level of indentation in Vim code.
* Add a blank line before every `function`, `if`, `for`, `while`, or `return`,
which doesn't start a new level of indentation. This makes the logic in
your code easier to follow.
* Add a blank line before every `function`, `if`, `for`, `while`, `try`, or `return`,
which doesn't start a new level of indentation. When adding more code on the
same indentation level, also add blank lines after every corresponding end
for those mentioned keywords. This makes the logic in your code easier to
follow.
* End every file with a trailing newline character, but not with extra blank
lines. Remove trailing whitespace from the ends of lines.
* Write the full names of commands instead of abbreviations. For example, write
@@ -424,11 +426,11 @@ running tests. >
Add-Type -A System.IO.Compression.FileSystem
Invoke-WebRequest ftp://ftp.vim.org/pub/vim/pc/vim80-586w32.zip -OutFile C:\vim.zip
Invoke-WebRequest https://github.com/dense-analysis/ale/releases/download/v4.0.0/vim80-586w32.zip -OutFile C:\vim.zip
[IO.Compression.ZipFile]::ExtractToDirectory('C:\vim.zip', 'C:\vim')
rm C:\vim.zip
Invoke-WebRequest ftp://ftp.vim.org/pub/vim/pc/vim80-586rt.zip -OutFile C:\rt.zip
Invoke-WebRequest https://github.com/dense-analysis/ale/releases/download/v4.0.0/vim80-586rt.zip -OutFile C:\rt.zip
[IO.Compression.ZipFile]::ExtractToDirectory('C:\rt.zip', 'C:\vim')
rm C:\rt.zip

View File

@@ -139,8 +139,28 @@ g:ale_elixir_lexical_release
For example, set release to: `/home/projects/lexical/_build/dev/rel/lexical`
There are currnetly no configuration options for lexical.
There are currently no configuration options for lexical.
===============================================================================
expert *ale-elixir-expert*
Expert (https://github.com/elixir-lang/expert)
*ale-options.elixir_expert_executable*
*g:ale_elixir_expert_executable*
*b:ale_elixir_expert_executable*
elixir_expert_executable
g:ale_elixir_expert_executable
Type: |String|
Default: `/usr/bin/elixir-expert`
Location of the expert executable.
For example, set release to:
`/home/projects/expert/apps/expert/burrito_out/expert_linux_amd64`
There are currently no configuration options for expert.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@@ -2,6 +2,29 @@
ALE Fortran Integration *ale-fortran-options*
===============================================================================
fortitude *ale-fortran-fortitude*
*ale-options.fortran_fortitude_executable*
*g:fortran_fortitude_executable*
*b:fortran_fortitude_executable*
fortran_fortitude_executable
g:fortran_fortitude_executable
Type: |String|
Default: 'fortitude'
This variable can be changed to modify the executable used for fortitude.
*ale-options.fortran_fortitude_options*
*g:fortran_fortitude_options*
*b:fortran_fortitude_options*
fortran_fortitude_options
g:fortran_fortitude_options
Type: |String|
Default: ''
This variable can be changed to modify options given to fortitude check.
===============================================================================
gcc *ale-fortran-gcc*
@@ -63,6 +86,5 @@ g:ale_fortran_language_server_use_global
See |ale-integrations-local-executables|
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@@ -144,7 +144,7 @@ g:ale_go_golangci_lint_options
Default: `''`
This variable can be changed to alter the command-line arguments to the
golangci-lint invocation.
golangci-lint run invocation.
*ale-options.go_golangci_lint_package*
*g:ale_go_golangci_lint_package*
@@ -157,6 +157,30 @@ g:ale_go_golangci_lint_package
When set to `1`, the whole Go package will be checked instead of only the
current file.
golangci_lint can also be user as a fixer to format go source files. In this
case the following configuration variables can be used to configure the
formatters:
*ale-options.go_golangci_formatter_executable*
*g:ale_go_golangci_formatter_executable*
*b:ale_go_golangci_formatter_executable*
go_golangci_formatter_executable
g:ale_go_golangci_formatter_executable
Type: |String|
Default: `'golangci-lint'`
The executable that will be run for golangci-lint.
*ale-options.go_golangci_formatter_options*
*g:ale_go_golangci_formatter_options*
*b:ale_go_golangci_formatter_options*
go_golangci_formatter_options
g:ale_go_golangci_formatter_options
Type: |String|
Default: `''`
This variable can be changed to alter the command-line arguments to the
golangci-lint fmt invocation.
===============================================================================
golangserver *ale-go-golangserver*

View File

@@ -206,6 +206,24 @@ g:ale_html_stylelint_use_global
See |ale-integrations-local-executables|
===============================================================================
superhtml *ale-html-superhtml*
g:ale_html_superhtml_executable *g:ale_html_superhtml_executable*
*b:ale_html_superhtml_executable*
Type: |String|
Default: `'superhtml'`
This variable can be changed to use a different executable for superhtml.
g:ale_html_superhtml_use_global *g:ale_html_superhtml_use_global*
*b:ale_html_superhtml_use_global*
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
===============================================================================
tidy *ale-html-tidy*

View File

@@ -8,5 +8,9 @@ djlint *ale-jinja-djlint*
See |ale-html-djlint|
===============================================================================
j2lint *ale-jinja-j2lint*
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

29
doc/ale-lean.txt Normal file
View File

@@ -0,0 +1,29 @@
===============================================================================
ALE Lean Integration *ale-lean-options*
*ale-integration-lean*
===============================================================================
Integration Information
Currently, the only supported LSP for Lean 4 is lake.
===============================================================================
lake *ale-lean-lake*
g:ale_lean_lake_executable *g:ale_lean_lake_executable*
*b:ale_lean_lake_executable*
Type: |String|
Default: `'lake'`
This variable can be modified to change the executable path for `lake`.
g:ale_lean_lake_config *g:ale_lean_lake_config*
*b:ale_lean_lake_config*
Type: |Dictionary|
Default: `{}`
Dictionary with configuration settings for lake.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@@ -49,17 +49,22 @@ g:ale_lua_language_server_executable
If you have compiled the language server yourself in `/some/path`, the path
will be `'/some/path/bin/lua-language-server'`.
*ale-options.lua_lua_language_server_config*
*g:ale_lua_lua_language_server_config*
*b:ale_lua_lua_language_server_config*
lua_lua_language_server_config
g:ale_lua_lua_language_server_config
*ale-options.lua_language_server_config*
*g:ale_lua_language_server_config*
*b:ale_lua_language_server_config*
lua_language_server_config
g:ale_lua_language_server_config
Type: |Dictionary|
Default: `{}`
Dictionary containing configuration settings that will be passed to the
language server.
For available configuration parameters, see `Settings` on the luals wiki:
https://luals.github.io/wiki/settings/
===============================================================================
luac *ale-lua-luac*

View File

@@ -225,5 +225,11 @@ write-good *ale-markdown-write-good*
See |ale-write-good-options|
===============================================================================
redpen *ale-markdown-redpen*
See |ale-redpen-options|
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@@ -35,6 +35,42 @@ g:ale_perl_perl_options
invocation.
===============================================================================
perl language server *ale-perl-languageserver*
perl_perl_executable
g:ale_perl_perl_executable
Type: |String|
Default: `'perl'`
The language server will use the same variable as |ale-perl-perl| to launch
the perl executable with the Perl::LanguageServer module.
*ale-options.perl_languageserver_config*
*g:ale_perl_languageserver_config*
*b:ale_perl_languageserver_config*
perl_languageserver_config
g:ale_perl_languageserver_config
Type: |Dictionary|
Default: `'{}'`
This variable can be changed to customize the lsp_config (sent as a
workspace/didChangeConfiguration command).
For example: >
let g:ale_perl_languageserver_config = {
\ 'perl': {
\ 'fileFilter': [''],
\ 'logLevel': 2,
\ 'logFile': '/tmp/plls-log.txt',
\ 'perlInc': ['/usr/share/perl5/', '/usr/local/share/perl5/' ],
\ },
\}
<
For all available options and explanations, visit
https://metacpan.org/pod/Perl::LanguageServer#Extension-Settings
===============================================================================
perlcritic *ale-perl-perlcritic*

View File

@@ -78,6 +78,36 @@ g:ale_php_phan_use_client
instead of the phan standalone.
===============================================================================
phpactor *ale-php-phpactor*
*ale-options.php_phpactor_executable*
*g:ale_php_phpactor_executable*
*b:ale_php_phpactor_executable*
php_phpactor_executable
g:ale_php_phpactor_executable
Type: |String|
Default: `'phpactor'`
This variable sets executable used for phpactor.
php_phpactor_init_options
g:ale_php_phpactor_init_options
Type: |Dictionary|
Default: `'{}'`
This variable can be changed to customize the LSP initialization_options.
For example: >
let g:ale_php_phpactor_init_options = {
\ 'language_server_phpstan.enabled': v:false,
\ 'language_server_psalm.enabled': v:false,
\ 'worse_reflection.stub_dir': '%application_root%/.php-stubs'
\}
<
For all available options and explanations, visit
https://phpactor.readthedocs.io/en/master/reference/configuration.html
===============================================================================
phpcbf *ale-php-phpcbf*

View File

@@ -63,7 +63,6 @@ ALE will look for configuration files with the following filenames. >
MANIFEST.in
setup.cfg
pytest.ini
tox.ini
.pyre_configuration.local
mypy.ini
@@ -81,6 +80,7 @@ ALE will look for configuration files with the following filenames. >
poetry.lock
pyproject.toml
.tool-versions
uv.lock
<
The first directory containing any of the files named above will be used.
@@ -1465,7 +1465,7 @@ g:ale_python_pylsp_executable
See |ale-integrations-local-executables|
Set this to `'pipenv'` to invoke `'pipenv` `run` `pylsp'`.
Set this to `'poetry'` to invoke `'poetry` `run` `pyls'`.
Set this to `'poetry'` to invoke `'poetry` `run` `pylsp'`.
*ale-options.python_pylsp_use_global*
*g:ale_python_pylsp_use_global*
@@ -1616,6 +1616,69 @@ g:ale_python_pyre_auto_uv
executable.
===============================================================================
pyrefly *ale-python-pyrefly*
`pyrefly` will be run from a detected project root, per |ale-python-root|.
*ale-options.python_pyrefly_executable*
*g:ale_python_pyrefly_executable*
*b:ale_python_pyrefly_executable*
python_pyrefly_executable
g:ale_python_pyrefly_executable
Type: |String|
Default: `'pyrefly'`
See |ale-integrations-local-executables|
Set this to `'pipenv'` to invoke `'pipenv` `run` `pyrefly'`.
Set this to `'poetry'` to invoke `'poetry` `run` `pyrefly'`.
Set this to `'uv'` to invoke `'uv` `run` `pyrefly'`.
*ale-options.python_pyrefly_use_global*
*g:ale_python_pyrefly_use_global*
*b:ale_python_pyrefly_use_global*
python_pyrefly_use_global
g:ale_python_pyrefly_use_global
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
*ale-options.python_pyrefly_auto_pipenv*
*g:ale_python_pyrefly_auto_pipenv*
*b:ale_python_pyrefly_auto_pipenv*
python_pyrefly_auto_pipenv
g:ale_python_pyrefly_auto_pipenv
Type: |Number|
Default: `0`
Detect whether the file is inside a pipenv, and set the executable to `pipenv`
if true. This is overridden by a manually-set executable.
*ale-options.python_pyrefly_auto_poetry*
*g:ale_python_pyrefly_auto_poetry*
*b:ale_python_pyrefly_auto_poetry*
python_pyrefly_auto_poetry
g:ale_python_pyrefly_auto_poetry
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
*ale-options.python_pyrefly_auto_uv*
*g:ale_python_pyrefly_auto_uv*
*b:ale_python_pyrefly_auto_uv*
python_pyrefly_auto_uv
g:ale_python_pyrefly_auto_uv
Type: |Number|
Default: `0`
Set the executable to `uv` if true. This is overridden by a manually-set
executable.
===============================================================================
pyright *ale-python-pyright*

79
doc/ale-roc.txt Normal file
View File

@@ -0,0 +1,79 @@
===============================================================================
ALE Roc Integration *ale-roc-options*
*ale-integration-roc*
===============================================================================
roc_language_server *ale-roc-roc-language-server*
*ale-options.roc_roc_language_server_executable*
*g:ale_roc_roc_language_server_executable*
*b:ale_roc_roc_language_server_executable*
roc_roc_language_server_executable
g:ale_roc_roc_language_server_executable
Type: |String|
Default: `'roc_language_server'`
This variable can be modified to change the executable path for
`roc_language_server`.
*ale-options.roc_roc_language_server_config*
*g:ale_roc_roc_language_server_config*
*b:ale_roc_roc_language_server_config*
roc_roc_language_server_config
g:ale_roc_roc_language_server_config
Type: |Dictionary|
Default: `{}`
Dictionary with configuration settings for roc_language_server.
===============================================================================
roc_format *ale-roc-roc-format*
*ale-options.roc_roc_format_executable*
*g:ale_roc_roc_format_executable*
*b:ale_roc_roc_format_executable*
roc_roc_format_executable
g:ale_roc_roc_format_executable
Type: |String|
Default: `'roc'`
This variable can be modified to change the executable path for `roc`.
*ale-options.roc_roc_format_options*
*g:ale_roc_roc_format_options*
*b:ale_roc_roc_format_options*
roc_roc_format_options
g:ale_roc_roc_format_options
Type: String
Default: `''`
Additional flags for `roc format`.
===============================================================================
roc_annotate *ale-roc-roc-annotate*
*ale-options.roc_roc_annotate_executable*
*g:ale_roc_roc_annotate_executable*
*b:ale_roc_roc_annotate_executable*
roc_roc_annotate_executable
g:ale_roc_roc_annotate_executable
Type: |String|
Default: `'roc'`
This variable can be modified to change the executable path for `roc`.
*ale-options.roc_roc_annotate_options*
*g:ale_roc_roc_annotate_options*
*b:ale_roc_roc_annotate_options*
roc_roc_annotate_options
g:ale_roc_roc_annotate_options
Type: String
Default: `''`
Additional flags for `roc format annotate`.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@@ -267,6 +267,23 @@ g:ale_ruby_sorbet_enable_watchman
to files from outside of vim. Defaults to disable watchman because it
requires watchman to be installed separately from sorbet.
*ale-options.ruby_sorbet_initialization_options*
*g:ale_ruby_sorbet_initialization_options*
*b:ale_ruby_sorbet_initialization_options*
ruby_sorbet_initialization_options
g:ale_ruby_sorbet_initialization_options
Type: |Dictionary|
Default: `{ 'highlightUntyped': v:false }`
This variable can be changed to modify initialization options provided to
the Sorbet language server. By default, a minimal object with defaults is
provided to ensure proper LSP initialization.
Setting this variable to a an empty object will cause sorbet LSP to
fail during initialization.
See https://sorbet.org/docs/lsp#initialize-request for available options.
===============================================================================
standardrb *ale-ruby-standardrb*

View File

@@ -33,8 +33,8 @@ Integration Information
5. rustfmt -- If you have `rustfmt` installed, you can use it as a fixer to
consistently reformat your Rust code.
Only cargo and rust-analyze are enabled by default. To switch to using rustc
instead of cargo, configure |b:ale_linters| in your ftplugin file
Only cargo and rust-analyzer are enabled by default. To switch to using
rustc instead of cargo, configure |b:ale_linters| in your ftplugin file
appropriately: >
" See the help text for the option for more information.

View File

@@ -33,8 +33,8 @@ g:ale_scala_metals_project_root
Default: `''`
By default the project root is found by searching upwards for `build.sbt`,
`build.sc`, `.bloop` or `.metals`. If the project root is elsewhere, you
can override the project root directory.
`build.sc`, `build.mill`, `.bloop` or `.metals`. If the project root is elsewhere,
you can override the project root directory.
===============================================================================

View File

@@ -60,6 +60,8 @@ Notes:
* `bibclean`
* Bicep
* `bicep`
* Bindzone
* `checkzone` (named-checkzone)
* BitBake
* `oelint-adv`
* Bourne Shell
@@ -119,6 +121,7 @@ Notes:
* `joker`
* CloudFormation
* `cfn-python-lint`
* `checkov`
* CMake
* `cmake-format`
* `cmake-lint`
@@ -177,6 +180,7 @@ Notes:
* `dialyxir`
* `dogma`!!
* `elixir-ls`
* `expert`
* `lexical`
* `mix`!!
* Elm
@@ -203,6 +207,7 @@ Notes:
* `fish` (-n flag)
* `fish_indent`
* Fortran
* `fortitude`
* `gcc`
* `language_server`
* Fountain
@@ -285,6 +290,7 @@ Notes:
* `prettier`
* `proselint`
* `rustywind`
* `superhtml`
* `tidy`
* `write-good`
* HTML Angular
@@ -332,6 +338,7 @@ Notes:
* `xo`
* Jinja
* djlint
* j2lint
* JSON
* `VSCode JSON language server`
* `biome`
@@ -370,6 +377,8 @@ Notes:
* `textlint`
* `vale`
* `write-good`
* Lean 4
* `lake`
* Less
* `lessc`
* `prettier`
@@ -467,6 +476,7 @@ Notes:
* Pawn
* `uncrustify`
* Perl
* `languageserver`
* `perl -c`
* `perl-critic`
* `perltidy`
@@ -541,6 +551,7 @@ Notes:
* `pylint`!!
* `pylsp`
* `pyre`
* `pyrefly`
* `pyright`
* `refurb`
* `reorder-python-imports`
@@ -584,6 +595,10 @@ Notes:
* `write-good`
* Robot
* `rflint`
* Roc
* roc_annotate
* roc_format
* roc_language_server
* RPM spec
* `rpmlint`
* Ruby
@@ -689,6 +704,7 @@ Notes:
* `thriftcheck`
* TOML
* `dprint`
* `tombi`
* TypeScript
* `biome`
* `cspell`
@@ -713,6 +729,7 @@ Notes:
* `hdl-checker`
* `iverilog`
* slang
* `verible`
* `verilator`
* `vlog`
* `xvlog`

View File

@@ -111,5 +111,11 @@ g:ale_tex_texlab_config
let g:ale_tex_texlab_config = {"build":{"onSave":v:true}}
<
===============================================================================
redpen *ale-tex-redpen*
See |ale-redpen-options|
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@@ -51,5 +51,11 @@ write-good *ale-text-write-good*
See |ale-write-good-options|
===============================================================================
redpen *ale-text-redpen*
See |ale-redpen-options|
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@@ -8,5 +8,70 @@ dprint *ale-toml-dprint*
See |ale-dprint-options| and https://dprint.dev/plugins/toml
===============================================================================
tombi *ale-toml-tombi*
`'tombi'` is a TOML formatter, linter, and language server.
*ale-options.toml_tombi_executable*
*g:ale_toml_tombi_executable*
*b:ale_toml_tombi_executable*
toml_tombi_executable
g:ale_toml_tombi_executable
Type: |String|
Default: `'tombi'`
This variable can be modified to change the executable path for
`tombi`.
*ale-options.toml_tombi_online*
*g:ale_toml_tombi_online*
*b:ale_toml_tombi_online*
toml_tombi_online
g:ale_toml_tombi_online
Type: |Boolean|
Default: `1`
This variable can be modified allow fetching remote schemas when using
`tombi`.
*ale-options.toml_tombi_lsp_options*
*g:ale_toml_tombi_lsp_options*
*b:ale_toml_tombi_lsp_options*
toml_tombi_lsp_options
g:ale_toml_tombi_lsp_options
Type: |String|
Default: `''`
This variable can be modified to provide options when using `tombi` as an
LSP server.
*ale-options.toml_tombi_format_options*
*g:ale_toml_tombi_format_options*
*b:ale_toml_tombi_format_options*
toml_tombi_format_options
g:ale_toml_tombi_format_options
Type: |String|
Default: `''`
This variable can be modified to provide options when using `tombi` as a
formatter.
*ale-options.toml_tombi_lint_options*
*g:ale_toml_tombi_lint_options*
*b:ale_toml_tombi_lint_options*
toml_tombi_lint_options
g:ale_toml_tombi_lint_options
Type: |String|
Default: `''`
This variable can be modified to provide options when using `tombi` as a
linter.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@@ -3,7 +3,7 @@ ALE Verilog/SystemVerilog Integration *ale-verilog-options*
===============================================================================
ALE can use seven different linters for Verilog HDL:
ALE can use eight different linters for Verilog HDL:
HDL Checker
Using `hdl_checker --lsp`
@@ -14,6 +14,9 @@ ALE can use seven different linters for Verilog HDL:
slang:
Using `slang -Weverything`
verible_ls
Using `verible-verilog-ls`
verilator
Using `verilator --lint-only -Wall`
@@ -35,6 +38,12 @@ defining 'g:ale_linters' variable: >
\ let g:ale_linters = {'systemverilog' : ['verilator'],}
<
===============================================================================
ALE can use one fixer for Verilog HDL:
verible_fomat
Using `verible-verilog-format`
===============================================================================
General notes
@@ -70,18 +79,84 @@ iverilog *ale-verilog-iverilog*
===============================================================================
slang *ale-verilog-slang*
*ale-options.verilog_slang_option*
*g:ale_verilog_slang_option*
*ale-options.verilog_slang_options*
*g:ale_verilog_slang_options*
*b:ale_verilog_slang_options*
verilog_slang_option
g:ale_verilog_slang_option
verilog_slang_options
g:ale_verilog_slang_options
Type: |String|
Default: `''`
This variable can be changed to modify 'slang' command arguments.
===============================================================================
verible_ls *ale-verilog-verible-ls*
*ale-config.verilog_verible_ls_executable*
*g:ale_verilog_verible_ls_executable*
*b:ale_verilog_verible_ls_executable*
verilog_verible_ls_executable
g:ale_verilog_verible_ls_executable
Type: |String|
Default: `'verible-verilog-ls'`
This variable can be modifies to change the executable path for `verible_ls`
*ale-config.verilog_verible_ls_config*
*g:ale_verilog_verible_ls_config*
*b:ale_verilog_verible_ls_config*
verilog_verible_ls_config
g:ale_verilog_verible_ls_config
Type: |Dictionary|
Default: `{}`
Dictionary with configuration settings for `verible_ls`
*ale-config.verilog_verible_ls_options*
*g:ale_verilog_verible_ls_options*
*b:ale_verilog_verible_ls_options*
verilog_verible_ls_options
g:ale_verilog_verible_ls_options
Type: |String|
Default: `'--rules_config_search'`
Additional flags for `verible_ls`
*ale-config.verilog_verible_ls_rules*
*g:ale_verilog_verible_ls_rules*
*b:ale_verilog_verible_ls_rules*
verilog_verible_ls_rules
g:ale_verilog_verible_ls_rules
Type: |String|
Default: `''`
Additional rules applied by `verible_ls`
===============================================================================
verible_format *ale-verilog-verible-format*
*ale-config.verilog_verible_format_executable*
*g:ale_verilog_verible_format_executable*
*b:ale_verilog_verible_format_executable*
verilog_verible_format_executable
g:ale_verilog_verible_format_executable
Type: |String|
Default: `'verible-verilog-format'`
This variable can be modifies to change the executable path for
`verible_format`
*ale-config.verilog_verible_format_options*
*g:ale_verilog_verible_format_options*
*b:ale_verilog_verible_format_options*
verilog_verible_format_options
g:ale_verilog_verible_format_options
Type: |String|
Default: `''`
Additional flags for `verible_format`
===============================================================================
verilator *ale-verilog-verilator*
*ale-options.verilog_verilator_options*

View File

@@ -30,7 +30,8 @@ CONTENTS *ale-contents*
7.2 Options for cspell................|ale-cspell-options|
7.3 Options for languagetool..........|ale-languagetool-options|
7.4 Options for write-good............|ale-write-good-options|
7.5 Other Linter/Fixer Options........|ale-other-integration-options|
7.5 Options for redpen................|ale-redpen-options|
7.6 Other Linter/Fixer Options........|ale-other-integration-options|
8. Commands/Keybinds....................|ale-commands|
9. API..................................|ale-api|
10. Special Thanks......................|ale-special-thanks|
@@ -1192,13 +1193,13 @@ g:ale_detail_to_floating_preview
*b:ale_disable_lsp*
disable_lsp
g:ale_disable_lsp
Type: |Number| OR |String|
Type: |Boolean| OR |Number| OR |String|
Default: `'auto'`
When this option is set to `'auto'`, ALE will automatically disable linters
that it detects as having already been configured with the `nvim-lspconfig`
plugin. When this option is set to `1`, ALE ignores all linters powered by
LSP, and also `tsserver`.
plugin. When this option is set to `true` or `1`, ALE ignores all linters
powered by LSP, and also `tsserver`.
Any linters that are disabled will also not be usable for LSP functionality
other than just linting.
@@ -1735,6 +1736,7 @@ g:ale_linter_aliases
{
\ 'Dockerfile': 'dockerfile',
\ 'bash': 'sh',
\ 'csh': 'sh',
\ 'javascriptreact': ['javascript', 'jsx'],
\ 'plaintex': 'tex',
@@ -2268,6 +2270,16 @@ g:ale_popup_menu_enabled
This setting must be set to `true` or `1` before ALE is loaded for this
behavior to be enabled. See |ale-lint-settings-on-startup|.
*ale-options.references_show_contents*
*g:ale_references_show_contents*
references_show_contents
g:ale_references_show_contents
Type: |Boolean| or |Number|
Default: true
If set to `true` or `1`, matches found by `:ALEFindReferences` will be
shown with a preview of the matching line.
*ale-options.rename_tsserver_find_in_comments*
*g:ale_rename_tsserver_find_in_comments*
rename_tsserver_find_in_comments
@@ -3320,7 +3332,24 @@ g:ale_writegood_use_global
-------------------------------------------------------------------------------
7.6. Other Linter/Fixer Options *ale-other-integration-options*
7.6. Options for redpen *ale-redpen-options*
The options for `redpen` are shared between all filetypes, so options can
be configured once.
*ale-options.redpen_options*
*g:ale_redpen_options*
*b:ale_redpen_options*
redpen_options
g:ale_redpen_options
Type: |String|
Default: `''`
This variable can be set to pass additional options to redpen.
-------------------------------------------------------------------------------
7.7. Other Linter/Fixer Options *ale-other-integration-options*
ALE supports a very wide variety of tools. Other linter or fixer options are
documented in additional help files.
@@ -3341,6 +3370,7 @@ documented in additional help files.
cspell................................|ale-asciidoc-cspell|
write-good............................|ale-asciidoc-write-good|
textlint..............................|ale-asciidoc-textlint|
redpen................................|ale-asciidoc-redpen|
asm.....................................|ale-asm-options|
gcc...................................|ale-asm-gcc|
llvm_mc...............................|ale-asm-llvm_mc|
@@ -3360,6 +3390,8 @@ documented in additional help files.
bicep...................................|ale-bicep-options|
bicep.................................|ale-bicep-bicep|
az_bicep..............................|ale-bicep-az_bicep|
bindzone................................|ale-bindzone-options|
checkzone.............................|ale-bindzone-checkzone|
bitbake.................................|ale-bitbake-options|
oelint-adv............................|ale-bitbake-oelint_adv|
c.......................................|ale-c-options|
@@ -3387,6 +3419,7 @@ documented in additional help files.
joker.................................|ale-clojure-joker|
cloudformation..........................|ale-cloudformation-options|
cfn-python-lint.......................|ale-cloudformation-cfn-python-lint|
checkov...............................|ale-cloudformation-checkov|
cmake...................................|ale-cmake-options|
cmakelint.............................|ale-cmake-cmakelint|
cmake-lint............................|ale-cmake-cmake-lint|
@@ -3457,6 +3490,7 @@ documented in additional help files.
credo.................................|ale-elixir-credo|
cspell................................|ale-elixir-cspell|
lexical...............................|ale-elixir-lexical|
expert................................|ale-elixir-expert|
elm.....................................|ale-elm-options|
elm-format............................|ale-elm-elm-format|
elm-ls................................|ale-elm-elm-ls|
@@ -3477,6 +3511,7 @@ documented in additional help files.
fish....................................|ale-fish-options|
fish_indent...........................|ale-fish-fish_indent|
fortran.................................|ale-fortran-options|
fortitude.............................|ale-fortran-fortitude|
gcc...................................|ale-fortran-gcc|
language_server.......................|ale-fortran-language-server|
fountain................................|ale-fountain-options|
@@ -3552,6 +3587,7 @@ documented in additional help files.
prettier..............................|ale-html-prettier|
rustywind.............................|ale-html-rustywind|
stylelint.............................|ale-html-stylelint|
superhtml.............................|ale-html-superhtml|
tidy..................................|ale-html-tidy|
vscodehtml............................|ale-html-vscode|
write-good............................|ale-html-write-good|
@@ -3600,6 +3636,7 @@ documented in additional help files.
xo....................................|ale-javascript-xo|
jinja...................................|ale-jinja-options|
djlint................................|ale-jinja-djlint|
j2lint................................|ale-jinja-j2lint|
json....................................|ale-json-options|
biome.................................|ale-json-biome|
clang-format..........................|ale-json-clangformat|
@@ -3631,6 +3668,8 @@ documented in additional help files.
cspell................................|ale-latex-cspell|
write-good............................|ale-latex-write-good|
textlint..............................|ale-latex-textlint|
lean....................................|ale-lean-options|
lake..................................|ale-lean-lake|
less....................................|ale-less-options|
lessc.................................|ale-less-lessc|
prettier..............................|ale-less-prettier|
@@ -3660,6 +3699,7 @@ documented in additional help files.
remark-lint...........................|ale-markdown-remark-lint|
textlint..............................|ale-markdown-textlint|
write-good............................|ale-markdown-write-good|
redpen................................|ale-markdown-redpen|
mercury.................................|ale-mercury-options|
mmc...................................|ale-mercury-mmc|
nasm....................................|ale-nasm-options|
@@ -3714,6 +3754,7 @@ documented in additional help files.
uncrustify............................|ale-pawn-uncrustify|
perl....................................|ale-perl-options|
perl..................................|ale-perl-perl|
perl language server..................|ale-perl-languageserver|
perlcritic............................|ale-perl-perlcritic|
perltidy..............................|ale-perl-perltidy|
perl6...................................|ale-perl6-options|
@@ -3722,6 +3763,7 @@ documented in additional help files.
cspell................................|ale-php-cspell|
langserver............................|ale-php-langserver|
phan..................................|ale-php-phan|
phpactor..............................|ale-php-phpactor|
phpcbf................................|ale-php-phpcbf|
phpcs.................................|ale-php-phpcs|
phpmd.................................|ale-php-phpmd|
@@ -3783,6 +3825,7 @@ documented in additional help files.
pylint................................|ale-python-pylint|
pylsp.................................|ale-python-pylsp|
pyre..................................|ale-python-pyre|
pyrefly...............................|ale-python-pyrefly|
pyright...............................|ale-python-pyright|
refurb................................|ale-python-refurb|
reorder-python-imports................|ale-python-reorder_python_imports|
@@ -3817,6 +3860,10 @@ documented in additional help files.
write-good............................|ale-restructuredtext-write-good|
robot...................................|ale-robot-options|
rflint................................|ale-robot-rflint|
roc.....................................|ale-roc-options|
roc_language_server...................|ale-roc-roc-language-server|
roc_format............................|ale-roc-roc-format|
roc_annotate..........................|ale-roc-roc-annotate|
ruby....................................|ale-ruby-options|
brakeman..............................|ale-ruby-brakeman|
cspell................................|ale-ruby-cspell|
@@ -3906,6 +3953,7 @@ documented in additional help files.
lacheck...............................|ale-tex-lacheck|
latexindent...........................|ale-tex-latexindent|
texlab................................|ale-tex-texlab|
redpen................................|ale-tex-redpen|
texinfo.................................|ale-texinfo-options|
cspell................................|ale-texinfo-cspell|
write-good............................|ale-texinfo-write-good|
@@ -3913,11 +3961,13 @@ documented in additional help files.
cspell................................|ale-text-cspell|
textlint..............................|ale-text-textlint|
write-good............................|ale-text-write-good|
redpen................................|ale-text-redpen|
thrift..................................|ale-thrift-options|
thrift................................|ale-thrift-thrift|
thriftcheck...........................|ale-thrift-thriftcheck|
toml....................................|ale-toml-options|
dprint................................|ale-toml-dprint|
tombi.................................|ale-toml-tombi|
typescript..............................|ale-typescript-options|
biome.................................|ale-typescript-biome|
cspell................................|ale-typescript-cspell|
@@ -3940,6 +3990,8 @@ documented in additional help files.
hdl-checker...........................|ale-verilog-hdl-checker|
iverilog..............................|ale-verilog-iverilog|
slang.................................|ale-verilog-slang|
verible_ls............................|ale-verilog-verible-ls|
verible_format........................|ale-verilog-verible-format|
verilator.............................|ale-verilog-verilator|
vlog..................................|ale-verilog-vlog|
xvlog.................................|ale-verilog-xvlog|
@@ -4032,10 +4084,14 @@ documented in additional help files.
`:ALEFindReferences -split` - Open the location in a horizontal split.
`:ALEFindReferences -vsplit` - Open the location in a vertical split.
`:ALEFindReferences -quickfix` - Put the locations into quickfix list.
`:ALEFindReferences -contents` - Show line contents for matches.
The default method used for navigating to a new location can be changed
by modifying |g:ale_default_navigation|.
The default behaviour on whether to show line content for matches can
be changed by modifying |g:ale_references_show_contents|.
You can add `-relative` to the command to view results with relatives paths,
instead of absolute paths. This option has no effect if `-quickfix` is used.

View File

@@ -67,7 +67,7 @@ module.send = function(buffer, loclist)
local local_cfg = { priority = sign_priority }
local global_cfg = vim.diagnostic.config().signs
if type(global_cfg) == "boolean" then
if global_cfg == false or global_cfg == true or global_cfg == nil then
signs = local_cfg
elseif type(global_cfg) == "table" then
signs = vim.tbl_extend("force", global_cfg, local_cfg)

View File

@@ -150,12 +150,14 @@ module.send_message = function(args)
success, request_id = client.request(
args.method,
args.params,
---@diagnostic disable-next-line: param-type-mismatch
function(_, result, _, _)
vim.fn["ale#lsp#HandleResponse"](client.name, {
id = request_id,
result = result,
})
end,
---@diagnostic disable-next-line: param-type-mismatch
-1
)

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