Commit Graph

172 Commits

Author SHA1 Message Date
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)
Some checks failed
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
Benjamin Block
d0cdde7516 Add support for the Lean 4 LSP, served by lake. (#4952) 2025-04-26 10:48:39 +09:00
Horacio Sanson
067e74fee8 Add support for glnagci-lint v2 (#4936)
Some checks failed
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
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.
2025-03-31 11:46:42 +01:00
w0rp
06f4b6fe25 Detect the Lua project root using .luarc.json 2025-03-27 12:40:11 +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
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
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
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
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
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
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
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
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
Diego Henrique Oliveira
a7ef1817b7 Improve support for python package manage: pipenv, poetry and uv (#4825)
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
2024-09-05 15:37:30 +09:00
ghsang
954682108d Add support for astro (#4780)
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
* feat: prettier for astro
* feat: eslint for astro
* feat: doc for astro
2024-08-14 08:24:22 +01:00
Dmitri Vereshchagin
48d73c87c3 Refactor SyntaxErl linter file (#4807) 2024-07-12 09:40:38 +09:00
Braden Kelley
a0ad5f938a fix!(biome): allow passing options to biome check (#4799)
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`.
2024-06-27 14:30:06 +09:00
Braden Kelley
ed0b036220 fix(biome): find root when using biome.jsonc (#4774)
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.
2024-06-25 17:18:28 +09:00
Loic Nageleisen
e09520e2d7 Add Ruby linter with Steep (#4671)
* 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 `==#`
2024-06-25 17:17:27 +09:00
Braden Kelley
5606606b32 fix(biome): send correct language to lsp proxy (#4773)
Since Biome understands `typescriptreact` and `javascriptreact` as
languages, we can send the `filetype` to the LSP, rather than only
sending `typescript` for both `ts` and `tsx` files, or `javascript` for
`js` and `jsx` files.

fixes: #4752
2024-06-24 06:32:24 +01:00
Braden Kelley
f2aef2f510 fix(biome): run all enabled biome fixers (#4763)
- based on biome config, will format, lint, and/or sort imports
- adds variable to apply unsafe fixes, disabled by default

fixes: #4754
2024-06-21 09:21:19 +09:00
w0rp
c7c41e1574 Run actionlint by default on GitHub files
Detect paths containing .github as a directory for running actionlint
by default on YAML filetypes.
2024-06-02 19:07:06 +01:00
ghsang
adaa7f6f62 Fix eslint cwd strategy (#4781)
Change eslint cwd to follow configuration file paths.
2024-05-31 09:30:37 +02:00
Macuyler Dunn
c88bddfa83 Update dart analysis_server command (#4761)
* 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.
2024-05-09 10:58:16 +09:00
Yining
d19b238aa2 fix: force --no-fix when ruff used as a linter (#4759)
this commit is to fix #4756 which suggests to force disable applying
fixes when linting, particularly when `fix = true` was set in project
`pyproject.toml` file.

The flag `--no-fix` was added without checking the version of `ruff` at
this moment as it seems to be available in a quite early version.
2024-04-26 18:29:17 +09:00
Chayoung You
b6b9612691 Make cmake-lint read .cmake-format config file (#4747) 2024-04-07 10:32:19 +09:00
Horacio Sanson
8f9197b79b Fix 4740 - add hurlfmt linter (#4741)
* Fix 4740 - add hurlfmt linter

* Fix 4740 - add hurlfmt fixer

* Fix wrong comments

* Add end_col to qflist

* Fix test
2024-03-12 09:51:49 +09:00
Yining
b01c0b23bb Fix: ruff version 0.3.0 cli breaking changes (#4732)
This commit appends `check` to the ruff executable if the version of
specified ruff executable is `>= 0.3.0`, as ruff version `0.3.0`
deprecates `ruff <path>` in favor of `ruff check <path>`:

https://github.com/astral-sh/ruff/releases/tag/v0.3.0
2024-03-02 08:31:19 +09:00
Horacio Sanson
24a937e04f Fix 4586 - Make golangci-lint lint package on by default. (#4730)
Checking whole packages instead of individual files is more sensible
default for golang projects. Without this we get many cryptic
`typecheck` errors in ALE that do not show when running in terminal or
CI.
2024-02-28 10:07:22 +09:00
Horacio Sanson
8d199d8c10 Fix 4721 - force latex language id on cspell for tex filetype (#4724)
* Fix 4721 - force latex language id on cspell for tex filetype

* Fix tests
2024-02-27 08:54:45 +09:00
Jorengarenar
9b8413a825 Fix chktex highlighting wrong column when using tabs instead of spaces (#4727)
* Fix '-s' to be '-S' when setting 'TabSize=1' for chktex

Fixes #4712
Closes #4725

* Check if chktex's -S option is available

* Check chktex version instead of trying -S option
2024-02-27 08:54:14 +09:00
Horacio Sanson
00dcf52d6f 4712 revert chktex 4661 (#4725)
* Fix 4712 - revert #4661

* Fix tests
2024-02-26 11:56:56 +09:00
Filip Gospodinov
9cc8383fe9 Add full support for biome (#4705)
* Revert "Add biome support for javascript (#4701)"

This reverts commit 8922478a83.

* Add support for biome
2024-02-24 16:51:39 +09:00
Dmitri Vereshchagin
b74cd02648 Set working directory for Elvis linter (#4726)
Most of the time it works to assume that the current working
directory is the root of the project.  However, this is not the case
for Rebar3 checked out dependencies, for example.

It's also worth noting that because of the way Elvis handles file
patterns, and because directories in configuration are relative to the
project root, the path supplied to command must be also relative.
2024-02-24 15:37:55 +09:00
AlvinRolling
52c6146751 Slang linter for Verilog. (#4713) 2024-02-22 11:18:04 +09:00
Dmitri Vereshchagin
1c5b84f375 Update project root detection for erlang_ls linter (#4619)
* Refactor erlang_ls linter tests

* Add Rebar3 _checkouts support for erlang_ls linter

* Add Erlang.mk support for erlang_ls linter
2024-02-22 11:14:56 +09:00
Benjamin Block
8b8ddea6e5 Adding support for Odin language server (ols). (#4679) 2024-02-22 11:12:57 +09:00
Tim Carry
6fd9f3c54f fix #4687 - only lint one file with actionlint (#4688) 2024-02-06 10:23:26 +09:00
ohakutsu
531970533a Add language id of cspell (#4700) 2024-01-14 21:05:38 +09:00
Jorengarenar
94f764631d Fix chktex highlighting wrong column when using tabs instead of spaces (#4661)
* Fix chktex highlighting wrong column when using tabs instead of spaces

Fixes #723

chktex implemented feature request [1] for allowing setting options from
the command line. Thanks to that we can tell it to treat tab character
as of one space width, i.e. one char. That means, after we translate the
output back to Vim columns, we get correct numbers.

[1]: https://savannah.nongnu.org/bugs/?56486

* Add test_tex_chktex.vader

* Use functions to set g: variables in ale_linters/tex/chktex.vim

* Update ale_linters#tex#chktex#GetCommand() to use '%e'
2024-01-14 21:04:23 +09:00
Tim Carry
17cca243e3 Actionlint: correctly parse error line when using shellcheck sublinter (#4689) 2024-01-14 20:51:39 +09:00
Jonathan Palardy
ebc6718c0a Support gleamlsp language server for gleam (#4696) 2024-01-14 20:43:59 +09:00
Finn Steffens
9a23ec1f60 Ruff use json-lines output format (#4656)
* Ruff use json-lines output format
* Fix Ruff: add -q to prevent non json output

Using the json-lines output format allows for setting of the end_line,
end_col and code field of the handle output.

Additionally, the first letter of the code is used to determine the type
field.

Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2023-12-10 11:45:01 +00:00