From 1893abdb1903fb45e7b28d3cd8ae7dd4197e0c3b Mon Sep 17 00:00:00 2001 From: foobarbyte <61650320+foobarbyte@users.noreply.github.com> Date: Sat, 17 Jul 2021 12:46:43 +0000 Subject: 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 --- autoload/ale/python.vim | 1 + doc/ale-python.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/autoload/ale/python.vim b/autoload/ale/python.vim index fc6c1130..779844a2 100644 --- a/autoload/ale/python.vim +++ b/autoload/ale/python.vim @@ -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 diff --git a/doc/ale-python.txt b/doc/ale-python.txt index 6deff8f2..21dee657 100644 --- a/doc/ale-python.txt +++ b/doc/ale-python.txt @@ -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. -- cgit v1.2.3