* 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 --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.
* 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.
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>
* 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>
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.
* 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: #2356Fixes: #3068Fixes: #2301
* 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
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
* 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
* 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.
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>
File local variables in Emacs are used in a way similar to Vim
modelines. For example, at the end of the file you might find something
like the following:
%% Local Variables:
%% erlang-indent-level: 2
%% something-weird: t
%% End:
The `erlang-indent-level' variable in this list instructs the Erlang
mode to use two columns per indentation level. But since the
`something-weird' variable is likely unknown, both may be ignored.
By default, Emacs in batch mode ignores all variable/value pairs if it
encounters at least one that is not known to be safe. Setting
`enable-local-variables' to `:safe' tells Emacs to use only safe values
and ignore the rest.
Version 2 of golangci-lint introduces several breaking changes to the
command line arguments and the configuration file.
Thi PR updates ale integration to support both version 1.6x.x and 2.x.x
of golangci-lint.
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.
Implement the diagnostics pull model with the LSP Neovim client. We
must handle messages a little different and tweak client capabilities
for pull diagnostics to work through the Neovim client.
Implement pull diagnostics in the VimL implementation so ALE is able
to track when servers are busy checking files. Only servers that
support this feature will return diagnostics these ways.
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.