Fix #1219 - Mention FindProjectRoot behavior for Python in the documentation

This commit is contained in:
w0rp 2018-05-30 20:09:33 +01:00
parent f95bc00bd6
commit bd92616e2a
No known key found for this signature in database
GPG Key ID: 0FC1ECAA8C81CD83
2 changed files with 31 additions and 0 deletions

View File

@ -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')

View File

@ -2,6 +2,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*
@ -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|