mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-09 22:14:44 +08:00
python/pylint: Change directory to project root
Pylint only [checks for pylintrc] (and .pylintrc) files in the packages aboves its current directory before falling back to user and global pylintrc. For projects with a src dir, running pylint from the directory containing the file will not use the project pylintrc. Adopt the convention used by many other Python linters of running from the project root, which solves this issue. Add pylintrc and .pylintrc to FindProjectRoot. Update docs. [checks for pylintrc]: https://github.com/PyCQA/pylint/blob/pylint-2.2.2/pylint/config.py#L106 Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
This commit is contained in:
@@ -39,7 +39,7 @@ Execute(The pylint callbacks shouldn't detect virtualenv directories where they
|
||||
silent execute 'file ' . fnameescape(g:dir . '/python_paths/no_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
AssertLinter 'pylint',
|
||||
\ ale#path#BufferCdString(bufnr(''))
|
||||
\ ale#path#CdString(ale#path#Simplify(g:dir . '/python_paths/no_virtualenv/subdir'))
|
||||
\ . ale#Escape('pylint') . ' ' . b:command_tail
|
||||
|
||||
Execute(The pylint callbacks should detect virtualenv directories):
|
||||
@@ -50,7 +50,7 @@ Execute(The pylint callbacks should detect virtualenv directories):
|
||||
\)
|
||||
|
||||
AssertLinter b:executable,
|
||||
\ ale#path#BufferCdString(bufnr(''))
|
||||
\ ale#path#CdString(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir'))
|
||||
\ . ale#Escape(b:executable) . ' ' . b:command_tail
|
||||
|
||||
Execute(You should able able to use the global pylint instead):
|
||||
@@ -58,7 +58,7 @@ Execute(You should able able to use the global pylint instead):
|
||||
let g:ale_python_pylint_use_global = 1
|
||||
|
||||
AssertLinter 'pylint',
|
||||
\ ale#path#BufferCdString(bufnr(''))
|
||||
\ ale#path#CdString(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir'))
|
||||
\ . ale#Escape('pylint') . ' ' . b:command_tail
|
||||
|
||||
Execute(Setting executable to 'pipenv' appends 'run pylint'):
|
||||
|
||||
Reference in New Issue
Block a user