Commit Graph

4540 Commits

Author SHA1 Message Date
w0rp
400857d758 Implement Lua ALE setup & overhaul documentation
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.
2025-03-27 12:40:11 +00:00
w0rp
2280d41b30 Support g:ale_shell with the Neovim LSP client 2025-03-27 12:40:11 +00:00
w0rp
cdbd218a82 Add Neovim TCP connections to language servers
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.
2025-03-27 12:40:11 +00:00
w0rp
73b568b071 Supply language_id values to Neovim LSP API
Change logic so ALE's LSP implementation and the Neovim LSP client
retrieve the language_id for language clients at roughly the same time
via the same means. This makes ALE inform the language server what the
language for the language is for clients.
2025-03-27 12:40:11 +00:00
w0rp
4f4d68f153 Fix tests for Neovim LSP integration 2025-03-27 12:40:11 +00:00
w0rp
25547c856e Update documentation for Neovim LSP integration
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.
2025-03-27 12:40:11 +00:00
w0rp
cec1b26d82 Clean up message handling for LSP integration
Now we ought to be able to handle any kind of response for any request
we send, clean up message handling so there are fewer changes to make
to LSP code to adjust for Neovim integration.
2025-03-27 12:40:11 +00:00
w0rp
33377583fd Handle other LSP capabilities via ALE
Save capabilities from language servers ALE connects to via Neovim's LSP
client and handle responses to requests ALE sends to language servers.
This enables ALE to work with Neovim's language client for its commands
while also letting users directly use the connected clients for native
Neovim keybinds and so on.
2025-03-27 12:40:11 +00:00
w0rp
22c741648f Remove the log_level line from Lua code 2025-03-27 12:40:11 +00:00
w0rp
338f3eeb73 Handle Neovim LSP diagnostics via ALE's functions 2025-03-27 12:40:11 +00:00
w0rp
8ee20eca4b Start up language servers with Neovim's API
Get language servers starting and displaying diagnostics with Neovim's
API in Neovim 0.8 and up. With this set up, now ALE needs to take over
handling diagnostics returned by the language servers.
2025-03-27 12:40:11 +00:00
dcai
f3512cd778 fix(biome): update biome to replace deprecated arguments (#4934) 2025-03-27 12:37:31 +00:00
Horacio Sanson
7fcc0548b0 (feat) add support for kulala_fmt fixer (#4925)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-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) add support for kulala_fmt fixer

Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2025-03-18 12:40:52 +00:00
w0rp
9ce2c29df1 Simplfiy zlint configuration and tests 2025-03-18 12:33:58 +00:00
Enrique Miguel Mora Meza
59c996c5b8 Support for Zlint as Zig linter (#4923)
* 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
2025-03-18 12:30:05 +00:00
w0rp
c4cedeea3f Remove unreliable yls test for now 2025-03-18 11:57:49 +00:00
w0rp
f3b6269388 Make yls tests work better locally 2025-03-18 11:38:47 +00:00
Adrian Vollmer
47f1f49655 Add linting support for all formats supported by djlint (#4920)
Some checks are pending
CI / build_image (push) Waiting to run
CI / test_ale (--linters-only) (push) Blocked by required conditions
CI / test_ale (--neovim-07-only) (push) Blocked by required conditions
CI / test_ale (--neovim-08-only) (push) Blocked by required conditions
CI / test_ale (--vim-80-only) (push) Blocked by required conditions
CI / test_ale (--vim-90-only) (push) Blocked by required conditions
* 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>
2025-03-18 07:56:32 +09:00
Adrian Vollmer
fe6a91fb92 Add the typstyle formatter as a fixer for Typst (#4927)
Some checks are pending
CI / build_image (push) Waiting to run
CI / test_ale (--linters-only) (push) Blocked by required conditions
CI / test_ale (--neovim-07-only) (push) Blocked by required conditions
CI / test_ale (--neovim-08-only) (push) Blocked by required conditions
CI / test_ale (--vim-80-only) (push) Blocked by required conditions
CI / test_ale (--vim-90-only) (push) Blocked by required conditions
Co-authored-by: Adrian Vollmer <computerfluesterer@protonmail.com>
2025-03-17 21:10:24 +09:00
K4YT3X
995d78435a fix(golangci-lint): incorrect filename concat preventing errors from being displayed (#4926)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-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: k4yt3x <i@k4yt3x.com>
2025-03-16 09:56:27 +09:00
w0rp
1c91102112 Bump the ALE version to 4.0.0
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-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
v4.0.0
2025-03-14 11:58:10 +00:00
w0rp
8506d0d1ae Fix the ftplugin for ALEInfo in Vim 8.0
Some checks are pending
CI / build_image (push) Waiting to run
CI / test_ale (--linters-only) (push) Blocked by required conditions
CI / test_ale (--neovim-07-only) (push) Blocked by required conditions
CI / test_ale (--neovim-08-only) (push) Blocked by required conditions
CI / test_ale (--vim-80-only) (push) Blocked by required conditions
CI / test_ale (--vim-90-only) (push) Blocked by required conditions
2025-03-14 09:40:08 +00:00
w0rp
15bf26632c Close #4618 - Do not show info for the ALEInfo window 2025-03-14 09:19:41 +00:00
Simon Lundström
1acd964a2b Fix docs for variable names (#4922)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
2025-03-12 17:43:46 +00:00
Braden Kelley
07b0496f6d Run opacheck on entire dir for more context (#4531)
Some checks are pending
CI / build_image (push) Waiting to run
CI / test_ale (--linters-only) (push) Blocked by required conditions
CI / test_ale (--neovim-07-only) (push) Blocked by required conditions
CI / test_ale (--neovim-08-only) (push) Blocked by required conditions
CI / test_ale (--vim-80-only) (push) Blocked by required conditions
CI / test_ale (--vim-90-only) (push) Blocked by required conditions
Running `opa check` on a single file can report errors that might not
exist when considering other files in the same directory
2025-03-11 20:05:06 +00:00
JINNOUCHI Yasushi
61191dd4bf feat: remove logic for unsupported older Neovim (#4921)
See #4872

Now we no longer support Neovim 0.6 or older, we can remove logic in Lua code for supporting it.
2025-03-11 19:57:38 +00:00
JINNOUCHI Yasushi
e4a2bff0f2 Consider the original config for signs in Neovim (#4872)
Some checks are pending
CI / build_image (push) Waiting to run
CI / test_ale (--linters-only) (push) Blocked by required conditions
CI / test_ale (--neovim-07-only) (push) Blocked by required conditions
CI / test_ale (--neovim-08-only) (push) Blocked by required conditions
CI / test_ale (--vim-80-only) (push) Blocked by required conditions
CI / test_ale (--vim-90-only) (push) Blocked by required conditions
Preserve a user-configured sign priority in Neovim if set, and use the ALE setting if not configured otherwise.
2025-03-11 13:14:21 +00:00
w0rp
a49943aa62 Update GitHub Actions to test with Neovim 0.7 2025-03-11 13:06:21 +00:00
w0rp
564369db58 Update the minimum supported Neovim version to 0.7 2025-03-11 13:04:52 +00:00
tony-o
92753662a7 Add scadformat fixer for OpenSCAD (#4808)
Add scadformat to ALE

---------

Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2025-03-11 13:00:03 +00:00
Raph471
b26608681d Add pymarkdown for Markdown linting (#4906)
Add support for pymarkdown

Closes #4785
2025-03-11 12:31:31 +00:00
TcM1911
f0c8eb4fa8 Add Yara yls support (#4886)
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>
2025-03-11 12:18:29 +00:00
w0rp
0f71d4c494 Use ModeChanged events instead of InsertLeave emulation #4919 #4738
Some checks are pending
CI / build_image (push) Waiting to run
CI / test_ale (--linters-only) (push) Blocked by required conditions
CI / test_ale (--neovim-06-only) (push) Blocked by required conditions
CI / test_ale (--neovim-08-only) (push) Blocked by required conditions
CI / test_ale (--vim-80-only) (push) Blocked by required conditions
CI / test_ale (--vim-90-only) (push) Blocked by required conditions
`ModeChanged` looks like a more reliable way to detect an "exit insert mode" event and is a lot simpler (doesn't need a timer). Also, it can detect some other transitions like `\<C-o\>` in insert mode.
The `ModeChanged` event is available in:

* [Vim 8.2.3430](f1e8876fa2)
* [NeoVim 0.7.0](69bd1e4e36)

---------

Co-authored-by: Dmitry Zolotukhin <zlogic@gmail.com>
2025-03-10 21:28:20 +00:00
Vivian De Smedt
3611c32d60 Add support for the [djlinter](https://www.djlint.com/) (#4909)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--neovim-06-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 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.
2025-03-08 16:45:17 +09:00
Alexander Huynh
a6db6c95a6 more defensive coding: guard against a non-iterable loclist (#4912)
Sometimes `s:HandleExit` can execute a deferred linter callback, which
ends up setting the `l:loclist` that's passed into
`ale#engine#HandleLoclist` at the end of `s:HandleExit` to a dictionary.
This dictionary cannot be iterated over, and thus errors out.

Guard against trying to iterate over values that don't make sense.

Co-authored-by: Alexander Huynh <git@e.sc>
2025-03-08 16:44:43 +09:00
Horacio Sanson
7882fb9811 Fix 4913 - use JSON output for golangci-lint instead of regexps. (#4917)
Some checks are pending
CI / build_image (push) Waiting to run
CI / test_ale (--linters-only) (push) Blocked by required conditions
CI / test_ale (--neovim-06-only) (push) Blocked by required conditions
CI / test_ale (--neovim-08-only) (push) Blocked by required conditions
CI / test_ale (--vim-80-only) (push) Blocked by required conditions
CI / test_ale (--vim-90-only) (push) Blocked by required conditions
* Fix 4913 - use JSON output for golangci-lint instead of regexps.

* Check for empty array
2025-03-07 22:02:49 +09:00
Noah
e319d48941 Fixed the issue with Black ignoring config file to tell it which file is being processed. (#3406) (#4894)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--neovim-06-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
* Fixed the issue with Black ignoring files is being processed. (#3406)

Add test for stdin-filename on test/fixers/test_ruff_format_fixer_callback.vader

* Fixed the issue with Black ignoring files is being processed. (#3406)
Fixed the problem on Windows's tests.

* Fixed the issue with Black ignoring config file to tell it which file is being processed. Trailing whitespace removed
2025-02-24 11:36:56 +09:00
David Briscoe
d38a3f7739 Add fixer for json: python's json.tool (#4847)
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.
2025-02-24 11:30:43 +09:00
Jim Keener
699c0dbe80 iverilog current file search path (#4907)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--neovim-06-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
In the vein of commit ea72d66b "Verilator current file search path (#3500)"

This includes the directory of the current file in the library
search path. From `man iverilog`:

           -ylibdir
               Append  the  directory  to the library module search
               path. When the compiler finds an undefined module, it
               looks in these directories for files with the right name.
2025-02-16 10:38:30 +09:00
Bogdan Gusiev
ce2b002c03 Add matched text to ALEFindReferences -quickfix for tsserver (#4898)
Some checks are pending
CI / build_image (push) Waiting to run
CI / test_ale (--linters-only) (push) Blocked by required conditions
CI / test_ale (--neovim-06-only) (push) Blocked by required conditions
CI / test_ale (--neovim-08-only) (push) Blocked by required conditions
CI / test_ale (--vim-80-only) (push) Blocked by required conditions
CI / test_ale (--vim-90-only) (push) Blocked by required conditions
* Add matched text to ALEFindReferences -quickfix for tsserver

* Update autoload/ale/references.vim
2025-02-16 10:16:01 +09:00
Takahito Nakano
e5d6d94f71 Fix cwd setting to use .stylua.toml if stylua.toml is not found (#4892)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--neovim-06-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-02-07 18:19:05 +09:00
Kevin Quinn
62af9f2650 fix: memory-limit option for phpstan (#4900)
This might only be a problem for newer phpstan versions (2.1.1 here).

If you try to run `phpstan` the way ale will when it builds the option, you will get something like:

```
The "--memory-limit" option requires a value.
```

It wants you to use `--memory-limit=-1` instead.
2025-02-07 18:12:54 +09:00
dcai
305e1c2fb1 fix(biome): update biome fixer supports css and graphql (#4902)
Co-authored-by: dcai <dongsheng.cai@iag.com.au>
2025-02-07 17:48:58 +09:00
dcai
6c337ad19c fix: stylua should have cwd and --stdin-filepath (#4873)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--neovim-06-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-01-10 13:35:30 +09:00
Vangelis
83ec182bdf xmllint fixer must read from stdin - not buffer filename (#4884)
The current xmllint fixer reads and formats the file that a buffer is
associated with from disk instead of accepting input from stdin. This
has the side effect that if the filename is changed in the buffer, but
not saved yet, the fixer discards all the pending changes and replaces
the buffer contents with the formatted text from the file contents on
disk.
2025-01-10 13:34:56 +09:00
konimarti
3ca2a9ea3c Add support for c3-lsp linter (#4836)
* 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
2025-01-10 13:34:29 +09:00
Dmitri Vereshchagin
0551602b19 Add erlfmt fixer to the registry and use it with stdin (#4868)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--neovim-06-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 erlfmt fixer to the registry

Without this, the fixer will not appear in the list of suggested tools
and cannot be used without additional configuration.

* Handle stdin in the erlfmt fixer command

Previously, the full path to the file being edited was used, which
resulted in the loss of unsaved changes.

* Add executable selection tests for erlfmt fixer
2024-12-29 13:55:43 +09:00
Logan
c9df465148 Add podman to launch test (#4882)
Users can set the DOCKER environnement variable to select Docker or
Podman to run the tests.

Co-authored-by: L'HOSPITAL Logan <lhospitallogan@gmail.com>
2024-12-29 13:42:04 +09:00
Hugo
d69f8fed73 Implement support for apkbuild-fixer (#4881)
I am not the author of a single file, but have full permissions from the
original author for permission for submitting this to ALE under the
2-Clause BSD licence.

See: https://gitlab.alpinelinux.org/Leo/apkbuild.vim/-/issues/3
2024-12-29 13:37:33 +09:00
axhav
e82fd24943 Add yq support (#4861)
* 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>
2024-12-29 13:36:18 +09:00