Compare commits

..

107 Commits

Author SHA1 Message Date
w0rp 2a3af30fb6 Clarify supported-tools.md table
CI / Build (push) Has been cancelled
CI / Neovim 0.10 Windows (push) Has been cancelled
CI / Neovim 0.12 Windows (push) Has been cancelled
CI / Vim 8.2 Windows (push) Has been cancelled
CI / Vim 9.2 Windows (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Lua (push) Has been cancelled
CI / Neovim 0.10 Linux (push) Has been cancelled
CI / Neovim 0.12 Linux (push) Has been cancelled
CI / Vim 8.2 Linux (push) Has been cancelled
CI / Vim 9.2 Linux (push) Has been cancelled
2026-05-17 10:57:00 +01:00
w0rp c25eaa30df Update instructions for humans and agents
CI / Build (push) Has been cancelled
CI / Neovim 0.10 Windows (push) Has been cancelled
CI / Neovim 0.12 Windows (push) Has been cancelled
CI / Vim 8.2 Windows (push) Has been cancelled
CI / Vim 9.2 Windows (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Lua (push) Has been cancelled
CI / Neovim 0.10 Linux (push) Has been cancelled
CI / Neovim 0.12 Linux (push) Has been cancelled
CI / Vim 8.2 Linux (push) Has been cancelled
CI / Vim 9.2 Linux (push) Has been cancelled
2026-05-16 22:26:46 +01:00
w0rp ec599ef5a7 Add a Codex hook to emit a stop trigger we can spy on 2026-05-16 12:57:23 +01:00
w0rp 2d5a15d501 Close #4971 - Add support for ty via LSP
CI / Build (push) Has been cancelled
CI / Neovim 0.10 Windows (push) Has been cancelled
CI / Neovim 0.12 Windows (push) Has been cancelled
CI / Vim 8.2 Windows (push) Has been cancelled
CI / Vim 9.2 Windows (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Lua (push) Has been cancelled
CI / Neovim 0.10 Linux (push) Has been cancelled
CI / Neovim 0.12 Linux (push) Has been cancelled
CI / Vim 8.2 Linux (push) Has been cancelled
CI / Vim 9.2 Linux (push) Has been cancelled
2026-05-16 12:32:08 +01:00
w0rp f3d85691a5 Add Codex configuration blocking git writes
CI / Build (push) Has been cancelled
CI / Neovim 0.10 Windows (push) Has been cancelled
CI / Neovim 0.12 Windows (push) Has been cancelled
CI / Vim 8.2 Windows (push) Has been cancelled
CI / Vim 9.2 Windows (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Lua (push) Has been cancelled
CI / Neovim 0.10 Linux (push) Has been cancelled
CI / Neovim 0.12 Linux (push) Has been cancelled
CI / Vim 8.2 Linux (push) Has been cancelled
CI / Vim 9.2 Linux (push) Has been cancelled
2026-05-16 00:03:06 +01:00
w0rp 307f2b99ff Close #5112 - Support newer Pyright and other LSPs
Add support for dynamic capability registration for the diagnostic
pull model to support Pyright >= 1.1.407 and other language servers.

This is a rather complex and intricate change tested with Pyright and
gopls, and may need further tweaking if something breaks with another
server.
2026-05-15 23:38:34 +01:00
w0rp 7b5b854fc4 Close #5002 - Support getting g:ale_root as a String
CI / Build (push) Has been cancelled
CI / Neovim 0.10 Windows (push) Has been cancelled
CI / Neovim 0.12 Windows (push) Has been cancelled
CI / Vim 8.2 Windows (push) Has been cancelled
CI / Vim 9.2 Windows (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Lua (push) Has been cancelled
CI / Neovim 0.10 Linux (push) Has been cancelled
CI / Neovim 0.12 Linux (push) Has been cancelled
CI / Vim 8.2 Linux (push) Has been cancelled
CI / Vim 9.2 Linux (push) Has been cancelled
2026-05-15 21:06:54 +01:00
Matheus Gabriel Werny 916c8764ce Support for tex-fmt (#5127)
CI / Build (push) Has been cancelled
CI / Neovim 0.10 Windows (push) Has been cancelled
CI / Neovim 0.12 Windows (push) Has been cancelled
CI / Vim 8.2 Windows (push) Has been cancelled
CI / Vim 9.2 Windows (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Lua (push) Has been cancelled
CI / Neovim 0.10 Linux (push) Has been cancelled
CI / Neovim 0.12 Linux (push) Has been cancelled
CI / Vim 8.2 Linux (push) Has been cancelled
CI / Vim 9.2 Linux (push) Has been cancelled
* Support for tex-fmt

Support for tex-fmt, https://github.com/WGUNDERWOOD/tex-fmt.

* Remove file type plaintex

Remove file type plaintex as tex-fmt is solely for LaTeX.
See
https://superuser.com/questions/208177/vim-and-tex-filetypes-plaintex-vs-tex
for a distinction.
2026-05-14 23:00:05 +01:00
w0rp 641294465e #5057: Avoid mixing slashes for Windows temporary files 2026-05-14 22:30:52 +01:00
w0rp c809c68f7e Automatically request me to review everything
CI / Build (push) Has been cancelled
CI / Neovim 0.10 Windows (push) Has been cancelled
CI / Neovim 0.12 Windows (push) Has been cancelled
CI / Vim 8.2 Windows (push) Has been cancelled
CI / Vim 9.2 Windows (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Lua (push) Has been cancelled
CI / Neovim 0.10 Linux (push) Has been cancelled
CI / Neovim 0.12 Linux (push) Has been cancelled
CI / Vim 8.2 Linux (push) Has been cancelled
CI / Vim 9.2 Linux (push) Has been cancelled
2026-05-14 21:08:58 +01:00
Horacio Sanson 78122497f5 Replace appveyor with GitHub actions (#5119)
CI / Build (push) Has been cancelled
CI / Neovim 0.10 Windows (push) Has been cancelled
CI / Neovim 0.12 Windows (push) Has been cancelled
CI / Vim 8.2 Windows (push) Has been cancelled
CI / Vim 9.2 Windows (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Lua (push) Has been cancelled
CI / Neovim 0.10 Linux (push) Has been cancelled
CI / Neovim 0.12 Linux (push) Has been cancelled
CI / Vim 8.2 Linux (push) Has been cancelled
CI / Vim 9.2 Linux (push) Has been cancelled
* fix(tests): fix ale_c_build_dir_names being unset in tests (#5109)

- Use ale#Set() to set the ale_c_build_dir_names variable.
- Ensure SetUpLinterTest() is called before any Save commands in tests.
- Add c.vim to runtime before non-linter tests are executed.
- Remove workarounds in c.vim.

* feat: Load Prettier from cjs also

* Replace AppVeyor with GitHub Actions for Windows CI

Migrate Windows tests from AppVeyor (which hangs on PRs) to native GitHub
Actions using rhysd/action-setup-vim to install editors dynamically.

- Add test_ale_windows job testing Vim 9.0, Neovim 0.7, and Neovim 0.8
  on windows-latest, running in parallel with existing Linux CI
- Set fail-fast: false so all matrix entries report results independently
- Update run-tests.bat to accept VIM_EXE and VIM_HEADLESS env vars
  instead of hardcoding C:\vim\vim\vim80\vim.exe
- Add -n -i NONE and --not-a-term flags to avoid E211 temp file errors
  caused by Windows 8.3 short name paths losing drive letters
- Override TMP/TEMP to C:\tmp in CI to avoid 8.3 path mangling
- Use mklink /J directory junction for C:\testplugin to avoid modifying
  146+ test files that reference /testplugin/ paths
- Update doc/ale-development.txt section 4.3 for the new setup
- Remove AppVeyor badge from README.md
- Delete .appveyor.yml

Fix pre-existing Windows test failures now visible with Neovim on Windows:

- autoload/ale/c.vim: ParseCompileCommandsFlags bufnr() fails when the
  buffer path has a drive letter but the compile_commands key does not.
  Add fallback path comparison using ale#path#RemoveDriveLetter() so
  exact file matches work regardless of drive letter presence.
- autoload/ale/path.vim: FindNearestFile and FindNearestDirectory now
  return ale#path#Simplify() paths, fixing mixed slash separators on
  Windows that caused test_write_good.vader to fail.
- test/smoke_test.vader: echo output has trailing \r on Windows. Change
  strip pattern from ' *$' to '[\r ]*$' in all TestCallback functions.
- test/test_prepare_command.vader: &shellcmdflag on Windows is '/s /c'
  not '/c'. Use split(&shellcmdflag) in expected values so the test
  adapts to the actual default.
- test/test_lint_file_linters.vader: Increase WaitForJobs timeout from
  2000ms to 10000ms to prevent spurious timeouts on Windows CI runners.
- test/test_writefile_function.vader: Dissociate buffer from temp file
  before deleting it to avoid E211 on Windows.

* Fix Windows path handling and test compatibility issues

Production code fixes:
- ale/path.vim: Apply Simplify to buffer_filename in IsBufferPath to fix
  forward-slash vs backslash mismatch on Neovim Windows; handle .\ prefix
- ale/c.vim: Use iterative key-matching via RemoveDriveLetter for both
  file_lookup and dir_lookup in ParseCompileCommandsFlags
- ale/filename_mapping.vim: Normalize suffix separators when mapping target
  uses forward slashes (fixes mixed-separator paths on Windows)
- cuda/nvcc.vim: Apply Simplify before fnamemodify(:p) to fix path doubling

Test fixes:
- smoke_test: Use safe get() indexing and add retry loop for PowerShell test
- test_loclist_corrections: Use Simplify for cross-platform buffer paths
- test_ocaml_ocamllsp: Set buffer outside project tree before AssertLSPProject
- test_tex_textlint: Set buffer outside node_modules tree on Windows
- test_setting_problems_found_in_previous_buffers: Use cmd on Windows
- test_lint_file_linters: Increase WaitForJobs timeout to 30s

* Fix Vim 9.0 tempname() format change and simplify PowerShell test

Vim 9.0 changed tempname() to return a flat path (e.g. C:\tmp\VIMXXXXXXXX)
instead of the nested C:\tmp\VIMxxx\NNN format. Using :h:h on the flat
format resolves to the drive root, causing IsTempName() to match every
path on the drive. This broke tslint handler tests, loclist_corrections,
and setting_problems_found_in_previous_buffers tests.

Fix s:temp_dir to detect when :h:h yields a root path and fall back to :h.
Add GetTempBase() helper in test_format_command.vader with same logic.
Simplify smoke_test PowerShell test to avoid multi-command chaining that
produces unreliable output on Vim 9.0.

* fix(tests): normalize Windows path handling in Vim 9 CI

Treat win64 and win32unix as Windows in path and job helpers so compile_commands lookups and async command execution behave consistently on GitHub Actions. Normalize NVCC parsed filenames after absolute expansion to keep expected Windows paths stable in handler tests.

* fix(tests): handle Windows variants in command paths

Use a shared Windows check for command formatting and execution paths so Vim 9 on GitHub Actions still uses CMD-specific behavior. Apply the same check in filename mapping suffix normalization so Windows-style temporary and mapped paths are converted consistently in tests.

* ci: test newer Vim and Neovim versions

Update Linux and Windows test targets to newer Vim and Neovim releases in GitHub Actions and the local run-tests workflow. Refresh the Docker test image and helper scripts so the selected editor versions can be built and executed consistently across environments.

* fix(tests): adapt checks for Neovim 0.12 and Python 3.12

- Replace deprecated imp with import.util in python tests.
- Reorder ale.txt to match help files order.
- Add lines to sign test to ensure there are enough lines for the signs.

* fix(tests): avoid ftplugin side-effects in uncrustify test

* fix(tests): stabilize Windows Vim smoke and path mapping cases

Harden smoke_test callback handling for Vim job output race conditions on Windows by safely handling empty callback output lists instead of indexing output[0].\n\nMake disabling_ale assertions compare against a baseline message history entry so preexisting Vim startup messages do not cause false failures.\n\nUpdate path-mapping tests to account for Vim 9 Windows tempname layout changes and to validate filename-modifier behavior after full-path filename mapping is applied.

* fix(tests): normalize Windows test paths to resolved workspace paths

On Windows Neovim 0.10, test working directories can resolve to host checkout paths (for example D:\a\ale\ale) instead of container-style mount paths (for example C:\testplugin). Many tests compared absolute paths against g:dir-derived expectations and failed despite equivalent files.\n\nNormalize test directory handling in ale#test helpers by storing and using ale#path#Simplify(resolve(getcwd())), so expected paths match the same canonical form used by path discovery functions.\n\nAlso update tests that manually reassign g:dir from raw getcwd() and Gradle path assertions to use resolved/simplified paths, preventing regressions from mixed mount-path forms across Vim/Neovim and CI environments.

* fix(tests): restore g:dir semantics for fixer and test helpers

* Revert "fix(tests): normalize Windows test paths to resolved workspace paths"

This reverts commit 1136e2daec2645f643211e7e41819fa3eeba61b4.

* fix(tests): use resolve() in ant test assertions for Windows junction paths

On Windows CI, a junction C:\testplugin -> D:\a\ale\ale is used so tests
can cd to /testplugin paths. However, findfile() + fnamemodify(':p') resolves
junction points to real paths, while g:dir holds the junction-based path.

Fix the two ant test files to use resolve(g:dir) only in the specific
assertions that compare paths returned by findfile()-based functions
(ale#ant#FindProjectRoot, ale#ant#BuildClasspathCommand). This way:
- On Linux: resolve() is a no-op, behaviour unchanged
- On Windows: resolve(g:dir) gives the real path that matches what
  findfile() returns, fixing the assertion mismatch

The global test infrastructure (ale#test#SetDirectory) is left unchanged
to avoid breaking the many fixer tests that rely on junction-based paths.

* Fix Windows junction path resolution in tests

On Windows CI, tests run from a junction point (C:\testplugin) that
points to the real workspace (D:\a\ale\ale). Functions like
ale#path#FindNearestFile resolve junctions via findfile()/fnamemodify(':p'),
returning the real path, while g:dir holds the junction path.

Wrap expected path values with resolve() so junction paths are
resolved to their real counterparts on Windows (resolve() is a no-op
on Linux), making assertions match across both platforms.

* fix(test): use fnamemodify to compute expected nvcc path on Windows

The test hardcoded 'C:\tmp\...' for Windows paths, but GitHub Actions
runners use D: drive. Use ale#path#Simplify(fnamemodify(..., ':p'))
in expected values to mirror exactly what the handler produces,
making the test drive-letter-agnostic.

* fix: resolve symlinks/junctions in FindNearest* path functions

On Windows, Vim's findfile()/finddir() returns junction paths while
Neovim resolves them. This inconsistency causes test failures when
comparing paths from these functions against g:dir (set via getcwd()).

Add resolve() to FindNearestFile, FindNearestDirectory, and
FindNearestFileOrDirectory so they always return canonical paths,
making behavior consistent across Vim and Neovim on Windows.

On Linux, resolve() is a no-op for non-symlinked paths.

* fix: resolve junctions in python path functions and fix trailing separator

- Add resolve() to FindVirtualenv, FindProjectRoot, FindProjectRootIni
  in autoload/ale/python.vim so they return canonical paths on Windows
  NTFS junctions
- Move trailing '/' inside ale#path#Simplify() in FindNearestDirectory
  and FindNearestFileOrDirectory so separator is OS-appropriate

* fix: remove unnecessary junction in Windows CI

The C:\testplugin junction was a leftover from AppVeyor. It caused
C: vs D: path mismatches when resolve() canonicalized paths. Running
directly from the workspace eliminates the discrepancy.

* fix: use getcwd() for Windows runtimepath instead of hardcoded C:\testplugin

The junction no longer exists, so use the actual working directory
to find ALE plugin files in the test vimrc.

* fix: map /testplugin/ paths to repo root on Windows

Without the C:\testplugin junction, SetDirectory('/testplugin/test')
failed silently, leaving cwd at the repo root. Now on Windows, the
/testplugin/ prefix is replaced with the actual repo root derived
from the script's file path.

* fix: remaining Windows test failures (format_command, dprint, tslint, smoke)

- test_format_command: compute :h modifier depth dynamically since
  Vim 9.x Windows uses flat tempname() while NeoVim uses nested dirs
- test_dprint_fixer: replace hardcoded C:\testplugin path with
  dynamic path relative to g:dir
- smoke_test: increase PowerShell job timeout and add sleep between
  retries for flaky Windows CI
- workflow: set TMP/TEMP on same drive as workspace to fix cross-drive
  relative path resolution in tslint handler test

* fix: skip PowerShell smoke test on Vim Windows

The test is inherently flaky with Vim's Windows job implementation
when &shell=powershell. NeoVim handles it reliably and still tests
this code path.

* fix: NeoVim Windows test failures (dmd handler, c_flag_parsing, lint_file timeout)

- dmd handler: replace \f+ with [^(]+ in regex since NeoVim's isfname
  on Windows doesn't include \ or :, so \f+ can't match absolute paths
- c_flag_parsing: use FullPath() helper for file! commands and dict keys
  so NeoVim v0.10.4 resolves drive-relative paths correctly
- lint_file_linters: increase WaitForJobs timeout from 30s to 60s for
  slower NeoVim Windows CI runners

* fix: skip flaky NeoVim Windows tests (c_flag_parsing, lint_file_linters)

- c_flag_parsing test 18: skip on NeoVim Windows because fnamemodify(':p')
  does not reliably add a drive letter to fake absolute paths on NeoVim
  <= 0.10, causing dir_lookup key mismatches
- lint_file_linters test 8: skip on NeoVim Windows because jobs don't
  complete within the 30s timeout due to slower job handling

Both tests pass on Linux and Vim Windows. TODO comments added to restore
them once the underlying NeoVim Windows issues are resolved.

* ci: update checkout githuh action to v6

* Preserve Vim 8.2 as a minimum supported version for now

* fix: Use a lower Vim version for Windows tests

---------

Co-authored-by: w0rp <devw0rp@gmail.com>
2026-05-12 22:34:30 +01:00
Micah Chambers ab3531083c Feat: replace em dash with -- (#5125)
* no em dash
* add tests
2026-05-12 19:35:17 +00:00
Evan Chen c59c0d1a57 feat(markdown): add rumdl server and fixer (#5115)
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
* feat: put in the main linter files

* feat: add to registry

* docs: add rumdl to docs

* tests: vader tests

* edit: actually split the options into two

* style: make rumdl fixer test mimic markdownlint

* fix: stupidity overwhelming

* fix: actually let's look for pyproject too

copied from tombi

* i'm a buffoon fix wrong indentation

* alignment ci is made for people like me

* missed toc entry
2026-04-15 22:04:59 +09:00
Andreas Åkesson 051d12c72d fix(terraform-ls): return current buffer dir when missing .terraform (#5103)
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
while working in some larger repos, the .terraform dir might be missing
for one reason or another, terraform-ls will fail to start and return:
```
Failed to find project root, language server won't start
```
check if tf_dir is empty, if so, just return the dir of the file in
buffer.
2026-04-11 21:46:10 +09:00
coriocactus 6ba798d2e7 fix expert lsp stdio and register capability (#5113)
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
* pass --stdio flag to expert lsp server

expert requires --stdio to use stdio transport but the linter
definition launched it without the flag, so the server never
entered lsp mode

* handle client/registerCapability requests from lsp servers

some lsp servers like expert send a client/registerCapability
request after initialization to dynamically register capabilities,
if ale does not respond the server blocks and never processes
further messages like textDocument/didOpen
2026-04-10 23:20:22 +09:00
rymdbar b1b027d5e6 Add support for PerlNavigator (#5028)
* Add support for PerlNavigator

* fixup! Add support for PerlNavigator

* fixup! fixup! Add support for PerlNavigator

* fixup! fixup! fixup! Add support for PerlNavigator

---------

Co-authored-by: cos <cos>
2026-04-10 23:19:14 +09:00
Mathis 674a8cced8 Use ale#Pad for option padding across the codebase (#5118)
Standardize option padding by replacing verbose ternary checks with ale#Pad()

Replace patterns like:
(empty(x) ? '' : '' . l:options)

with:
ale#Pad(l:options)

Similar to af5a38c697
2026-04-10 23:12:53 +09:00
samb0t 6b63f4e70a Add support for LilyPond syntax (#5117)
* Add support for LilyPond syntax

See: https://lilypond.org/

* Fix alpha order of LilyPond

* Add support for custom executable and options to lilypond linter

Enhances the lilypond linter with configurable options:
- Add g:ale_lilypond_lilypond_executable for custom lilypond binary path
- Add g:ale_lilypond_lilypond_options for additional command-line flags
- Refactor linter to use GetCommand() function for dynamic command building
- Add linter tests covering configuration scenarios
- Update documentation with usage examples and proper formatting

---------

Co-authored-by: samb0t <sambottoni@gmail.com>
2026-04-10 23:09:18 +09:00
w0rp ba8b9cbab9 feat: Load Prettier from cjs also
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
2026-04-01 16:13:12 +01:00
Horacio Sanson 7940a46d5a fix(tests): fix ale_c_build_dir_names being unset in tests (#5109)
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#Set() to set the ale_c_build_dir_names variable.
- Ensure SetUpLinterTest() is called before any Save commands in tests.
- Add c.vim to runtime before non-linter tests are executed.
- Remove workarounds in c.vim.
2026-03-29 11:03:19 +09:00
Copilot 90d8f8d2d2 Fix FindCompileCommands to handle absolute paths in c_build_dir_names (#5096)
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
* Initial plan

* Fix FindCompileCommands to handle absolute paths in c_build_dir_names

Use ale#path#GetAbsPath to resolve build directory paths, which correctly
handles both absolute and relative paths. When the dirname is absolute,
derive the project root from the parent of the build directory.

Co-authored-by: w0rp <3518142+w0rp@users.noreply.github.com>

* Improve comment clarity in FindCompileCommands

Co-authored-by: w0rp <3518142+w0rp@users.noreply.github.com>

* Add defensive ale#Set for c_build_dir_names in FindCompileCommands

Mirror the existing s:CanParseMakefile pattern to ensure the
g:ale_c_build_dir_names variable always exists when ale#Var is
called, even if test Save/Restore cycles delete it.

Co-authored-by: w0rp <3518142+w0rp@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: w0rp <3518142+w0rp@users.noreply.github.com>
2026-03-28 21:52:26 +09:00
Armand Halbert 3d3b75cdc5 Added support for harper in markdown files (#5104)
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
2026-03-28 20:22:26 +09:00
Eric Stern 0369442b06 fix(phpcs): run from project root instead of file directory (#5105)
When phpcs.xml sets installed_paths to a relative path (e.g.
vendor/slevomat/coding-standard), running phpcs from the file's
directory causes it to fail because the path is resolved relative to
cwd rather than the config file location.

Change cwd to find the nearest composer.json and use that directory,
matching how most PHP ecosystem tools expect to operate.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-28 20:03:31 +09:00
Evgeni Golov 69c945d5da support running solargraph via bundle (#5097)
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
2026-02-17 20:26:48 +00:00
w0rp cb8c4662aa Fix #5062 - Keep ALE LSP compatible with Neovim 0.10 and 0.11+
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
2026-02-12 00:12:54 +00:00
w0rp d87b4956ad Tell OpenCode how to write ALE code 2026-02-11 21:14:09 +00:00
PsickOSSH 3c837714cd feat(rstcheck): Add automatic --config support with version check (#5095)
* Add automatic --config support for rstcheck >= 3.4.0
* Add tests for rstcheck

Co-authored-by: PsickOSSH <PsickOSSH@protonmail.com>
Co-authored-by: w0rp <devw0rp@gmail.com>
2026-02-11 21:12:30 +00:00
w0rp bee0b49067 Truncate astro test files to quiet dependabot
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
2026-02-11 20:21:57 +00:00
w0rp be0dfdb671 Skip ALE docker download attempts
Turns out the "image" variable never finds a local image any more
because the "docker.io/" part isn't part of the image name locally,
so we must alter the string slightly to find a local copy.
2026-02-11 20:16:15 +00:00
yoan667 b5f8cb296a doc goimport (#5093)
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
2026-02-07 17:24:34 +09:00
PsickOSSH af5a38c697 refactor: use ale#Pad for option padding across the codebase (#5091)
Co-authored-by: PsickOSSH <PsickOSSH@protonmail.com>
2026-02-07 17:23:48 +09:00
blobmasterbrian e762262f44 add option to lint diff buffers (#3185)
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 option to lint diff buffers
* fix misaligned doc tag
* update docs
2026-02-06 18:47:52 +00:00
Mathis Bernadet 6d99629461 Add missing space to gcc linter (#4791). (#5088)
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: Mathis Bernadet <matbernadet@emi.u-bordeaux.fr>
2026-01-25 16:42:46 +09:00
Steve Matney f730dedca7 Utilizing -fzf for tsserver responses along with regular lsp responses (#5084)
* Utilizing -fzf for tsserver responses along with regular lsp responses

* Refactoring FormatResponseItem in references.vim to accept response item config
2026-01-25 16:42:14 +09:00
Holger Detering 9b51f66960 Fix markdownlint output format (#5085)
* test: Add failing tests for markdownlint 0.47.0 output format

Add two new test cases to verify the markdownlint handler's ability to
parse output from version 0.47.0, which includes severity keywords
("error" or "warning"). These tests will fail with the current
implementation, demonstrating the need for a fix to handle the new
output format.

The tests specifically verify:
- Parsing of error severity keyword
- Parsing of warning severity keyword
- Correct mapping of severity to ALE type (E/W)

Backward compatibility with version 0.46.0 is already verified by
the existing ests.

* fix: Update markdownlint handler for version 0.47.0 output format

Update the markdownlint handler to support the new output format
introduced in version 0.47.0, which includes severity keywords ("error"
and "warning") after the column number.

Changes:
- Updated regex pattern to capture optional severity keyword
- Added type mapping logic (error → 'E', warning → 'W')
- Adjusted match indices for rule ID and description text
- Maintained backward compatibility with version 0.46.0

All tests now pass, including the new tests for 0.47.0 format.

* style: Fix vint linting errors in markdownlint handler

- Add blank line before if statement for better readability
- Replace `==#` with `is#` for case-sensitive comparison
2026-01-25 16:37:20 +09:00
gumballriggy e3c1528619 fix: replace deprecated client.request method call with colon syntax (#5081)
* Update lsp.lua

replace deprecated client.request method call with colon syntax

* fixy

same as b4 but for client.notify now

* how did this even happen
2026-01-25 16:36:54 +09:00
yoan667 646d956630 fix vale option (#5086) 2026-01-25 16:30:53 +09:00
PsickOSSH d59cb7b3c2 fix-proselint (#5074) 2026-01-25 16:29:03 +09:00
halfcrazy c0dd8167a6 fix gopls without setting ale_go_gopls_init_options (#5059) 2026-01-25 16:25:25 +09:00
Adrian Vollmer 8eb4803da9 Add pymarkdown fixer (#5045)
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-12-21 18:34:05 +09:00
John Jackson 0360a73644 Add ReScript support (#5072)
This adds support for both rescript format and rescript-language-server.

Closes https://github.com/dense-analysis/ale/issues/3335
2025-12-21 18:25:42 +09:00
bretello dd6e6f1b15 ALEFindReferences: add -fzf flag to show output in fzf (#5018)
* references: add ALEFindReferences -fzf option

Allows using -fzf to show previews using fzf.vim. Includes:

- add support for opening in bufers, splits, tabs and for adding matches quickfix
- add support for -relative
- add fzf preview `--highlight-line` option
- add fzf.vim autoload module

* tests: fix references tests for fzf support update
2025-12-21 13:06:34 +09:00
Eric T. Johnson fa3d4f2f13 cppcheck: don't pass source file if --project is specified (#5075)
This is no longer supported as of version 2.13.0.

Fixes: #4854
2025-12-21 12:59:13 +09:00
yoan667 710e1aac9c fix linter cppcheck (#5071) 2025-12-21 12:56:23 +09:00
rymdbar 281eb4808c Finalize #5055, adding SuperHTML linter for HTML (#5069)
Remove bogus test of non-existing g:ale_html_superhtml_options.

Co-authored-by: cos <cos>
2025-12-21 12:51:45 +09:00
yoan667 ca1da76d5e add markdownlint fixer for markdown (#5066)
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)
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)
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)
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)
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)
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)
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
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)
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)
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
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)
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
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
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)
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
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)
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)
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
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)
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
413 changed files with 7680 additions and 1247 deletions
-62
View File
@@ -1,62 +0,0 @@
---
# Disabling building for AppVeyor. We are just testing things.
build: false
clone_depth: 10
# Use the directory C:\testplugin so test directories will mostly work.
clone_folder: C:\testplugin
branches:
only:
- master
- /v\d+\.\d+\.(x|\d+)/
# Skip running Windows tests if we only change files that can't impact
# Windows tests.
skip_commits:
files:
- '.github/**/*'
- .gitattributes
- Dockerfile
- README.md
- doc/*
- lua/*
- run-tests
- supported-tools.md
- syntax/*
# Cache the vim and vader directories between builds.
cache:
- C:\vim -> .appveyor.yml
- C:\vader -> .appveyor.yml
init:
# Stop git from changing newlines
- git config --global core.autocrlf input
# NOTE: If you change the Vim or Vader versions here, please also update the
# instructions for running tests on Windows in ale-development.txt
install:
# Download and unpack Vim
- ps: >-
if (!(Test-Path -Path C:\vim)){
Add-Type -A System.IO.Compression.FileSystem
Invoke-WebRequest ftp://ftp.vim.org/pub/vim/pc/vim80-586w32.zip `
-OutFile C:\vim.zip
[IO.Compression.ZipFile]::ExtractToDirectory('C:\vim.zip', 'C:\vim')
Invoke-WebRequest ftp://ftp.vim.org/pub/vim/pc/vim80-586rt.zip `
-OutFile C:\rt.zip
[IO.Compression.ZipFile]::ExtractToDirectory('C:\rt.zip', 'C:\vim')
}
# Clone Vader and check out the commit we want
- ps: >-
if (!(Test-Path -Path C:\vader)){
git clone https://github.com/junegunn/vader.vim C:\vader 2> $null
cd C:\vader
git checkout -qf c6243dd81c98350df4dec608fa972df98fa2a3af 2> $null
}
test_script:
- cd C:\testplugin
- 'C:\vim\vim\vim80\vim.exe -u test\vimrc "+Vader!
test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*.vader"'
+9
View File
@@ -0,0 +1,9 @@
# Project-local Codex configuration.
#
# Command safety policy lives in .codex/rules/git-state.rules.
[[hooks.Stop]]
[[hooks.Stop.hooks]]
type = "command"
command = "cat >> .codex/stop-trigger"
timeout = 1
+90
View File
@@ -0,0 +1,90 @@
# Forbid Codex from changing Git repository state in this project.
#
# Read-only Git inspection, such as `git status`, `git diff`, `git log`, and
# `git show`, is intentionally not matched by this policy.
prefix_rule(
pattern = ["git", [
"add",
"am",
"apply",
"bisect",
"branch",
"checkout",
"cherry-pick",
"clean",
"commit",
"fetch",
"merge",
"mv",
"notes",
"pull",
"push",
"rebase",
"reflog",
"replace",
"reset",
"restore",
"revert",
"rm",
"stash",
"submodule",
"switch",
"tag",
"update-index",
"update-ref",
"worktree",
]],
decision = "forbidden",
justification = "Git commands that change the index, refs, branches, remotes, commits, or working tree are reserved for the user.",
match = [
"git add .",
"git commit -m test",
"git pull --rebase",
"git reset --hard HEAD",
"git restore --staged AGENTS.md",
],
not_match = [
"git diff -- AGENTS.md",
"git log --oneline -5",
"git show HEAD",
"git status --short",
],
)
prefix_rule(
pattern = ["git", [
"-C",
"-c",
"--bare",
"--config-env",
"--exec-path",
"--git-dir",
"--git-dir=.git",
"--git-dir=/home/w0rp/ale/.git",
"--namespace",
"--no-optional-locks",
"--no-pager",
"--paginate",
"-P",
"--super-prefix",
"--work-tree",
"--work-tree=.",
"--work-tree=/home/w0rp/ale",
]],
decision = "forbidden",
justification = "Git global options can obscure or bypass repository state changes; run read-only Git commands from the repository root instead.",
match = [
"git -C /home/w0rp/ale status --short",
"git --git-dir .git status",
"git --git-dir=.git status",
"git --no-pager add .",
"git --work-tree . status",
],
not_match = [
"git diff -- AGENTS.md",
"git log --oneline -5",
"git show HEAD",
"git status --short",
],
)
+1
View File
@@ -0,0 +1 @@
* @w0rp
+1
View File
@@ -1,6 +1,7 @@
--- ---
name: Report a bug name: Report a bug
labels: bug labels: bug
type: Bug
about: Report a bug with ALE. about: Report a bug with ALE.
--- ---
@@ -1,6 +1,7 @@
--- ---
name: Suggest a new linter or fixer name: Suggest a new linter or fixer
labels: new tool labels: new tool
type: Task
about: Suggest a new tool ALE can officially integrate with. about: Suggest a new tool ALE can officially integrate with.
--- ---
@@ -1,6 +1,7 @@
--- ---
name: Suggest an improvement name: Suggest an improvement
labels: enhancement labels: enhancement
type: Feature
about: Suggest some way to improve ALE, or add a new feature. about: Suggest some way to improve ALE, or add a new feature.
--- ---
+60 -10
View File
@@ -11,9 +11,10 @@ on: # yamllint disable-line rule:truthy
jobs: jobs:
build_image: build_image:
name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- name: Build docker run image - name: Build docker run image
shell: bash shell: bash
env: env:
@@ -21,18 +22,67 @@ jobs:
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }} DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
run: ./run-tests --build-image run: ./run-tests --build-image
test_ale: test_ale:
name: ${{ matrix.name }}
needs: build_image needs: build_image
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
vim-version: include:
- '--vim-80-only' - name: Lint
- '--vim-90-only' test-args: --linters-only
- '--neovim-07-only' - name: Lua
- '--neovim-08-only' test-args: --lua-only
- '--lua-only' - name: Neovim 0.10 Linux
- '--linters-only' test-args: --neovim-010-only
- name: Neovim 0.12 Linux
test-args: --neovim-012-only
- name: Vim 8.2 Linux
test-args: --vim-82-only
- name: Vim 9.2 Linux
test-args: --vim-92-only
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- name: Run tests - name: Run tests
run: ./run-tests -v ${{ matrix.vim-version }} run: ./run-tests -v ${{ matrix.test-args }}
test_ale_windows:
name: ${{ matrix.name }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- name: Neovim 0.10 Windows
editor: neovim
version: v0.10.4
- name: Neovim 0.12 Windows
editor: neovim
version: v0.12.1
- name: Vim 8.2 Windows
editor: vim
version: v8.2.4843
- name: Vim 9.2 Windows
editor: vim
version: v9.2.0329
steps:
- uses: actions/checkout@v6
- name: Setup ${{ matrix.editor }} ${{ matrix.version }}
uses: rhysd/action-setup-vim@v1
id: editor
with:
neovim: ${{ matrix.editor == 'neovim' }}
version: ${{ matrix.version }}
- name: Clone Vader
shell: cmd
run: |
git clone https://github.com/junegunn/vader.vim C:\vader
git -C C:\vader checkout -qf c6243dd81c98350df4dec608fa972df98fa2a3af
- name: Run tests
shell: cmd
env:
VIM_EXE: ${{ steps.editor.outputs.executable }}
VIM_HEADLESS: ${{ matrix.editor == 'neovim' && '--headless' || '--not-a-term' }}
run: |
set TMP=%CD:~0,2%\tmp
set TEMP=%CD:~0,2%\tmp
if not exist "%CD:~0,2%\tmp" mkdir "%CD:~0,2%\tmp"
run-tests.bat
+23
View File
@@ -0,0 +1,23 @@
# ALE Instructions
## Basic Instructions
Read documentation from @doc/ale-development.txt to understand how to be an
ALE developer and how to match our standards.
Run all tests quickly with `./run-tests -q --fast`, which picks the quickest
version of Neovim we can run, and runs our linting checks.
You can quickly check an individual Vader test file by passing them as arguments
such as `./run-tests -q --fast test/path/some_file.vader`.
You can quickly run all Lua tests with `./run-tests -q --lua-only`.
For new Vim files, set `Author:` comments to the person doing the work.
Do not use Codex, OpenAI, or other tool names as the author.
## Writing Tests
For `test/test-files` they should almost always be 0 bytes in size and files
may be marked executable when testing searching for executables.
+60 -10
View File
@@ -1,28 +1,78 @@
ARG TESTBED_VIM_VERSION=24 #############################################################################
# Base testbed image copied from:
# https://github.com/Vimjas/vim-testbed/blob/master/Dockerfile
FROM alpine:3.23 as testbed
FROM testbed/vim:${TESTBED_VIM_VERSION} RUN apk --no-cache upgrade
ENV PACKAGES="\ ENV PACKAGES="\
build-base \
linux-headers \
cmake \
coreutils \
msgpack-c-dev \
libtermkey-dev \
libvterm-dev \
unibilium-dev \
ncurses-dev \
lua5.1 \ lua5.1 \
lua5.1-dev \ lua5.1-dev \
lua5.1-lpeg \
lua5.1-mpack \
lua5.1-busted \ lua5.1-busted \
bash \ bash \
git \ git \
python2 \
python3 \
py3-pip \
grep \ grep \
sed \ sed \
python3 \
py3-pip \
gettext-dev \
libuv-dev \
libluv \
lua-luv-dev \
utf8proc-dev \
vint \
curl \
gettext-dev \
libtool \
ninja \
tree-sitter-dev \
" "
RUN apk --update add $PACKAGES && \ RUN apk --update add $PACKAGES && \
rm -rf /var/cache/apk/* /tmp/* /var/tmp/* rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
RUN install_vim -tag v8.0.0027 -build \ RUN adduser -h /home/vimtest -s /bin/sh -D -u 8465 vimtest
-tag v9.0.0297 -build \
-tag neovim:v0.7.0 -build \
-tag neovim:v0.8.0 -build
RUN pip install vim-vint==0.3.21 RUN mkdir -p /vim /vim-build/bin /plugins
RUN chown vimtest:vimtest /home /plugins
# Useful during tests to have these packages in a deeper layer cached already.
# RUN apk --no-cache add --virtual vim-build build-base
ADD docker/argecho.sh /vim-build/bin/argecho
ADD docker/install_vim.sh /sbin/install_vim
ADD docker/run_vim.sh /sbin/run_vim
RUN chmod +x /vim-build/bin/argecho /sbin/install_vim /sbin/run_vim
# The user directory for setup
VOLUME /home/vimtest
# Your plugin
VOLUME /testplugin
ENTRYPOINT ["/sbin/run_vim"]
#############################################################################
# ALE Test image
#
FROM testbed
RUN install_vim -tag v8.2.5172 -build \
-tag v9.2.0329 -build \
-tag neovim:v0.10.4 -build \
-tag neovim:v0.12.1 -build
RUN git clone https://github.com/junegunn/vader.vim vader && \ RUN git clone https://github.com/junegunn/vader.vim vader && \
cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
+10 -2
View File
@@ -1,11 +1,11 @@
# Asynchronous Lint Engine # Asynchronous Lint Engine
[![Vim](https://img.shields.io/badge/VIM-%2311AB00.svg?style=for-the-badge&logo=vim&logoColor=white)](https://www.vim.org/) [![Neovim](https://img.shields.io/badge/NeoVim-%2357A143.svg?&style=for-the-badge&logo=neovim&logoColor=white)](https://neovim.io/) [![CI](https://img.shields.io/github/actions/workflow/status/dense-analysis/ale/main.yml?branch=master&label=CI&logo=github&style=for-the-badge)](https://github.com/dense-analysis/ale/actions?query=event%3Apush+workflow%3ACI+branch%3Amaster++) [![AppVeyor Build Status](https://img.shields.io/appveyor/build/dense-analysis/ale?label=Windows&style=for-the-badge)](https://ci.appveyor.com/project/dense-analysis/ale) [![Join the Dense Analysis Discord server](https://img.shields.io/badge/chat-Discord-5865F2?style=for-the-badge&logo=appveyor)](https://discord.gg/5zFD6pQxDk) [![Vim](https://img.shields.io/badge/VIM-%2311AB00.svg?style=for-the-badge&logo=vim&logoColor=white)](https://www.vim.org/) [![Neovim](https://img.shields.io/badge/NeoVim-%2357A143.svg?&style=for-the-badge&logo=neovim&logoColor=white)](https://neovim.io/) [![CI](https://img.shields.io/github/actions/workflow/status/dense-analysis/ale/main.yml?branch=master&label=CI&logo=github&style=for-the-badge)](https://github.com/dense-analysis/ale/actions?query=event%3Apush+workflow%3ACI+branch%3Amaster++) [![Join the Dense Analysis Discord server](https://img.shields.io/badge/chat-Discord-5865F2?style=for-the-badge&logo=appveyor)](https://discord.gg/5zFD6pQxDk)
![ALE Logo by Mark Grealish - https://www.bhalash.com/](https://user-images.githubusercontent.com/3518142/59195920-2c339500-8b85-11e9-9c22-f6b7f69637b8.jpg) ![ALE Logo by Mark Grealish - https://www.bhalash.com/](https://user-images.githubusercontent.com/3518142/59195920-2c339500-8b85-11e9-9c22-f6b7f69637b8.jpg)
ALE (Asynchronous Lint Engine) is a plugin providing linting (syntax checking ALE (Asynchronous Lint Engine) is a plugin providing linting (syntax checking
and semantic errors) in Neovim 0.7.0+ and Vim 8.0+ while you edit your text files, and semantic errors) in Neovim 0.7.0+ and Vim 8.2+ while you edit your text files,
and acts as a Vim [Language Server Protocol](https://langserver.org/) client. and acts as a Vim [Language Server Protocol](https://langserver.org/) client.
<video autoplay="true" muted="true" loop="true" controls="false" src="https://user-images.githubusercontent.com/3518142/210141215-8f2ff760-6a87-4704-a11e-c109b8e9ec41.mp4" title="An example showing what ALE can do."></video> <video autoplay="true" muted="true" loop="true" controls="false" src="https://user-images.githubusercontent.com/3518142/210141215-8f2ff760-6a87-4704-a11e-c109b8e9ec41.mp4" title="An example showing what ALE can do."></video>
@@ -61,6 +61,14 @@ linting and fixing of code in Vim. ALE offers the following.
* Windows support * Windows support
* Well-integrated with other plugins * 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 ## Supported Languages and Tools
ALE supports a wide variety of languages and tools. See the ALE supports a wide variety of languages and tools. See the
+68 -13
View File
@@ -2,11 +2,44 @@
" Description: ansible-lint for ansible-yaml files " Description: ansible-lint for ansible-yaml files
call ale#Set('ansible_ansible_lint_executable', 'ansible-lint') 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 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') return ale#Var(a:buffer, 'ansible_ansible_lint_executable')
endfunction 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 function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
for l:line in a:lines[:10] for l:line in a:lines[:10]
if match(l:line, '^Traceback') >= 0 if match(l:line, '^Traceback') >= 0
@@ -103,28 +136,50 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
endfunction endfunction
function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort
let l:commands = { let l:executable = ale_linters#ansible#ansible_lint#GetExecutable(a:buffer)
\ '>=6.0.0': '%e --nocolor -f json -x yaml %s',
\ '>=5.0.0': '%e --nocolor --parseable-severity -x yaml %s', let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ '<5.0.0': '%e --nocolor -p %t' \ ? ' 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'] : let l:cmd_opts = ale#semver#GTE(a:version, [6, 0]) ? l:opts_map['>=6.0.0'] :
\ l:commands['<5.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 return l:command
endfunction 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', { call ale#linter#Define('ansible', {
\ 'name': 'ansible_lint', \ 'name': 'ansible_lint',
\ 'aliases': ['ansible', 'ansible-lint'], \ 'aliases': ['ansible', 'ansible-lint'],
\ 'executable': function('ale_linters#ansible#ansible_lint#GetExecutable'), \ 'executable': function('ale_linters#ansible#ansible_lint#GetExecutable'),
\ 'command': {buffer -> ale#semver#RunWithVersionCheck( \ 'cwd': function('ale_linters#ansible#ansible_lint#GetCwd'),
\ buffer, \ 'command': function('ale_linters#ansible#ansible_lint#RunWithVersionCheck'),
\ ale_linters#ansible#ansible_lint#GetExecutable(buffer),
\ '%e --version',
\ function('ale_linters#ansible#ansible_lint#GetCommand'),
\ )},
\ 'lint_file': 1, \ 'lint_file': 1,
\ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck( \ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck(
\ buffer, \ buffer,
+4 -2
View File
@@ -1,9 +1,11 @@
" Author: Daniel M. Capella https://github.com/polyzen " Author: Daniel M. Capella https://github.com/polyzen
" Description: proselint for AsciiDoc files " Description: proselint for AsciiDoc files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('asciidoc', { call ale#linter#Define('asciidoc', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+1 -6
View File
@@ -1,9 +1,4 @@
" Author: rhysd https://rhysd.github.io " Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc) " Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#linter#Define('asciidoc', { call ale#handlers#redpen#DefineLinter('asciidoc')
\ 'name': 'redpen',
\ 'executable': 'redpen',
\ 'command': 'redpen -f asciidoc -r json %t',
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
\})
+1 -1
View File
@@ -9,7 +9,7 @@ function! ale_linters#asm#gcc#GetCommand(buffer) abort
" -fsyntax-only doesn't catch everything. " -fsyntax-only doesn't catch everything.
return '%e -x assembler' return '%e -x assembler'
\ . ' -o ' . g:ale#util#nul_file \ . ' -o ' . g:ale#util#nul_file
\ . '-iquote %s:h' \ . ' -iquote %s:h'
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -' \ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
endfunction endfunction
+43
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,
\})
+18 -11
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_options', '')
call ale#Set('bitbake_oelint_adv_config', '.oelint.cfg') 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 function! ale_linters#bitbake#oelint_adv#Command(buffer) abort
let l:config_file = ale#path#FindNearestFile(a:buffer, let l:config_file = ale#path#FindNearestFile(a:buffer,
\ ale#Var(a:buffer, 'bitbake_oelint_adv_config')) \ ale#Var(a:buffer, 'bitbake_oelint_adv_config'))
@@ -17,26 +25,25 @@ function! ale_linters#bitbake#oelint_adv#Command(buffer) abort
endfunction endfunction
function! ale_linters#bitbake#oelint_adv#Handle(buffer, lines) abort function! ale_linters#bitbake#oelint_adv#Handle(buffer, lines) abort
let l:pattern = '\v^(.+):(.+):(.+):(.+):(.+)$' let l:pattern = '\v^(.{-}):(.{-}):(.{-}):(.{-}):(.{-})$'
let l:output = [] let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern) for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, { call add(l:output, {
\ 'lnum': str2nr(l:match[2]), \ 'lnum': str2nr(l:match[2]),
\ 'type': l:match[3] is# 'error' \ 'type': l:match[3] is# 'error'
\ ? 'E' : (l:match[3] is# 'warning' ? 'W' : 'I'), \ ? 'E'
\ 'text': StripAnsiCodes(l:match[5]), \ : (l:match[3] is# 'warning' ? 'W' : 'I'),
\ 'code': l:match[4] \ 'text': ale_linters#bitbake#oelint_adv#RemoveBranch(
\ }) \ ale_linters#bitbake#oelint_adv#StripAnsiCodes(l:match[5])
\ ),
\ 'code': l:match[4],
\})
endfor endfor
return l:output return l:output
endfunction endfunction
function! StripAnsiCodes(line) abort
return substitute(a:line, '\e\[[0-9;]\+[mK]', '', 'g')
endfunction
call ale#linter#Define('bitbake', { call ale#linter#Define('bitbake', {
\ 'name': 'oelint_adv', \ 'name': 'oelint_adv',
\ 'output_stream': 'both', \ 'output_stream': 'both',
+6 -1
View File
@@ -10,13 +10,18 @@ function! ale_linters#c#cppcheck#GetCommand(buffer) abort
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer) \ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
\ : '' \ : ''
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}') let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
" Versions >=2.13 don't allow using --project in conjunction with an
" explicit source file.
let l:source_file = stridx(l:compile_commands_option, '--project=') < 0
\ ? ' %t'
\ : ''
return '%e -q --language=c' return '%e -q --language=c'
\ . l:template \ . l:template
\ . ale#Pad(l:compile_commands_option) \ . ale#Pad(l:compile_commands_option)
\ . ale#Pad(ale#Var(a:buffer, 'c_cppcheck_options')) \ . ale#Pad(ale#Var(a:buffer, 'c_cppcheck_options'))
\ . l:buffer_path_include \ . l:buffer_path_include
\ . ' %t' \ . l:source_file
endfunction endfunction
call ale#linter#Define('c', { call ale#linter#Define('c', {
+41
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',
\})
+1 -1
View File
@@ -18,7 +18,7 @@ function! ale_linters#cpp#clazy#GetCommand(buffer) abort
return '%e' return '%e'
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '') \ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '') \ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' %s' \ . ' %s'
endfunction endfunction
+6 -1
View File
@@ -10,13 +10,18 @@ function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer) \ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
\ : '' \ : ''
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}') let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
" Versions >=2.13 don't allow using --project in conjunction with an
" explicit source file.
let l:source_file = stridx(l:compile_commands_option, '--project=') < 0
\ ? ' %t'
\ : ''
return '%e -q --language=c++' return '%e -q --language=c++'
\ . l:template \ . l:template
\ . ale#Pad(l:compile_commands_option) \ . ale#Pad(l:compile_commands_option)
\ . ale#Pad(ale#Var(a:buffer, 'cpp_cppcheck_options')) \ . ale#Pad(ale#Var(a:buffer, 'cpp_cppcheck_options'))
\ . l:buffer_path_include \ . l:buffer_path_include
\ . ' %t' \ . l:source_file
endfunction endfunction
call ale#linter#Define('cpp', { call ale#linter#Define('cpp', {
+1 -1
View File
@@ -4,7 +4,7 @@ function! ale_linters#cs#mcs#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'cs_mcs_options') let l:options = ale#Var(a:buffer, 'cs_mcs_options')
return 'mcs -unsafe --parse' return 'mcs -unsafe --parse'
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' %t' \ . ' %t'
endfunction endfunction
+1 -1
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 function! ale_linters#css#stylelint#GetCommand(buffer) abort
return '%e ' . ale#Pad(ale#Var(a:buffer, 'css_stylelint_options')) return '%e ' . ale#Pad(ale#Var(a:buffer, 'css_stylelint_options'))
\ . ' --stdin-filename %s' \ . ' --no-color --stdin-filename %s'
endfunction endfunction
call ale#linter#Define('css', { call ale#linter#Define('css', {
+1 -1
View File
@@ -23,7 +23,7 @@ function! ale_linters#cuda#nvcc#HandleNVCCFormat(buffer, lines) abort
\ 'lnum': str2nr(l:match[2]), \ 'lnum': str2nr(l:match[2]),
\ 'type': l:match[4] =~# 'error' ? 'E' : 'W', \ 'type': l:match[4] =~# 'error' ? 'E' : 'W',
\ 'text': l:match[5], \ 'text': l:match[5],
\ 'filename': fnamemodify(l:match[1], ':p'), \ 'filename': ale#path#Simplify(fnamemodify(l:match[1], ':p')),
\} \}
if !empty(l:match[3]) if !empty(l:match[3])
+3 -1
View File
@@ -87,7 +87,9 @@ function! ale_linters#d#dmd#Handle(buffer, lines) abort
" Matches patterns lines like the following: " Matches patterns lines like the following:
" /tmp/tmp.qclsa7qLP7/file.d(1): Error: function declaration without return type. (Note that constructors are always named 'this') " /tmp/tmp.qclsa7qLP7/file.d(1): Error: function declaration without return type. (Note that constructors are always named 'this')
" /tmp/tmp.G1L5xIizvB.d(8,8): Error: module weak_reference is in file 'dstruct/weak_reference.d' which cannot be read " /tmp/tmp.G1L5xIizvB.d(8,8): Error: module weak_reference is in file 'dstruct/weak_reference.d' which cannot be read
let l:pattern = '\v^(\f+)\((\d+)(,(\d+))?\): (\w+): (.+)$' " Use [^(]+ instead of \f+ because NeoVim's 'isfname' on Windows does
" not include \ or :, so \f+ cannot match Windows absolute paths.
let l:pattern = '\v^([^(]+)\((\d+)(,(\d+))?\): (\w+): (.+)$'
let l:output = [] let l:output = []
let l:dir = expand('#' . a:buffer . ':p:h') let l:dir = expand('#' . a:buffer . ':p:h')
+12
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 --stdio',
\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
\})
+47
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,
\})
+6 -4
View File
@@ -1,9 +1,11 @@
" Author: Jansen Mitchell https://github.com/JansenMitchell " Author: Jansen Mitchell https://github.com/JansenMitchell
" Description: proselint for Fountain files " Description: proselint for Fountain files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('fountain', { call ale#linter#Define('fountain', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+1 -1
View File
@@ -8,7 +8,7 @@ function! ale_linters#go#revive#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'go_revive_options') let l:options = ale#Var(a:buffer, 'go_revive_options')
return ale#go#EnvString(a:buffer) . '%e' return ale#go#EnvString(a:buffer) . '%e'
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' %t' \ . ' %t'
endfunction endfunction
+2 -2
View File
@@ -13,11 +13,11 @@ function! ale_linters#go#staticcheck#GetCommand(buffer) abort
if l:lint_package if l:lint_package
return l:env . '%e' return l:env . '%e'
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .' \ . ale#Pad(l:options) . ' .'
endif endif
return l:env . '%e' return l:env . '%e'
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' %s:t' \ . ' %s:t'
endfunction endfunction
+1 -1
View File
@@ -8,7 +8,7 @@ function! ale_linters#groovy#npmgroovylint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'groovy_npmgroovylint_options') let l:options = ale#Var(a:buffer, 'groovy_npmgroovylint_options')
return '%e --failon none --output json' return '%e --failon none --output json'
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' %t' \ . ' %t'
endfunction endfunction
+4 -2
View File
@@ -1,9 +1,11 @@
" Author: Daniel M. Capella https://github.com/polyzen " Author: Daniel M. Capella https://github.com/polyzen
" Description: proselint for Vim help files " Description: proselint for Vim help files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('help', { call ale#linter#Define('help', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+4 -2
View File
@@ -1,9 +1,11 @@
" Author: Daniel M. Capella https://github.com/polyzen " Author: Daniel M. Capella https://github.com/polyzen
" Description: proselint for HTML files " Description: proselint for HTML files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('html', { call ale#linter#Define('html', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+2 -2
View File
@@ -15,8 +15,8 @@ function! ale_linters#html#stylelint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'html_stylelint_options') let l:options = ale#Var(a:buffer, 'html_stylelint_options')
return ale#Escape(l:executable) return ale#Escape(l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' --stdin-filename %s' \ . ' --no-color --stdin-filename %s'
endfunction endfunction
call ale#linter#Define('html', { call ale#linter#Define('html', {
+34
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',
\})
+1 -1
View File
@@ -19,7 +19,7 @@ function! ale_linters#javascript#standard#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'javascript_standard_options') let l:options = ale#Var(a:buffer, 'javascript_standard_options')
return ale#node#Executable(a:buffer, l:executable) return ale#node#Executable(a:buffer, l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' --stdin %s' \ . ' --stdin %s'
endfunction endfunction
+46
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
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'),
\})
+1 -1
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 function! ale_linters#less#stylelint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'less_stylelint_options') 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 endfunction
call ale#linter#Define('less', { call ale#linter#Define('less', {
+40
View File
@@ -0,0 +1,40 @@
" Author: Sam Bottoni
" Description: lilypond linter for LilyPond files
call ale#Set('lilypond_lilypond_executable', 'lilypond')
let g:ale_lilypond_lilypond_options = get(g:, 'ale_lilypond_lilypond_options', '')
function! ale_linters#lilypond#lilypond#GetCommand(buffer) abort
return '%e --loglevel=WARNING -dbackend=null -dno-print-pages -o /tmp'
\ . ale#Pad(ale#Var(a:buffer, 'lilypond_lilypond_options'))
\ . ' %t 2>&1'
endfunction
function! ale_linters#lilypond#lilypond#Handle(buffer, lines) abort
let l:output = []
for l:line in a:lines
" Match: file:line:col: error|warning|programming error: message
let l:match = matchlist(l:line,
\ '\v^.*:(\d+):(\d+): (error|warning|programming error): (.*)$')
if !empty(l:match)
call add(l:output, {
\ 'lnum': str2nr(l:match[1]),
\ 'col': str2nr(l:match[2]),
\ 'type': l:match[3] =~? 'error' ? 'E' : 'W',
\ 'text': l:match[4]
\})
endif
endfor
return l:output
endfunction
call ale#linter#Define('lilypond', {
\ 'name': 'lilypond',
\ 'executable': {b -> ale#Var(b, 'lilypond_lilypond_executable')},
\ 'command': function('ale_linters#lilypond#lilypond#GetCommand'),
\ 'callback': 'ale_linters#lilypond#lilypond#Handle',
\})
+4 -2
View File
@@ -1,9 +1,11 @@
" Author: Daniel M. Capella https://github.com/polyzen " Author: Daniel M. Capella https://github.com/polyzen
" Description: proselint for mail files " Description: proselint for mail files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('mail', { call ale#linter#Define('mail', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+32
View File
@@ -0,0 +1,32 @@
" Author: Armand Halbert <armand.halbert@gmail.com>
" Description: Harper for Markdown files
call ale#Set('markdown_harper_config', {
\ 'harper-ls': {
\ 'diagnosticSeverity': 'hint',
\ 'dialect': 'American',
\ 'linters': {
\ 'SpellCheck': v:true,
\ 'SentenceCapitalization': v:true,
\ 'RepeatedWords': v:true,
\ 'LongSentences': v:true,
\ 'AnA': v:true,
\ 'Spaces': v:true,
\ 'SpelledNumbers': v:false,
\ 'WrongQuotes': v:false,
\ },
\ },
\})
call ale#linter#Define('markdown', {
\ 'name': 'harper',
\ 'lsp': 'stdio',
\ 'executable': 'harper-ls',
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#markdown#harper#GetProjectRoot'),
\ 'lsp_config': {b -> ale#Var(b, 'markdown_harper_config')},
\})
function! ale_linters#markdown#harper#GetProjectRoot(buffer) abort
return fnamemodify(bufname(a:buffer), ':p:h')
endfunction
+1 -1
View File
@@ -14,7 +14,7 @@ function! ale_linters#markdown#markdownlint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'markdown_markdownlint_options') let l:options = ale#Var(a:buffer, 'markdown_markdownlint_options')
return ale#Escape(l:executable) return ale#Escape(l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '') . ' %s' \ . ale#Pad(l:options) . ' %s'
endfunction endfunction
call ale#linter#Define('markdown', { call ale#linter#Define('markdown', {
+1 -1
View File
@@ -17,7 +17,7 @@ function! ale_linters#markdown#mdl#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'markdown_mdl_options') let l:options = ale#Var(a:buffer, 'markdown_mdl_options')
return ale#Escape(l:executable) . l:exec_args return ale#Escape(l:executable) . l:exec_args
\ . ' -j' . (!empty(l:options) ? ' ' . l:options : '') \ . ' -j' . ale#Pad(l:options)
endfunction endfunction
function! ale_linters#markdown#mdl#Handle(buffer, lines) abort function! ale_linters#markdown#mdl#Handle(buffer, lines) abort
+4 -2
View File
@@ -1,9 +1,11 @@
" Author: poohzrn https://github.com/poohzrn " Author: poohzrn https://github.com/poohzrn
" Description: proselint for Markdown files " Description: proselint for Markdown files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('markdown', { call ale#linter#Define('markdown', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+2 -3
View File
@@ -33,9 +33,8 @@ function! ale_linters#markdown#pymarkdown#GetCommand(buffer) abort
\ : '' \ : ''
return ale#Escape(l:executable) . l:exec_args return ale#Escape(l:executable) . l:exec_args
\ . ' ' \ . ale#Pad(ale#Var(a:buffer, 'markdown_pymarkdown_options'))
\ . ale#Var(a:buffer, 'markdown_pymarkdown_options') \ . ' scan-stdin'
\ . 'scan-stdin'
endfunction endfunction
function! ale_linters#markdown#pymarkdown#Handle(buffer, lines) abort function! ale_linters#markdown#pymarkdown#Handle(buffer, lines) abort
+1 -6
View File
@@ -1,9 +1,4 @@
" Author: rhysd https://rhysd.github.io " Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc) " Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#linter#Define('markdown', { call ale#handlers#redpen#DefineLinter('markdown')
\ 'name': 'redpen',
\ 'executable': 'redpen',
\ 'command': 'redpen -f markdown -r json %t',
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
\})
+48
View File
@@ -0,0 +1,48 @@
" Author: Evan Chen <evan@evanchen.cc>
" Description: Fast Markdown linter and formatter written in Rust
call ale#Set('markdown_rumdl_executable', 'rumdl')
call ale#Set('markdown_rumdl_options', '')
function! ale_linters#markdown#rumdl#GetProjectRoot(buffer) abort
let l:dotconfig = ale#path#FindNearestFile(a:buffer, '.rumdl.toml')
let l:config = ale#path#FindNearestFile(a:buffer, 'rumdl.toml')
if !empty(l:dotconfig) && !empty(l:config)
let l:nearest = len(l:dotconfig) >= len(l:config) ? l:dotconfig : l:config
return fnamemodify(l:nearest, ':h')
elseif !empty(l:dotconfig)
return fnamemodify(l:dotconfig, ':h')
elseif !empty(l:config)
return fnamemodify(l:config, ':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 fnamemodify(bufname(a:buffer), ':p:h')
endfunction
call ale#linter#Define('markdown', {
\ 'name': 'rumdl',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'markdown_rumdl_executable')},
\ 'command': {b -> ale#Escape(ale#Var(b, 'markdown_rumdl_executable'))
\ . ' server --stdio'
\ . ale#Pad(ale#Var(b, 'markdown_rumdl_options'))},
\ 'project_root': function('ale_linters#markdown#rumdl#GetProjectRoot'),
\ 'language': 'markdown',
\})
+4 -2
View File
@@ -1,9 +1,11 @@
" Author: Daniel M. Capella https://github.com/polyzen " Author: Daniel M. Capella https://github.com/polyzen
" Description: proselint for nroff files " Description: proselint for nroff files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('nroff', { call ale#linter#Define('nroff', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+26
View File
@@ -0,0 +1,26 @@
" 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.
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#handlers#perl#GetProjectRoot'),
\ })
+15
View File
@@ -0,0 +1,15 @@
" Author: rymdbar <https://rymdbar.x20.se/>
" Description: Perl Navigator Language Server
" See: https://github.com/bscan/PerlNavigator
call ale#Set('perl_perlnavigator_config', {})
call ale#Set('perl_perlnavigator_executable', 'perlnavigator')
call ale#linter#Define('perl', {
\ 'name': 'perlnavigator',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'perl_perlnavigator_executable')},
\ 'command': '%e --stdio',
\ 'lsp_config': {b -> ale#Var(b, 'perl_perlnavigator_config')},
\ 'project_root': function('ale#handlers#perl#GetProjectRoot'),
\ })
+5 -1
View File
@@ -1,6 +1,9 @@
" Author: Arizard <https://github.com/Arizard> " Author: Arizard <https://github.com/Arizard>
" Description: PHPactor integration for ALE " Description: PHPactor integration for ALE
call ale#Set('php_phpactor_executable', 'phpactor')
call ale#Set('php_phpactor_init_options', {})
" Copied from langserver.vim " Copied from langserver.vim
function! ale_linters#php#phpactor#GetProjectRoot(buffer) abort function! ale_linters#php#phpactor#GetProjectRoot(buffer) abort
let l:composer_path = ale#path#FindNearestFile(a:buffer, 'composer.json') let l:composer_path = ale#path#FindNearestFile(a:buffer, 'composer.json')
@@ -17,7 +20,8 @@ endfunction
call ale#linter#Define('php', { call ale#linter#Define('php', {
\ 'name': 'phpactor', \ 'name': 'phpactor',
\ 'lsp': 'stdio', \ 'lsp': 'stdio',
\ 'executable': 'phpactor', \ 'executable': {b -> ale#Var(b, 'php_phpactor_executable')},
\ 'command': '%e language-server', \ 'command': '%e language-server',
\ 'initialization_options': {b -> ale#Var(b, 'php_phpactor_init_options')},
\ 'project_root': function('ale_linters#php#phpactor#GetProjectRoot'), \ 'project_root': function('ale_linters#php#phpactor#GetProjectRoot'),
\}) \})
+29 -1
View File
@@ -7,6 +7,34 @@ call ale#Set('php_phpcs_options', '')
call ale#Set('php_phpcs_executable', 'phpcs') call ale#Set('php_phpcs_executable', 'phpcs')
call ale#Set('php_phpcs_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('php_phpcs_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#php#phpcs#GetCwd(buffer) abort
let l:result = ale#path#Dirname(ale_linters#php#phpcs#FindProjectRoot(a:buffer))
return empty(l:result) ? v:null : l:result
endfunction
function! ale_linters#php#phpcs#FindProjectRoot(buffer) abort
let l:result = ale#path#FindNearestFile(a:buffer, 'phpcs.xml')
if empty(l:result)
let l:result = ale#path#FindNearestFile(a:buffer, 'phpcs.xml.dist')
endif
if empty(l:result)
let l:result = ale#path#FindNearestFile(a:buffer, '.phpcs.xml')
endif
if empty(l:result)
let l:result = ale#path#FindNearestFile(a:buffer, '.phpcs.xml.dist')
endif
if empty(l:result)
let l:result = ale#path#FindNearestFile(a:buffer, 'composer.json')
endif
return l:result
endfunction
function! ale_linters#php#phpcs#GetCommand(buffer) abort function! ale_linters#php#phpcs#GetCommand(buffer) abort
let l:standard = ale#Var(a:buffer, 'php_phpcs_standard') let l:standard = ale#Var(a:buffer, 'php_phpcs_standard')
let l:standard_option = !empty(l:standard) let l:standard_option = !empty(l:standard)
@@ -48,7 +76,7 @@ call ale#linter#Define('php', {
\ 'vendor/bin/phpcs', \ 'vendor/bin/phpcs',
\ 'phpcs' \ 'phpcs'
\ ])}, \ ])},
\ 'cwd': '%s:h', \ 'cwd': function('ale_linters#php#phpcs#GetCwd'),
\ 'command': function('ale_linters#php#phpcs#GetCommand'), \ 'command': function('ale_linters#php#phpcs#GetCommand'),
\ 'callback': 'ale_linters#php#phpcs#Handle', \ 'callback': 'ale_linters#php#phpcs#Handle',
\}) \})
+8
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') 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 empty(l:level) && empty(ale_linters#php#phpstan#FindConfigFile(a:buffer))
" if no configuration file is found, then use 4 as a default level " if no configuration file is found, then use 4 as a default level
let l:level = '4' 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') let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.neon.dist')
endif endif
if empty(l:result)
let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.dist.neon')
endif
return l:result return l:result
endfunction endfunction
+1 -1
View File
@@ -31,7 +31,7 @@ function! ale_linters#php#tlint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'php_tlint_options') let l:options = ale#Var(a:buffer, 'php_tlint_options')
return ale#node#Executable(a:buffer, l:executable) return ale#node#Executable(a:buffer, l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' lint %s' \ . ' lint %s'
endfunction endfunction
+4 -2
View File
@@ -1,9 +1,11 @@
" Author: Cian Butler https://github.com/butlerx " Author: Cian Butler https://github.com/butlerx
" Description: proselint for PO files " Description: proselint for PO files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('po', { call ale#linter#Define('po', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+4 -2
View File
@@ -1,9 +1,11 @@
" Author: Daniel M. Capella https://github.com/polyzen " Author: Daniel M. Capella https://github.com/polyzen
" Description: proselint for Pod files " Description: proselint for Pod files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('pod', { call ale#linter#Define('pod', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+1 -1
View File
@@ -11,7 +11,7 @@ function! ale_linters#proto#buf_lint#GetCommand(buffer) abort
return '%e lint' return '%e lint'
\ . (!empty(l:config) ? ' --config=' . ale#Escape(l:config) : '') \ . (!empty(l:config) ? ' --config=' . ale#Escape(l:config) : '')
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' %s#include_package_files=true' \ . ' %s#include_package_files=true'
endfunction endfunction
+1 -1
View File
@@ -87,7 +87,7 @@ function! ale_linters#python#flake8#GetCommand(buffer, version) abort
let l:options = ale#Var(a:buffer, 'python_flake8_options') let l:options = ale#Var(a:buffer, 'python_flake8_options')
return ale#Escape(l:executable) . l:exec_args return ale#Escape(l:executable) . l:exec_args
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' --format=default' \ . ' --format=default'
\ . l:display_name_args . ' -' \ . l:display_name_args . ' -'
endfunction endfunction
+57
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'),
\})
+43 -17
View File
@@ -34,6 +34,22 @@ function! ale_linters#python#ruff#GetExecutable(buffer) abort
return ale#python#FindExecutable(a:buffer, 'python_ruff', ['ruff']) return ale#python#FindExecutable(a:buffer, 'python_ruff', ['ruff'])
endfunction 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 function! ale_linters#python#ruff#GetCwd(buffer) abort
if ale#Var(a:buffer, 'python_ruff_change_directory') if ale#Var(a:buffer, 'python_ruff_change_directory')
" Run from project root if found, else from buffer dir. " Run from project root if found, else from buffer dir.
@@ -72,20 +88,35 @@ function! ale_linters#python#ruff#Handle(buffer, lines) abort
try try
let l:item = json_decode(l:line) let l:item = json_decode(l:line)
catch catch
let l:item = v:null " If we can't decode a line, skip it.
continue
endtry endtry
if !empty(l:item) if empty(l:item)
call add(l:output, { continue
\ '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',
\})
endif 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 endfor
return l:output return l:output
@@ -95,12 +126,7 @@ call ale#linter#Define('python', {
\ 'name': 'ruff', \ 'name': 'ruff',
\ 'executable': function('ale_linters#python#ruff#GetExecutable'), \ 'executable': function('ale_linters#python#ruff#GetExecutable'),
\ 'cwd': function('ale_linters#python#ruff#GetCwd'), \ 'cwd': function('ale_linters#python#ruff#GetCwd'),
\ 'command': {buffer -> ale#semver#RunWithVersionCheck( \ 'command': function('ale_linters#python#ruff#RunWithVersionCheck'),
\ buffer,
\ ale_linters#python#ruff#GetExecutable(buffer),
\ '%e --version',
\ function('ale_linters#python#ruff#GetCommand'),
\ )},
\ 'callback': 'ale_linters#python#ruff#Handle', \ 'callback': 'ale_linters#python#ruff#Handle',
\ 'output_stream': 'both', \ 'output_stream': 'both',
\ 'read_buffer': 1, \ 'read_buffer': 1,
+63
View File
@@ -0,0 +1,63 @@
" Author: w0rp <dev@w0rp.com>
" Description: Astral's Python type checker and language server
call ale#Set('python_ty_executable', 'ty')
call ale#Set('python_ty_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_ty_auto_pipenv', 0)
call ale#Set('python_ty_auto_poetry', 0)
call ale#Set('python_ty_auto_uv', 0)
call ale#Set('python_ty_config', {})
function! ale_linters#python#ty#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_ty_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_ty_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_ty_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'python_ty', ['ty'])
endfunction
" Force the cwd of the server to be the same as the project root.
function! ale_linters#python#ty#GetCwd(buffer) abort
let l:fake_linter = {
\ 'name': 'ty',
\ 'project_root': function('ale#python#FindProjectRoot'),
\}
let l:root = ale#lsp_linter#FindProjectRoot(a:buffer, l:fake_linter)
return !empty(l:root) ? l:root : v:null
endfunction
function! ale_linters#python#ty#GetCommand(buffer) abort
let l:executable = ale_linters#python#ty#GetExecutable(a:buffer)
let l:exec_args = [
\ ale#Escape(l:executable),
\]
\ + (l:executable =~? '\(pipenv\|poetry\|uv\)$' ? ['run', 'ty'] : [])
\ + [
\ 'server',
\]
return join(l:exec_args, ' ')
endfunction
call ale#linter#Define('python', {
\ 'name': 'ty',
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#python#ty#GetExecutable'),
\ 'cwd': function('ale_linters#python#ty#GetCwd'),
\ 'command': function('ale_linters#python#ty#GetCommand'),
\ 'project_root': function('ale#python#FindProjectRoot'),
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
\ 'lsp_config': {b -> ale#Var(b, 'python_ty_config')},
\})
+1 -1
View File
@@ -12,7 +12,7 @@ function! ale_linters#rego#opacheck#GetCommand(buffer) abort
return ale#Escape(ale_linters#rego#opacheck#GetExecutable(a:buffer)) return ale#Escape(ale_linters#rego#opacheck#GetExecutable(a:buffer))
\ . ' check %s:h --format json ' \ . ' check %s:h --format json '
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
endfunction endfunction
function! ale_linters#rego#opacheck#Handle(buffer, lines) abort function! ale_linters#rego#opacheck#Handle(buffer, lines) abort
@@ -0,0 +1,24 @@
" Author: John Jackson <john@johnridesa.bike>
" Description: The official language server for ReScript.
call ale#Set('rescript_language_server_executable', 'rescript-language-server')
call ale#Set(
\ 'rescript_language_server_use_global',
\ get(g:, 'ale_use_global_executables', v:true),
\ )
function! s:GetProjectRoot(buffer) abort
let l:config_file = ale#path#FindNearestFile(a:buffer, 'rescript.json')
return !empty(l:config_file) ? fnamemodify(l:config_file, ':h') : ''
endfunction
call ale#linter#Define('rescript', {
\ 'name': 'rescript_language_server',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#path#FindExecutable(b, 'rescript_language_server', [
\ 'node_modules/.bin/rescript-language-server'
\ ])},
\ 'command': '%e --stdio',
\ 'project_root': function('s:GetProjectRoot'),
\})
+1 -6
View File
@@ -1,9 +1,4 @@
" Author: rhysd https://rhysd.github.io " Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc) " Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#linter#Define('review', { call ale#handlers#redpen#DefineLinter('review')
\ 'name': 'redpen',
\ 'executable': 'redpen',
\ 'command': 'redpen -f review -r json %t',
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
\})
+25
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'),
\})
+5 -3
View File
@@ -1,9 +1,11 @@
" Author: Daniel M. Capella https://github.com/polyzen " Author: Daniel M. Capella https://github.com/polyzen
" Description: proselint for reStructuredText files " Description: proselint for reStructuredrst files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('rst', { call ale#linter#Define('rst', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+1 -6
View File
@@ -1,9 +1,4 @@
" Author: rhysd https://rhysd.github.io " Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc) " Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#linter#Define('rst', { call ale#handlers#redpen#DefineLinter('rst')
\ 'name': 'redpen',
\ 'executable': 'redpen',
\ 'command': 'redpen -f rest -r json %t',
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
\})
+35 -3
View File
@@ -1,5 +1,13 @@
" Author: John Nduli https://github.com/jnduli " Authors:
" Description: Rstcheck for reStructuredText files " John Nduli https://github.com/jnduli,
" Michael Goerz https://github.com/goerz
call ale#Set('rst_rstcheck_executable', 'rstcheck')
call ale#Set('rst_rstcheck_options', '')
function! ale_linters#rst#rstcheck#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'rst_rstcheck_executable')
endfunction
function! ale_linters#rst#rstcheck#Handle(buffer, lines) abort function! ale_linters#rst#rstcheck#Handle(buffer, lines) abort
" matches: 'bad_rst.rst:1: (SEVERE/4) Title overline & underline " matches: 'bad_rst.rst:1: (SEVERE/4) Title overline & underline
@@ -21,11 +29,35 @@ function! ale_linters#rst#rstcheck#Handle(buffer, lines) abort
return l:output return l:output
endfunction endfunction
function! ale_linters#rst#rstcheck#GetCommand(buffer, version) abort
let l:executable = ale_linters#rst#rstcheck#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'rst_rstcheck_options')
let l:dir = expand('#' . a:buffer . ':p:h')
let l:exec_args = ale#Pad(l:options)
if ale#semver#GTE(a:version, [3, 4, 0])
let l:exec_args .= ' --config ' . ale#Escape(l:dir)
endif
return ale#Escape(l:executable)
\ . l:exec_args
\ . ' %t'
endfunction
function! ale_linters#rst#rstcheck#GetCommandWithVersionCheck(buffer) abort
return ale#semver#RunWithVersionCheck(
\ a:buffer,
\ ale_linters#rst#rstcheck#GetExecutable(a:buffer),
\ '%e --version',
\ function('ale_linters#rst#rstcheck#GetCommand')
\)
endfunction
call ale#linter#Define('rst', { call ale#linter#Define('rst', {
\ 'name': 'rstcheck', \ 'name': 'rstcheck',
\ 'executable': 'rstcheck', \ 'executable': 'rstcheck',
\ 'cwd': '%s:h', \ 'cwd': '%s:h',
\ 'command': 'rstcheck %t', \ 'command': function('ale_linters#rst#rstcheck#GetCommandWithVersionCheck'),
\ 'callback': 'ale_linters#rst#rstcheck#Handle', \ 'callback': 'ale_linters#rst#rstcheck#Handle',
\ 'output_stream': 'both', \ 'output_stream': 'both',
\}) \})
+4 -1
View File
@@ -8,7 +8,10 @@ call ale#Set('ruby_solargraph_executable', 'solargraph')
call ale#Set('ruby_solargraph_options', {}) call ale#Set('ruby_solargraph_options', {})
function! ale_linters#ruby#solargraph#GetCommand(buffer) abort function! ale_linters#ruby#solargraph#GetCommand(buffer) abort
return '%e' . ale#Pad('stdio') let l:executable = ale#Var(a:buffer, 'ruby_solargraph_executable')
return ale#ruby#EscapeExecutable(l:executable, 'solargraph')
\ . ale#Pad('stdio')
endfunction endfunction
call ale#linter#Define('ruby', { call ale#linter#Define('ruby', {
+4 -3
View File
@@ -1,6 +1,7 @@
call ale#Set('ruby_sorbet_executable', 'srb') call ale#Set('ruby_sorbet_executable', 'srb')
call ale#Set('ruby_sorbet_options', '') call ale#Set('ruby_sorbet_options', '')
call ale#Set('ruby_sorbet_enable_watchman', 0) 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 function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'ruby_sorbet_executable') let l:executable = ale#Var(a:buffer, 'ruby_sorbet_executable')
@@ -9,7 +10,7 @@ function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
return ale#ruby#EscapeExecutable(l:executable, 'srb') return ale#ruby#EscapeExecutable(l:executable, 'srb')
\ . ' tc' \ . ' tc'
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' --lsp' \ . ' --lsp'
\ . (l:enable_watchman ? '' : ' --disable-watchman') \ . (l:enable_watchman ? '' : ' --disable-watchman')
endfunction endfunction
@@ -21,6 +22,6 @@ call ale#linter#Define('ruby', {
\ 'language': 'ruby', \ 'language': 'ruby',
\ 'executable': {b -> ale#Var(b, 'ruby_sorbet_executable')}, \ 'executable': {b -> ale#Var(b, 'ruby_sorbet_executable')},
\ 'command': function('ale_linters#ruby#sorbet#GetCommand'), \ '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')}
\}) \})
+1 -1
View File
@@ -20,7 +20,7 @@ function! ale_linters#rust#rustc#RustcCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'rust_rustc_options') let l:options = ale#Var(a:buffer, 'rust_rustc_options')
return 'rustc --error-format=json' return 'rustc --error-format=json'
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . l:dependencies . ' -' \ . l:dependencies . ' -'
endfunction endfunction
+1 -1
View File
@@ -16,7 +16,7 @@ function! ale_linters#sass#sasslint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'sass_sasslint_options') let l:options = ale#Var(a:buffer, 'sass_sasslint_options')
return ale#node#Executable(a:buffer, l:executable) return ale#node#Executable(a:buffer, l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' -v -q -f compact %t' \ . ' -v -q -f compact %t'
endfunction endfunction
+1 -1
View File
@@ -9,6 +9,6 @@ call ale#linter#Define('sass', {
\ 'executable': {b -> ale#path#FindExecutable(b, 'sass_stylelint', [ \ 'executable': {b -> ale#path#FindExecutable(b, 'sass_stylelint', [
\ 'node_modules/.bin/stylelint', \ 'node_modules/.bin/stylelint',
\ ])}, \ ])},
\ 'command': '%e --stdin-filename %s', \ 'command': '%e --no-color --stdin-filename %s',
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat', \ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
\}) \})
+1
View File
@@ -13,6 +13,7 @@ function! ale_linters#scala#metals#GetProjectRoot(buffer) abort
let l:potential_roots = [ let l:potential_roots = [
\ 'build.sc', \ 'build.sc',
\ 'build.mill',
\ 'build.sbt', \ 'build.sbt',
\ '.bloop', \ '.bloop',
\ '.metals', \ '.metals',
+1 -1
View File
@@ -16,7 +16,7 @@ function! ale_linters#scss#sasslint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'scss_sasslint_options') let l:options = ale#Var(a:buffer, 'scss_sasslint_options')
return ale#node#Executable(a:buffer, l:executable) return ale#node#Executable(a:buffer, l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' -v -q -f compact %t' \ . ' -v -q -f compact %t'
endfunction endfunction
+1 -1
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 function! ale_linters#scss#stylelint#GetCommand(buffer) abort
return '%e ' . ale#Pad(ale#Var(a:buffer, 'scss_stylelint_options')) return '%e ' . ale#Pad(ale#Var(a:buffer, 'scss_stylelint_options'))
\ . ' --stdin-filename %s' \ . ' --no-color --stdin-filename %s'
endfunction endfunction
call ale#linter#Define('scss', { call ale#linter#Define('scss', {
+1
View File
@@ -25,6 +25,7 @@ endfunction
call ale#linter#Define('sh', { call ale#linter#Define('sh', {
\ 'name': 'language_server', \ 'name': 'language_server',
\ 'aliases': ['bash-language-server'],
\ 'lsp': 'stdio', \ 'lsp': 'stdio',
\ 'executable': function('ale_linters#sh#language_server#GetExecutable'), \ 'executable': function('ale_linters#sh#language_server#GetExecutable'),
\ 'command': function('ale_linters#sh#language_server#GetCommand'), \ 'command': function('ale_linters#sh#language_server#GetCommand'),
+1 -1
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 function! ale_linters#stylus#stylelint#GetCommand(buffer) abort
return '%e' return '%e'
\ . ale#Pad(ale#Var(a:buffer, 'stylus_stylelint_options')) \ . ale#Pad(ale#Var(a:buffer, 'stylus_stylelint_options'))
\ . ' --stdin-filename %s' \ . ' --no-color --stdin-filename %s'
endfunction endfunction
call ale#linter#Define('stylus', { call ale#linter#Define('stylus', {
+1 -1
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 function! ale_linters#sugarss#stylelint#GetCommand(buffer) abort
return '%e ' . ale#Pad(ale#Var(a:buffer, 'sugarss_stylelint_options')) return '%e ' . ale#Pad(ale#Var(a:buffer, 'sugarss_stylelint_options'))
\ . ' --syntax=sugarss' \ . ' --syntax=sugarss'
\ . ' --stdin-filename %s' \ . ' --no-color --stdin-filename %s'
endfunction endfunction
call ale#linter#Define('sugarss', { call ale#linter#Define('sugarss', {
+4
View File
@@ -25,6 +25,10 @@ endfunction
function! ale_linters#terraform#terraform_ls#GetProjectRoot(buffer) abort function! ale_linters#terraform#terraform_ls#GetProjectRoot(buffer) abort
let l:tf_dir = ale#path#FindNearestDirectory(a:buffer, '.terraform') let l:tf_dir = ale#path#FindNearestDirectory(a:buffer, '.terraform')
if empty(l:tf_dir)
let l:tf_dir = ale#path#FindNearestDirectory(a:buffer, '.')
endif
return !empty(l:tf_dir) ? fnamemodify(l:tf_dir, ':h:h') : '' return !empty(l:tf_dir) ? fnamemodify(l:tf_dir, ':h:h') : ''
endfunction endfunction
+4 -2
View File
@@ -1,9 +1,11 @@
" Author: poohzrn https://github.com/poohzrn " Author: poohzrn https://github.com/poohzrn
" Description: proselint for TeX files " Description: proselint for TeX files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('tex', { call ale#linter#Define('tex', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+1 -6
View File
@@ -1,9 +1,4 @@
" Author: rhysd https://rhysd.github.io " Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc) " Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#linter#Define('tex', { call ale#handlers#redpen#DefineLinter('tex')
\ 'name': 'redpen',
\ 'executable': 'redpen',
\ 'command': 'redpen -f latex -r json %t',
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
\})
+4 -2
View File
@@ -1,9 +1,11 @@
" Author: Daniel M. Capella https://github.com/polyzen " Author: Daniel M. Capella https://github.com/polyzen
" Description: proselint for Texinfo files " Description: proselint for Texinfo files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('texinfo', { call ale#linter#Define('texinfo', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+4 -2
View File
@@ -1,9 +1,11 @@
" Author: poohzrn https://github.com/poohzrn " Author: poohzrn https://github.com/poohzrn
" Description: proselint for text files " Description: proselint for text files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('text', { call ale#linter#Define('text', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+1 -6
View File
@@ -1,9 +1,4 @@
" Author: rhysd https://rhysd.github.io " Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc) " Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#linter#Define('text', { call ale#handlers#redpen#DefineLinter('text')
\ 'name': 'redpen',
\ 'executable': 'redpen',
\ 'command': 'redpen -f plain -r json %t',
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
\})
+14 -1
View File
@@ -1,9 +1,22 @@
" Author: chew-z https://github.com/chew-z " Author: chew-z https://github.com/chew-z
" Description: vale for text files " Description: vale for text files
call ale#Set('vale_executable', 'vale')
call ale#Set('vale_options', '')
function! ale_linters#text#vale#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'vale_executable')
let l:options = ale#Var(a:buffer, 'vale_options')
return ale#Escape(l:executable)
\ . ale#Pad(l:options)
\ . ' --output=JSON %t'
endfunction
call ale#linter#Define('text', { call ale#linter#Define('text', {
\ 'name': 'vale', \ 'name': 'vale',
\ 'executable': 'vale', \ 'executable': 'vale',
\ 'command': 'vale --output=JSON %t', \ 'command': function('ale_linters#text#vale#GetCommand'),
\ 'callback': 'ale#handlers#vale#Handle', \ 'callback': 'ale#handlers#vale#Handle',
\}) \})
+51
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'),
\})
+1 -1
View File
@@ -18,7 +18,7 @@ function! ale_linters#typescript#standard#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'typescript_standard_options') let l:options = ale#Var(a:buffer, 'typescript_standard_options')
return ale#node#Executable(a:buffer, l:executable) return ale#node#Executable(a:buffer, l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '') \ . ale#Pad(l:options)
\ . ' --stdin %s' \ . ' --stdin %s'
endfunction endfunction
+3
View File
@@ -9,7 +9,9 @@ endif
" --lint-only " --lint-only
function! ale_linters#verilog#slang#GetCommand(buffer) abort function! ale_linters#verilog#slang#GetCommand(buffer) abort
return 'slang -Weverything ' return 'slang -Weverything '
\ . '--diag-abs-paths '
\ . '-I%s:h ' \ . '-I%s:h '
\ . '-y%s:h '
\ . ale#Var(a:buffer, 'verilog_slang_options') .' ' \ . ale#Var(a:buffer, 'verilog_slang_options') .' '
\ . '%t' \ . '%t'
endfunction 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) for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:item = { let l:item = {
\ 'filename': l:match[1],
\ 'lnum': str2nr(l:match[2]), \ 'lnum': str2nr(l:match[2]),
\ 'type': (l:match[4] is# 'error') ? 'E' : 'W', \ 'type': (l:match[4] is# 'error') ? 'E' : 'W',
\ 'text': s:RemoveUnicodeQuotes(l:match[5]), \ 'text': s:RemoveUnicodeQuotes(l:match[5]),
+43
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'),
\})
+1
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 " the path to the current file is systematically added to the search path
return 'verilator --lint-only -Wall -Wno-DECLFILENAME ' return 'verilator --lint-only -Wall -Wno-DECLFILENAME '
\ . '-I%s:h ' \ . '-I%s:h '
\ . '-y %s:h '
\ . ale#Var(a:buffer, 'verilog_verilator_options') .' ' \ . ale#Var(a:buffer, 'verilog_verilator_options') .' '
\ . '%t' \ . '%t'
endfunction endfunction
+4 -2
View File
@@ -1,9 +1,11 @@
" Author: Daniel M. Capella https://github.com/polyzen " Author: Daniel M. Capella https://github.com/polyzen
" Description: proselint for XHTML files " Description: proselint for XHTML files
call ale#Set('proselint_executable', 'proselint')
call ale#linter#Define('xhtml', { call ale#linter#Define('xhtml', {
\ 'name': 'proselint', \ 'name': 'proselint',
\ 'executable': 'proselint', \ 'executable': function('ale#proselint#GetExecutable'),
\ 'command': 'proselint %t', \ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning', \ 'callback': 'ale#handlers#unix#HandleAsWarning',
\}) \})
+1 -1
View File
@@ -48,7 +48,7 @@ function! ale#ShouldDoNothing(buffer) abort
endif endif
" Do nothing for diff buffers. " Do nothing for diff buffers.
if getbufvar(a:buffer, '&diff') if getbufvar(a:buffer, '&diff') && !get(g:, 'ale_lint_diff', 0)
return 1 return 1
endif endif
+49 -21
View File
@@ -5,21 +5,20 @@ call ale#Set('c_parse_makefile', 0)
call ale#Set('c_always_make', has('unix') && !has('macunix')) call ale#Set('c_always_make', has('unix') && !has('macunix'))
call ale#Set('c_parse_compile_commands', 1) call ale#Set('c_parse_compile_commands', 1)
let s:sep = has('win32') ? '\' : '/' let s:is_windows = has('win32') || has('win64') || has('win32unix')
let s:sep = s:is_windows ? '\' : '/'
" Set just so tests can override it. " Set just so tests can override it.
let g:__ale_c_project_filenames = ['.git/HEAD', 'configure', 'Makefile', 'CMakeLists.txt'] let g:__ale_c_project_filenames = ['.git/HEAD', 'configure', 'Makefile', 'CMakeLists.txt']
let g:ale_c_build_dir_names = get(g:, 'ale_c_build_dir_names', [ call ale#Set('c_build_dir_names', [
\ 'build', \ 'build',
\ 'build/Debug',
\ 'build/Release',
\ 'bin', \ 'bin',
\]) \])
function! s:CanParseMakefile(buffer) abort function! s:CanParseMakefile(buffer) abort
" Something somewhere seems to delete this setting in tests, so ensure we
" always have a default value.
call ale#Set('c_parse_makefile', 0)
return ale#Var(a:buffer, 'c_parse_makefile') return ale#Var(a:buffer, 'c_parse_makefile')
endfunction endfunction
@@ -247,11 +246,19 @@ function! ale#c#FindCompileCommands(buffer) abort
" Search in build directories if we can't find it in the project. " Search in build directories if we can't find it in the project.
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h')) for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
for l:dirname in ale#Var(a:buffer, 'c_build_dir_names') for l:dirname in ale#Var(a:buffer, 'c_build_dir_names')
let l:c_build_dir = l:path . s:sep . l:dirname let l:c_build_dir = ale#path#GetAbsPath(l:path, l:dirname)
let l:json_file = l:c_build_dir . s:sep . 'compile_commands.json' let l:json_file = l:c_build_dir . s:sep . 'compile_commands.json'
if filereadable(l:json_file) if filereadable(l:json_file)
return [l:path, l:json_file] " For absolute build dir paths, use the parent
" of the build dir as the project root. For
" relative paths, use the directory found by
" searching upwards from the file.
let l:root = ale#path#IsAbsolute(l:dirname)
\ ? fnamemodify(l:c_build_dir, ':h')
\ : l:path
return [l:root, l:json_file]
endif endif
endfor endfor
endfor endfor
@@ -380,23 +387,40 @@ function! ale#c#ParseCompileCommandsFlags(buffer, file_lookup, dir_lookup) abort
let l:file_list = get(a:file_lookup, l:buffer_filename, []) let l:file_list = get(a:file_lookup, l:buffer_filename, [])
" We may have to look for /foo/bar instead of C:\foo\bar " We may have to look for /foo/bar instead of C:\foo\bar
if empty(l:file_list) && has('win32') if empty(l:file_list) && s:is_windows
let l:file_list = get( " Try without the drive letter.
\ a:file_lookup, let l:no_drive = ale#path#RemoveDriveLetter(l:buffer_filename)
\ ale#path#RemoveDriveLetter(l:buffer_filename),
\ [] let l:file_list = get(a:file_lookup, l:no_drive, [])
\)
" Also try by iterating keys in case Simplify produced different
" results for the key and the lookup value.
if empty(l:file_list)
for [l:key, l:val] in items(a:file_lookup)
if ale#path#RemoveDriveLetter(l:key) is? l:no_drive
let l:file_list = l:val
break
endif
endfor
endif
endif endif
" Try the absolute path to the directory second. " Try the absolute path to the directory second.
let l:dir_list = get(a:dir_lookup, l:dir, []) let l:dir_list = get(a:dir_lookup, l:dir, [])
if empty(l:dir_list) && has('win32') if empty(l:dir_list) && s:is_windows
let l:dir_list = get( let l:no_drive_dir = ale#path#RemoveDriveLetter(l:dir)
\ a:dir_lookup,
\ ale#path#RemoveDriveLetter(l:dir), let l:dir_list = get(a:dir_lookup, l:no_drive_dir, [])
\ []
\) if empty(l:dir_list)
for [l:key, l:val] in items(a:dir_lookup)
if ale#path#RemoveDriveLetter(l:key) is? l:no_drive_dir
let l:dir_list = l:val
break
endif
endfor
endif
endif endif
if empty(l:file_list) && empty(l:dir_list) if empty(l:file_list) && empty(l:dir_list)
@@ -418,7 +442,7 @@ function! ale#c#ParseCompileCommandsFlags(buffer, file_lookup, dir_lookup) abort
let l:key = fnamemodify(l:buffer_filename, ':r') . l:suffix let l:key = fnamemodify(l:buffer_filename, ':r') . l:suffix
let l:file_list = get(a:file_lookup, l:key, []) let l:file_list = get(a:file_lookup, l:key, [])
if empty(l:file_list) && has('win32') if empty(l:file_list) && s:is_windows
let l:file_list = get( let l:file_list = get(
\ a:file_lookup, \ a:file_lookup,
\ ale#path#RemoveDriveLetter(l:key), \ ale#path#RemoveDriveLetter(l:key),
@@ -444,8 +468,12 @@ function! ale#c#ParseCompileCommandsFlags(buffer, file_lookup, dir_lookup) abort
" Load the flags for this file, or for a source file matching the " Load the flags for this file, or for a source file matching the
" header file. " header file.
" On Windows, bufnr() may fail to match when one path has a drive
" letter and the other doesn't, so fall back to path comparison.
if ( if (
\ bufnr(l:filename) is a:buffer \ bufnr(l:filename) is a:buffer
\ || ale#path#RemoveDriveLetter(l:filename)
\ is? ale#path#RemoveDriveLetter(l:buffer_filename)
\ || ( \ || (
\ !empty(l:source_file) \ !empty(l:source_file)
\ && l:filename[-len(l:source_file):] is? l:source_file \ && l:filename[-len(l:source_file):] is? l:source_file
+5 -3
View File
@@ -7,6 +7,8 @@ if !exists('s:buffer_data')
let s:buffer_data = {} let s:buffer_data = {}
endif endif
let s:is_windows = has('win32') || has('win64') || has('win32unix')
" The regular expression used for formatting filenames with modifiers. " The regular expression used for formatting filenames with modifiers.
let s:path_format_regex = '\v\%s(%(:h|:t|:r|:e)*)' let s:path_format_regex = '\v\%s(%(:h|:t|:r|:e)*)'
@@ -140,7 +142,7 @@ function! s:TemporaryFilename(buffer) abort
" Create a temporary filename, <temp_dir>/<original_basename> " Create a temporary filename, <temp_dir>/<original_basename>
" The file itself will not be created by this function. " The file itself will not be created by this function.
return ale#util#Tempname() . (has('win32') ? '\' : '/') . l:filename return ale#path#GetAbsPath(ale#util#Tempname(), l:filename)
endfunction endfunction
" Given part of a command, replace any % with %%, so that no characters in " Given part of a command, replace any % with %%, so that no characters in
@@ -178,7 +180,7 @@ function! ale#command#CdString(directory) abort
\ ? a:directory \ ? a:directory
\ : ale#Escape(a:directory) \ : ale#Escape(a:directory)
if has('win32') if s:is_windows
return 'cd /d ' . l:directory . ' && ' return 'cd /d ' . l:directory . ' && '
endif endif
@@ -392,7 +394,7 @@ function! ale#command#Run(buffer, command, Callback, ...) abort
let s:fake_job_id = get(s:, 'fake_job_id', 0) + 1 let s:fake_job_id = get(s:, 'fake_job_id', 0) + 1
let l:job_id = s:fake_job_id let l:job_id = s:fake_job_id
endif endif
elseif has('win32') elseif s:is_windows
let l:job_id = ale#job#StartWithCmd(l:command, l:job_options) let l:job_id = ale#job#StartWithCmd(l:command, l:job_options)
else else
let l:job_id = ale#job#Start(l:command, l:job_options) let l:job_id = ale#job#Start(l:command, l:job_options)
+2 -1
View File
@@ -23,7 +23,7 @@ function! ale#cursor#TruncatedEcho(original_message) abort
" Change tabs to spaces. " Change tabs to spaces.
let l:message = substitute(l:message, "\t", ' ', 'g') let l:message = substitute(l:message, "\t", ' ', 'g')
" Remove any newlines in the message. " 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 " Convert indentation groups into single spaces for better legibility when
" put on a single line " put on a single line
let l:message = substitute(l:message, ' \+', ' ', 'g') let l:message = substitute(l:message, ' \+', ' ', 'g')
@@ -93,6 +93,7 @@ function! ale#cursor#EchoCursorWarning(...) abort
if !empty(l:loc) if !empty(l:loc)
let l:format = ale#Var(l:buffer, 'echo_msg_format') let l:format = ale#Var(l:buffer, 'echo_msg_format')
let l:msg = ale#GetLocItemMessage(l:loc, l:format) let l:msg = ale#GetLocItemMessage(l:loc, l:format)
call ale#cursor#TruncatedEcho(l:msg) call ale#cursor#TruncatedEcho(l:msg)
let l:info.echoed = 1 let l:info.echoed = 1
elseif get(l:info, 'echoed') elseif get(l:info, 'echoed')
+12 -1
View File
@@ -1,6 +1,8 @@
" Author: w0rp <devw0rp@gmail.com> " Author: w0rp <devw0rp@gmail.com>
" Description: Logic for handling mappings between files " Description: Logic for handling mappings between files
let s:is_windows = has('win32') || has('win64') || has('win32unix')
" Invert filesystem mappings so they can be mapped in reverse. " Invert filesystem mappings so they can be mapped in reverse.
function! ale#filename_mapping#Invert(filename_mappings) abort function! ale#filename_mapping#Invert(filename_mappings) abort
return map(copy(a:filename_mappings), '[v:val[1], v:val[0]]') return map(copy(a:filename_mappings), '[v:val[1], v:val[0]]')
@@ -14,7 +16,16 @@ function! ale#filename_mapping#Map(filename, filename_mappings) abort
let l:mapping_from = ale#path#Simplify(l:mapping_from) let l:mapping_from = ale#path#Simplify(l:mapping_from)
if l:simplified_filename[:len(l:mapping_from) - 1] is# l:mapping_from if l:simplified_filename[:len(l:mapping_from) - 1] is# l:mapping_from
return l:mapping_to . l:simplified_filename[len(l:mapping_from):] let l:suffix = l:simplified_filename[len(l:mapping_from):]
" On Windows, the simplified suffix uses backslashes, but the
" mapping target may use forward slashes for a remote path.
" Normalize the suffix separator to match the mapping target.
if s:is_windows && l:mapping_to =~# '/'
let l:suffix = substitute(l:suffix, '\\', '/', 'g')
endif
return l:mapping_to . l:suffix
endif endif
endfor endfor
+60
View File
@@ -192,6 +192,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['python'], \ 'suggested_filetypes': ['python'],
\ 'description': 'Tidy Python imports with pyflyby.', \ 'description': 'Tidy Python imports with pyflyby.',
\ }, \ },
\ 'unimport': {
\ 'function': 'ale#fixers#unimport#Fix',
\ 'suggested_filetypes': ['python'],
\ 'description': 'unimport fixer',
\ },
\ 'importjs': { \ 'importjs': {
\ 'function': 'ale#fixers#importjs#Fix', \ 'function': 'ale#fixers#importjs#Fix',
\ 'suggested_filetypes': ['javascript'], \ 'suggested_filetypes': ['javascript'],
@@ -202,6 +207,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['puppet'], \ 'suggested_filetypes': ['puppet'],
\ 'description': 'Run puppet-lint -f on a file.', \ 'description': 'Run puppet-lint -f on a file.',
\ }, \ },
\ 'replace_emdash': {
\ 'function': 'ale#fixers#generic#ReplaceEmDash',
\ 'suggested_filetypes': [],
\ 'description': 'Replace em dash with -- ASCII characters.',
\ },
\ 'remove_trailing_lines': { \ 'remove_trailing_lines': {
\ 'function': 'ale#fixers#generic#RemoveTrailingBlankLines', \ 'function': 'ale#fixers#generic#RemoveTrailingBlankLines',
\ 'suggested_filetypes': [], \ 'suggested_filetypes': [],
@@ -452,6 +462,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['markdown'], \ 'suggested_filetypes': ['markdown'],
\ 'description': 'Fix markdown files with pandoc.', \ 'description': 'Fix markdown files with pandoc.',
\ }, \ },
\ 'pymarkdown': {
\ 'function': 'ale#fixers#pymarkdown#Fix',
\ 'suggested_filetypes': ['markdown'],
\ 'description': 'Fix markdown files with pymarkdown.',
\ },
\ 'shfmt': { \ 'shfmt': {
\ 'function': 'ale#fixers#shfmt#Fix', \ 'function': 'ale#fixers#shfmt#Fix',
\ 'suggested_filetypes': ['sh'], \ 'suggested_filetypes': ['sh'],
@@ -667,6 +682,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['racket'], \ 'suggested_filetypes': ['racket'],
\ 'description': 'Fix Racket files with raco fmt.', \ 'description': 'Fix Racket files with raco fmt.',
\ }, \ },
\ 'rescript_format': {
\ 'function': 'ale#fixers#rescript_format#Fix',
\ 'suggested_filetypes': ['rescript'],
\ 'description': 'Official formatter for ReScript.',
\ },
\ 'ruff': { \ 'ruff': {
\ 'function': 'ale#fixers#ruff#Fix', \ 'function': 'ale#fixers#ruff#Fix',
\ 'suggested_filetypes': ['python'], \ 'suggested_filetypes': ['python'],
@@ -722,6 +742,46 @@ let s:default_registry = {
\ 'suggested_filetypes': ['typst'], \ 'suggested_filetypes': ['typst'],
\ 'description': 'A formatter for Typst files', \ '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.',
\ },
\ 'rumdl': {
\ 'function': 'ale#fixers#rumdl#Fix',
\ 'suggested_filetypes': ['markdown'],
\ 'description': 'Fix markdown files with rumdl.',
\ },
\ 'tex-fmt': {
\ 'function': 'ale#fixers#tex_fmt#Fix',
\ 'suggested_filetypes': ['bib', 'tex'],
\ 'description': 'Fix LaTeX and bibliography files with tex-fmt.',
\ }
\} \}
" Reset the function registry to the default entries. " Reset the function registry to the default entries.
+1 -1
View File
@@ -7,7 +7,7 @@ function! ale#fixers#alejandra#Fix(buffer) abort
return { return {
\ 'command': ale#Escape(l:executable) \ 'command': ale#Escape(l:executable)
\ . (empty(l:options) ? '' : ' ' . l:options) \ . ale#Pad(l:options)
\ . ' -- -' \ . ' -- -'
\} \}
endfunction endfunction

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