Merge pull request #2502 from ericvw/flake8-config

Change Python project root dir detection for flake8 configuration
This commit is contained in:
w0rp 2019-05-21 00:15:12 +01:00 committed by GitHub
commit 89db85121c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 2 deletions

View File

@ -25,7 +25,7 @@ function! ale#python#FindProjectRootIni(buffer) abort
\|| filereadable(l:path . '/tox.ini')
\|| filereadable(l:path . '/mypy.ini')
\|| filereadable(l:path . '/pycodestyle.cfg')
\|| filereadable(l:path . '/flake8.cfg')
\|| filereadable(l:path . '/.flake8')
\|| filereadable(l:path . '/.flake8rc')
\|| filereadable(l:path . '/pylama.ini')
\|| filereadable(l:path . '/pylintrc')

View File

@ -29,7 +29,7 @@ ALE will look for configuration files with the following filenames. >
tox.ini
mypy.ini
pycodestyle.cfg
flake8.cfg
.flake8
.flake8rc
pylama.ini
pylintrc

View File

@ -0,0 +1,11 @@
Before:
call ale#test#SetDirectory('/testplugin/test')
After:
call ale#test#RestoreDirectory()
Execute(Detect root of Python project with .flake8 correctly):
call ale#test#SetFilename('python-test-files/python-package-project/package-name/module.py')
AssertEqual
\ ale#path#Simplify(g:dir . '/python-test-files/python-package-project'),
\ ale#python#FindProjectRoot(bufnr(''))