diff options
-rw-r--r-- | autoload/ale/python.vim | 1 | ||||
-rw-r--r-- | doc/ale-python.txt | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/autoload/ale/python.vim b/autoload/ale/python.vim index 82dd9d7c..cdc71cdd 100644 --- a/autoload/ale/python.vim +++ b/autoload/ale/python.vim @@ -15,6 +15,7 @@ let g:ale_virtualenv_dir_names = get(g:, 'ale_virtualenv_dir_names', [ function! ale#python#FindProjectRootIni(buffer) abort for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h')) + " If you change this, update ale-python-root documentation. if filereadable(l:path . '/MANIFEST.in') \|| filereadable(l:path . '/setup.cfg') \|| filereadable(l:path . '/pytest.ini') diff --git a/doc/ale-python.txt b/doc/ale-python.txt index 67330079..55641892 100644 --- a/doc/ale-python.txt +++ b/doc/ale-python.txt @@ -3,6 +3,31 @@ ALE Python Integration *ale-python-options* =============================================================================== +ALE Python Project Root Behavior *ale-python-root* + +For some linters, ALE will search for a Python project root by looking at the +files in directories on or above where a file being checked is. ALE applies +the following methods, in order: + +1. Find the first directory containing a common Python configuration file. +2. If no configuration file can be found, use the first directory which does + not contain a readable file named `__init__.py`. + +ALE will look for configuration files with the following filenames. > + + MANIFEST.in + setup.cfg + pytest.ini + tox.ini + mypy.ini + pycodestyle.cfg + flake8.cfg +< + +The first directory containing any of the files named above will be used. + + +=============================================================================== autopep8 *ale-python-autopep8* g:ale_python_autopep8_executable *g:ale_python_autopep8_executable* @@ -134,6 +159,8 @@ The minimum supported version of mypy that ALE supports is v0.4.4. This is the first version containing the `--shadow-file` option ALE needs to be able to check for errors while you type. +`mypy` will be run from a detected project root, per |ale-python-root|. + g:ale_python_mypy_executable *g:ale_python_mypy_executable* *b:ale_python_mypy_executable* @@ -292,6 +319,9 @@ g:ale_python_pylint_use_global *g:ale_python_pylint_use_global* =============================================================================== pyls *ale-python-pyls* +`pyls` will be run from a detected project root, per |ale-python-root|. + + g:ale_python_pyls_executable *g:ale_python_pyls_executable* *b:ale_python_pyls_executable* Type: |String| |