summaryrefslogtreecommitdiff
path: root/ale_linters/python/ruff.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/python/ruff.vim')
-rw-r--r--ale_linters/python/ruff.vim10
1 files changed, 8 insertions, 2 deletions
diff --git a/ale_linters/python/ruff.vim b/ale_linters/python/ruff.vim
index f30d42c0..25ae2d91 100644
--- a/ale_linters/python/ruff.vim
+++ b/ale_linters/python/ruff.vim
@@ -7,6 +7,7 @@ call ale#Set('python_ruff_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_ruff_change_directory', 1)
call ale#Set('python_ruff_auto_pipenv', 0)
call ale#Set('python_ruff_auto_poetry', 0)
+call ale#Set('python_ruff_auto_uv', 0)
call ale#fix#registry#Add('ruff',
\ 'ale#fixers#ruff#Fix',
@@ -25,6 +26,11 @@ function! ale_linters#python#ruff#GetExecutable(buffer) abort
return 'poetry'
endif
+ if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_ruff_auto_uv'))
+ \ && ale#python#UvPresent(a:buffer)
+ return 'uv'
+ endif
+
return ale#python#FindExecutable(a:buffer, 'python_ruff', ['ruff'])
endfunction
@@ -41,7 +47,7 @@ endfunction
function! ale_linters#python#ruff#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#ruff#GetExecutable(a:buffer)
- let l:exec_args = l:executable =~? 'pipenv\|poetry$'
+ let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run ruff'
\ : ''
@@ -49,7 +55,7 @@ function! ale_linters#python#ruff#GetCommand(buffer, version) abort
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.0.69` supports linting input from stdin
" NOTE: ruff version `0.1.0` deprecates `--format text`
return ale#Escape(l:executable) . l:exec_args . ' -q'
\ . ' --no-fix'