Skip to content

Commit

Permalink
enforced list data type for pymode_lint_ignore (gh issue 786)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmv1992 committed Nov 19, 2017
1 parent 65c68ea commit 76c582b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions doc/pymode.txt
Expand Up @@ -309,10 +309,9 @@ Default code checkers (you could set several) *'g:pymode_lint_checkers'
Values may be chosen from: `pylint`, `pep8`, `mccabe`, `pep257`, `pyflakes`.

Skip errors and warnings *'g:pymode_lint_ignore'*
E.g. "E501,W002", "E2,W" (Skip all Warnings and Errors that starts with E2) and
etc
E.g. ["W", "E2"] (Skip all Warnings and the Errors starting with E2) etc.
>
let g:pymode_lint_ignore = "E501,W"
let g:pymode_lint_ignore = ["E501", "W",]
Select some error or warnings. *'g:pymode_lint_select'*
By example you disable all warnings starting from 'W', but want to see warning
Expand Down
2 changes: 2 additions & 0 deletions pymode/lint.py
Expand Up @@ -35,10 +35,12 @@ def code_check():
# Fixed in v0.9.3: these two parameters may be passed as strings.
# DEPRECATE: v:0.10.0: need to be set as lists.
if isinstance(env.var('g:pymode_lint_ignore'), str):
raise ValueError ('g:pymode_lint_ignore should have a list type')
ignore = env.var('g:pymode_lint_ignore').split(',')
else:
ignore = env.var('g:pymode_lint_ignore')
if isinstance(env.var('g:pymode_lint_select'), str):
raise ValueError ('g:pymode_lint_ignore should have a list type')
select = env.var('g:pymode_lint_select').split(',')
else:
select = env.var('g:pymode_lint_select')
Expand Down

0 comments on commit 76c582b

Please sign in to comment.