mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-23 04:21:26 +08:00
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
This commit is contained in:
@@ -42,6 +42,13 @@ Execute(ruff should run with the stdin in new enough versions):
|
||||
AssertLinter 'ruff', b:command_head . b:command_tail[:-3] . ' -'
|
||||
" AssertLinter 'ruff', b:command_head . b:command_tail[:-3] . '--format json-lines -'
|
||||
|
||||
Execute(ruff should run with the check subcmd in versions >= 0.3.0):
|
||||
GivenCommandOutput ['ruff 0.3.0']
|
||||
|
||||
AssertLinterCwd expand('%:p:h')
|
||||
let b:cmd_head = ale#Escape('ruff') . ' check -q'
|
||||
AssertLinter 'ruff', b:cmd_head . ' --output-format json-lines --stdin-filename %s -'
|
||||
|
||||
Execute(The option for disabling changing directories should work):
|
||||
let g:ale_python_ruff_change_directory = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user