All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 " Author: dsifford <dereksifford@gmail.com>
2 " Description: A performant type-checker supporting LSP for Python 3 created by Facebook
4 call ale#Set('python_pyre_executable', 'pyre')
5 call ale#Set('python_pyre_use_global', get(g:, 'ale_use_global_executables', 0))
6 call ale#Set('python_pyre_auto_pipenv', 0)
7 call ale#Set('python_pyre_auto_poetry', 0)
8 call ale#Set('python_pyre_auto_uv', 0)
10 function! ale_linters#python#pyre#GetExecutable(buffer) abort
11 if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyre_auto_pipenv'))
12 \ && ale#python#PipenvPresent(a:buffer)
16 if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pyre_auto_poetry'))
17 \ && ale#python#PoetryPresent(a:buffer)
21 if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pyre_auto_uv'))
22 \ && ale#python#UvPresent(a:buffer)
26 return ale#python#FindExecutable(a:buffer, 'python_pyre', ['pyre'])
29 function! ale_linters#python#pyre#GetCommand(buffer) abort
30 let l:executable = ale_linters#python#pyre#GetExecutable(a:buffer)
31 let l:exec_args = (l:executable =~? '\(pipenv\|poetry\|uv\)$' ? ' run pyre' : '') . ' persistent'
33 return ale#Escape(l:executable) . l:exec_args
36 function! ale_linters#python#pyre#GetCwd(buffer) abort
37 let l:local_config = ale#path#FindNearestFile(a:buffer, '.pyre_configuration.local')
39 return fnamemodify(l:local_config, ':h')
42 call ale#linter#Define('python', {
45 \ 'executable': function('ale_linters#python#pyre#GetExecutable'),
46 \ 'command': function('ale_linters#python#pyre#GetCommand'),
47 \ 'project_root': function('ale#python#FindProjectRoot'),
48 \ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
49 \ 'cwd': function('ale_linters#python#pyre#GetCwd'),