Python .tool versions (#3820)

* Also check for asdf-vm's .tool_versions file

A minimal python project may only be specifying a python version using a version management tool like asdf-vm, without providing other common python project configuration files. asdf-vm creates a single .tool_versions file in the managed directory. By checking for .tool_versions in addition to other common python config files we ensure that python linters (whose behaviour typically depends on a particular python version) will run with the same version of python used by the project. This will also be the same python version used by vim itself when it is run from inside the project's directories.

* add .tool_versions to ale-python-root documentation

This reflects the corresponding change to autoload/ale/python.vim
This commit is contained in:
foobarbyte 2021-07-17 12:46:43 +00:00 committed by GitHub
parent d6dbb5398e
commit 1893abdb19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -34,6 +34,7 @@ function! ale#python#FindProjectRootIni(buffer) abort
\|| filereadable(l:path . '/Pipfile.lock')
\|| filereadable(l:path . '/poetry.lock')
\|| filereadable(l:path . '/pyproject.toml')
\|| filereadable(l:path . '/.tool_versions')
return l:path
endif
endfor

View File

@ -38,6 +38,7 @@ ALE will look for configuration files with the following filenames. >
Pipfile.lock
poetry.lock
pyproject.toml
.tool_versions
<
The first directory containing any of the files named above will be used.