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:
Yining
2024-03-02 10:31:19 +11:00
committed by GitHub
parent 24a937e04f
commit b01c0b23bb
2 changed files with 11 additions and 0 deletions

View File

@@ -45,6 +45,10 @@ function! ale_linters#python#ruff#GetCommand(buffer, version) abort
\ ? ' run ruff'
\ : ''
" NOTE: ruff 0.3.0 deprecates `ruff <path>` in favor of `ruff check <path>`
let l:exec_args = l:exec_args
\ . (ale#semver#GTE(a:version, [0, 3, 0]) ? ' check' : '')
" NOTE: ruff version `0.0.69` supports liniting input from stdin
" NOTE: ruff version `0.1.0` deprecates `--format text`
return ale#Escape(l:executable) . l:exec_args . ' -q'