diff --git a/ale_linters/python/ruff.vim b/ale_linters/python/ruff.vim index 34db089953..617ef5b702 100644 --- a/ale_linters/python/ruff.vim +++ b/ale_linters/python/ruff.vim @@ -46,10 +46,11 @@ function! ale_linters#python#ruff#GetCommand(buffer, version) abort \ : '' " 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 \ . ale#Pad(ale#Var(a:buffer, 'python_ruff_options')) - \ . ' --format text' - \ . (ale#semver#GTE(a:version, [0, 0, 69]) ? ' --stdin-filename %s -' : ' %s') + \ . (ale#semver#GTE(a:version, [0, 1, 0]) ? ' --output-format text' : ' --format text') + \ . (ale#semver#GTE(a:version, [0, 0, 69]) ? ' --stdin-filename %s -' : ' %s') endfunction function! ale_linters#python#ruff#Handle(buffer, lines) abort diff --git a/test/linter/test_ruff.vader b/test/linter/test_ruff.vader index efc9d86957..049f04faf2 100644 --- a/test/linter/test_ruff.vader +++ b/test/linter/test_ruff.vader @@ -28,6 +28,12 @@ Execute(ruff should run with the file path of buffer in old versions): AssertLinterCwd expand('%:p:h') AssertLinter 'ruff', ale#Escape('ruff') . b:command_tail[:-23] . ' %s' +Execute(ruff should run with the --output-format flag in new versions): + GivenCommandOutput ['ruff 0.1.0'] + + AssertLinterCwd expand('%:p:h') + AssertLinter 'ruff', ale#Escape('ruff') . ' --output-format text --stdin-filename %s -' + Execute(ruff should run with the stdin in new enough versions): GivenCommandOutput ['ruff 0.0.83']