mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
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.
This commit is contained in:
@@ -52,6 +52,7 @@ 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 . ' -q'
|
||||
\ . ' --no-fix'
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'python_ruff_options'))
|
||||
\ . (ale#semver#GTE(a:version, [0, 1, 0]) ? ' --output-format json-lines' : ' --format json-lines')
|
||||
\ . (ale#semver#GTE(a:version, [0, 0, 69]) ? ' --stdin-filename %s -' : ' %s')
|
||||
|
||||
Reference in New Issue
Block a user