diff options
author | w0rp <w0rp@users.noreply.github.com> | 2019-02-20 09:54:13 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-20 09:54:13 +0000 |
commit | 707a42167f184355b64e1368a5e390dffc0cb885 (patch) | |
tree | 4c92c8f141a4f4dda015d5c818c2150ad532b313 /ale_linters | |
parent | 09cbd70d9bc49dee421e0d4fdb252f8a77d8b1d6 (diff) | |
parent | 3300b1aca7f53a8468547194d074e1cb5bc55e15 (diff) | |
download | ale-707a42167f184355b64e1368a5e390dffc0cb885.zip |
Merge pull request #2302 from kevinoid/pylint-cd-proj-root
python/pylint: Change directory to project root
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/python/pylint.vim | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ale_linters/python/pylint.vim b/ale_linters/python/pylint.vim index da845b7a..f0f79cd7 100644 --- a/ale_linters/python/pylint.vim +++ b/ale_linters/python/pylint.vim @@ -17,9 +17,17 @@ function! ale_linters#python#pylint#GetExecutable(buffer) abort endfunction function! ale_linters#python#pylint#GetCommand(buffer) abort - let l:cd_string = ale#Var(a:buffer, 'python_pylint_change_directory') - \ ? ale#path#BufferCdString(a:buffer) - \ : '' + let l:cd_string = '' + + if ale#Var(a:buffer, 'python_pylint_change_directory') + " pylint only checks for pylintrc in the packages above its current + " directory before falling back to user and global pylintrc. + " Run from project root, if found, otherwise buffer dir. + let l:project_root = ale#python#FindProjectRoot(a:buffer) + let l:cd_string = l:project_root isnot# '' + \ ? ale#path#CdString(l:project_root) + \ : ale#path#BufferCdString(a:buffer) + endif let l:executable = ale_linters#python#pylint#GetExecutable(a:buffer) |