Age | Commit message (Collapse) | Author |
|
* Add python_pylint_use_msg_id to tweak output of pylint
* Add test for ale_python_pylint_use_msg_id
* Add doc on ale_python_pylint_use_msg_id
|
|
|
|
|
|
python/bandit: Use .bandit configuration file
|
|
Bandit automatically [uses any .bandit file] within the directories on
which it is invoked. Since ALE invokes bandit on stdin, it does not
load a .bandit file automatically. Add support for automatically
finding a .bandit file and passing it to bandit via the --ini option
along with a variable to disable this behavior if desired.
Note: This is useful for the skips and tests configuration options, but
not exclude which would require invoking bandit using a file name, which
may or may not be a good trade-off.
[uses any .bandit file]: https://github.com/PyCQA/bandit/blob/1.5.1/bandit/cli/main.py#L70-L73
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
|
|
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>
|
|
Although using %t to lint changes was desirable, many pylama checks use
surrounding paths and file contents (e.g. C0103 module name, E0402
relative import beyond top, etc.) The more such errors I find during
testing, the less %t seems like a good idea. Switch to %s.
Also set `lint_file` to 1 and mark Pylama as a file linter in the docs.
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
|
|
|
|
* Add pylama for python
* Consolidate python traceback handling
|
|
* Line continuation characters should be on the same lines.
* .vim file line indentation should be a multiple of 4.
|
|
Fixed parsing of pydocstyle errors
|
|
support older flake8 output, still used by hacking module from openstack style guide
|
|
|
|
Resolves #1443.
Heavily inspired by the analogous support added for elixir-ls.
|
|
|
|
ale#Escape function seems to prepend and append ' to the file name, which
are not present in the pydocstyle output. Having the parsing regexp match
the file name was overkill anyway, since there is an obvious 1:1
correspondence between the buffer number and the (potential) errors
reported by pydocstyle.
|
|
The linter can correctly parse pydocstyle output with any of the following
command-line options enabled: --explain, --source, --debug, and/or
--verbose
|
|
Fixes #2092.
|
|
This allows a user to set one variable instead of eight.
|
|
When set to true, and the buffer is currently inside a pipenv,
GetExecutable will return "pipenv", which will trigger the existing
functionality to append the correct pipenv arguments to run each linter.
Defaults to false.
I was going to implement ale#python#PipenvPresent by invoking
`pipenv --venv` or `pipenv --where`, but it seemed to be abominably
slow, even to the point where the test suite wasn't even finishing
("Tried to run tests 3 times"). The diff is:
diff --git a/autoload/ale/python.vim b/autoload/ale/python.vim
index 7baae079..8c100d41 100644
--- a/autoload/ale/python.vim
+++ b/autoload/ale/python.vim
@@ -106,5 +106,9 @@ endfunction
" Detects whether a pipenv environment is present.
function! ale#python#PipenvPresent(buffer) abort
- return findfile('Pipfile.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# ''
+ let l:cd_string = ale#path#BufferCdString(a:buffer)
+ let l:output = systemlist(l:cd_string . 'pipenv --where')[0]
+ " `pipenv --where` returns the path to the dir containing the Pipfile
+ " if in a pipenv, or some error text otherwise.
+ return strpart(l:output, 0, 18) !=# "No Pipfile present"
endfunction
Using vim's `findfile` is much faster, behaves correctly in the majority
of situations, and also works reliably when the `pipenv` command doesn't
exist.
|
|
|
|
|
|
|
|
|
|
|
|
Fix prospector empty string error
|
|
Prospector linter is raising error when no warnings are present in file
(#1680). Copied fix from #779.
|
|
It appends ` run {linter_name}`, analogously to the Ruby linters when
the executable is set to `bundle`
|
|
It appends ` run flake8`, analogously to the Ruby tools when the
executable is set to `bundle`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
executables by default
|
|
|
|
|
|
|
|
|
|
cover the flake8 code with tests
|
|
pycodestyle
|
|
pyls executables
|
|
|
|
E999 to be style errors or warnings
|
|
|
|
|
|
|
|
* Support PyLS (python language server)
* Replace pyls#GetProjectRoot and add more config types to ale#python#FindProjectRoot
|