* 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>
* 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>
* 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
* 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
* 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>
* 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
* 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.
The code is already passed with the code key of location list entry.
Before this change, when using the default message format, it appeared
twice in the description of each location list entry and twice in each
echo message.
* feat: Add Zig zlint linter and handler for ALE
* docs: Add zlint documentation to ALE Zig integration guide
* docs: Updating docs for zlint support
* tests: Adding tests for checking zlint executable and command
* refactor: Move zlint configuration test to separate test file
* Refactor djlint linter code
This patch moves the code to the `autoload` directory, so it's available
when it's needed by a specific linter. This avoids redundant code when
another format supported by djlint is added.
* Add linting support for all formats supported by djlint
So far, the `djlint` linter in ALE only supported `html`, which is only
one of several file types supported by `djlint`.
This patch adds support for the following file types:
* gohtmltmpl
* handlebars
* htmlangular
* htmldjango
* jinja
* nunjucks
* Add djlint fixer for various HTML template formats
* Supported formats:
- html
- htmlangular
- htmldjango
- jinja
- handlebars
- nunjucks
- gohtmltmpl
* Add doc entries
* Add vader tests
---------
Co-authored-by: Adrian Vollmer <computerfluesterer@protonmail.com>
* Add support for the [djlinter](https://www.djlint.com/)
* Add documentation and tests.
* Fix the name of the variable for the executable name.
* Correct the name of the handler in the test.
* Correct the test adding the value of vcol.
* Format djlint.vim according to formatting rules.
* Added jq support
Cleaned up yq.vim file
* Updated docs
* Updated supported-tools.md
* Added yq tests
* Fix python linting/formatting error when in virtual environment (#4865)
Python fixers and linters were failing when vim is running in a virtual
environment that's located in a path containing text `poetry`. The cause
of this was the regular expression `poetry\|pipenv\|uv$` which matches
`poetry` and `pipenv` if they appear anywhere in the virtualenv path.
* Add cljfmt fixer for clojure files (#4860)
* When using `actionlint` look for & use a config file (#4858)
Actionlint supports a config file and it lives in a very searchable
path, as the only files it acts on are in the `.github` directory
already.
Look for an `actionlint.yml` and `.yaml` in that path, and use the
config if its there.
* Fix linting with jq (#4765) (#4862)
With the 1.6 version of jq the error message start with "parse error".
With the last version of jq the error message start with "jq: parse error".
Fix it by using a regular expression that works in both cases.
* Properly handle optional end_line_no/end_line_pos in sqlfluff (#4867)
end_line_no/end_line_pos are optional. Example SQL:
`SELECT NULL FROM {{ a_jinja_templated_table }};`
`sqlfluff lint --dialect ansi --format json` gives the following error
among others:
```
{"start_line_no": 1, "start_line_pos": 21, "code": "TMP", "description":
"Undefined jinja template variable: 'a_jinja_templated_table'", "name":
"", "warning": false}
```
As one can see there is no end_line_no/end_line_pos.
* Add golangci-lint fixer (#4853)
Closes#4616
* Fixed copy-paste misstakes and added filter to docs
* Added test vader file for yq
* Fixed and updated the test case
---------
Co-authored-by: Walter Kaunda <14844142+kwalter94@users.noreply.github.com>
Co-authored-by: rudolf ordoyne <49649789+casens5@users.noreply.github.com>
Co-authored-by: Bea Hughes <108035665+beahues@users.noreply.github.com>
Co-authored-by: benjos1234 <legrimlvl24@gmail.com>
Co-authored-by: Coacher <Coacher@users.noreply.github.com>
Co-authored-by: Ian Stapleton Cordasco <graffatcolmingov@gmail.com>
In addition to errors Zeek's parsing can also expose warning messages,
e.g., for the following code
```zeek
event http_stats(c: connection, stats: http_stats_rec) {
c$removal_hooks;
}
```
a warning is emitted
```
warning in /tmp/foo.zeek, line 2: expression value ignored (c$removal_hooks)
```
This patch adds parsing and propagation of these warning messages.
end_line_no/end_line_pos are optional. Example SQL:
`SELECT NULL FROM {{ a_jinja_templated_table }};`
`sqlfluff lint --dialect ansi --format json` gives the following error
among others:
```
{"start_line_no": 1, "start_line_pos": 21, "code": "TMP", "description":
"Undefined jinja template variable: 'a_jinja_templated_table'", "name":
"", "warning": false}
```
As one can see there is no end_line_no/end_line_pos.
With the 1.6 version of jq the error message start with "parse error".
With the last version of jq the error message start with "jq: parse error".
Fix it by using a regular expression that works in both cases.
* Add Ruby linter with Steep
Fixes#3254
* Run steep instead of using language server
LSP presents a few issues and this works around those.
* Work around Steep path issue
See https://github.com/soutaro/steep/pull/975
* Add simple tests for steep
* Add steep to supported tools
* Pass linter
* Add a comment regarding Steep's column counting
* Make lnum an integer
* Add Steep handler test
* Fix separator for Windows
* Escape Windows path separators for substitute()
* Use ALEInfo (I) group
* Use fnameescape instead of quotes
* Skip linting for files not under steep root
* Add and pass tests covering proper steep root lookup
* Fix separator discrepancy
* Use strict operators (match case)
* Fix ordering
* Use `is#` instead of `==#`
As stated in the changelog:
"the original fields of line_pos and line_no have been renamed to start_line_pos and start_line_no, to distinguish them from the new fields starting end_*"
* super hacky way to get ember template lint to work on gjs files
* Clean up code so we use a handler which means we reuse all the config
also moves handler to the glimmer directory so it only fires
for gjs files
* fix tests
* Add end_col and end_lnum to ShellCheck
ShellCheck supports a JSON format mode which includes an 'endLine' and
'endColumn' field.
We must use the newer 'json1' format as it properly treats tabs as a
single character. 'json1' was not supported until v0.7.0 in 2019[1], so
we maintain support for the older GCC based format.
[1] https://github.com/koalaman/shellcheck/blob/v0.9.0/CHANGELOG.md?plain=1#L121
* Add wiki link to ShellCheck json output
Fix solhint for versions >= 3.4.0, while still supporting older
versions.
The solhint linter code has been moved out of the `handlers` directory
as it does not need to be shared between different filetypes. Code has
been simplified.
Co-authored-by: Henrique Barcelos <16565602+hbarcelos@users.noreply.github.com>
* Remove some tests we no longer need
* Delete blocks of redundant code
* Compress some tests together to simplify them
* Remove a little code for ancient linter versions
* Escape more executables we didn't escape before
* Rename a deno option that didn't match our conventions
* fixed parsing errors when certain options are used in glslang
* Update glslang.vim
set column number to 0 like it is always set by glslangValidator
* Added a test for the handler of glslangValidator
* Add support for Bicep when installed as a plugin to Azure CLI
The compiler for Microsoft's DSL Bicep can be installed both
independently and as a plugin to Azure CLI. The latter is probably how
most people install it.
The program output is the same but Azure CLI wraps the arguments and has
a slightly different interface, hence I opted to copy the old linter and
modify it to match the plugin arguments.
* Fix bicep/az_bicep tests, arguments and parsing
* Actually test the ale_linters#bicep#az_bicep#Handle function in the
test that should test that function, not
ale_linters#bicep#bicep#Handle.
* Use the same method as in bicep/bicep for discarding output file, i.e.
by specifying --outfile to a null file.
* Fix parsing of occasionally occurring leading error type (such as
'ERROR: ').
* Correct option defaults for bicep & az_bicep specified in documentation
* Fix error from ansible-lint versions >=6.11.0.
The JSON output format of ansible-lint has changed since
6.11.0. Issue locations can have either a 'positions' or
a 'lines' member, rather than just a 'lines' member as it
was before. This fix checks which member is present, and
passes that member name to subsequent dictionary lookups.
The error was caused by the following change:
https://github.com/ansible/ansible-lint/pull/2897
* Add ansible-lint test to check each type of ansible-lint issue json.
* Change long single-line JSON in ansible test into multiline JSON.
* Fix linting errors in ansible_lint.vim.