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.
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.
* 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
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.
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>
Ensure that basic ALE functions `ale.var`, `ale.escape`, and `ale.env`
are available in Lua. Cover all Lua code so far with busted tests,
fixing bugs where ALE variables can be set with Boolean values instead
of numbers. Document all functionality so far.
1. Add ale.setup and ale.setup.buffer for pure Lua configuration.
2. Update many global settings to use Booleans instead of numbers to
make types easiert to work with in Lua.
3. Radically reformat documentation and fix errors to make
documentation more usable for Neovim users.
Support TCP connections to language servers through Neovim's built in
client. In all but what is currently the nightly builds of Neovim
connections via a hostname will fail, but connections via an IP address
should function. We will still enable the built in Neovim client by
default anyway, as LSP clients very rarely connect over TCP.
Update documentation to advertise ALE's integration with Neovim's native
LSP client, and explain how functionality is integrated with ALE,
Neovim's native tools, and other plugins.
* 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>
This adds Yara support to ALE using Avast's language server for Yara:
https://avast.github.io/yls/
A ".git" folder is used to determine the project_root so this means the
Yara rules must be in a git repo for the integration to work.
The server only have 1 optional argument (-v, --verbose). Since this is
the case, no additional configuration options are available.
---------
Co-authored-by: w0rp <w0rp@users.noreply.github.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.
Resolves#4314.
Add a fixer that's built into python for json formatting. Include a
couple arguments in docs to make these features more discoverable.
Uses stdin-based fixing so you don't need to save the file to fix.
* Add support for c3-lsp linter
Add support for c3-lang with the c3-lsp language server.
Link: http://github.com/pherrymason/c3-lsp
Link: http://c3-lang.org
* fix linter error
* fix: consistent use of the executable name
Consistently use the executable name 'c3lsp' instead of the project name
'c3-lsp'.
* c3lsp: add command line arguments to executable
* 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>
This fixer performs indentation with the Erlang mode for Emacs.
The Erlang mode is maintained in the Erlang/OTP source tree. It indents
some things differently than the Vim indent plugin, and provides more
customization options.
* Prefix user-defined commands with colons
This is consistent with Vim's own :help pages.
* Remove dot hack
Now that we have `:ALEInfo` and `ALEInfo`, we don't need `ALEInfo.` any
more to disambiguate them.
* Use colons in references
* Use angle brackets for command arguments
* Use `:Command` for command references
* Use a non-command reference for tsserver
* Prefix highlight references with hl-
* Fix some references into Vim's own :help
E.g. location-list or +features
* Misc hotlink improvements
* Undo previous changes to tsserver
Just leave it in backticks - even though I don't like it.
* Use bars for a command for consistency
* Append hotlinks to hl-groups
Remove minuses to make tables look more like in Vim's own :help
* Prefix features with +
* Provide full hotlink to ale.txt
* Fix double pipe typo
* Capitalize Error highlight
There seems to be no hotlink in Vim's own documentation for this.
I would have expected *hl-Error* - no such thing :-(
* Right align tags to col 79
The only option available to biome's `lsp-proxy` command used for
linting is `--config-path`. However, we are using ALE to find and set
the project root, and have a way to manually override, so that is no
longer necessary.
The LSP proxy also used the `g:ale_biome_options` config, which is
shared with the fixer's `check` command, but `lsp-proxy` will throw an
error if unknown options are included, making it so that option is only
useful to set the project root.
BREAKING CHANGE: We are no longer passing options to the biome LSP
proxy, but we can still set the project root with
`g:ale_biome_lsp_project_root`.
Since biome supports either `biome.json` or `biome.jsonc` config files,
we need to look for both when searching for the LSP project root. We can
also look for a package.json or .git folder to use. This uses mostly the
same logic as deno.
* 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 `==#`
* Update dart analysis_server command
In 2021 the dart team added a new sub-command `language-server` to
replace the original `./snapshots/analysis_server.dart.snapshot --lsp`
convention for starting the language server.
c224cc2e0d
* Add ale_dart_analysis_server_enable_language_server option
This allows users to opt-in to the new `dart language-server` command.
* Enable ale_dart_analysis_server_enable_language_server option by default
* Update doc/ale-dart.txt
Include the dart version number where the `dart language-server` command
was added.