Skip to content

Commit 76c582b

Browse files
committed
enforced list data type for pymode_lint_ignore (gh issue 786)
1 parent 65c68ea commit 76c582b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

doc/pymode.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,9 @@ Default code checkers (you could set several) *'g:pymode_lint_checkers'
309309
Values may be chosen from: `pylint`, `pep8`, `mccabe`, `pep257`, `pyflakes`.
310310

311311
Skip errors and warnings *'g:pymode_lint_ignore'*
312-
E.g. "E501,W002", "E2,W" (Skip all Warnings and Errors that starts with E2) and
313-
etc
312+
E.g. ["W", "E2"] (Skip all Warnings and the Errors starting with E2) etc.
314313
>
315-
let g:pymode_lint_ignore = "E501,W"
314+
let g:pymode_lint_ignore = ["E501", "W",]
316315
317316
Select some error or warnings. *'g:pymode_lint_select'*
318317
By example you disable all warnings starting from 'W', but want to see warning

pymode/lint.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ def code_check():
3535
# Fixed in v0.9.3: these two parameters may be passed as strings.
3636
# DEPRECATE: v:0.10.0: need to be set as lists.
3737
if isinstance(env.var('g:pymode_lint_ignore'), str):
38+
raise ValueError ('g:pymode_lint_ignore should have a list type')
3839
ignore = env.var('g:pymode_lint_ignore').split(',')
3940
else:
4041
ignore = env.var('g:pymode_lint_ignore')
4142
if isinstance(env.var('g:pymode_lint_select'), str):
43+
raise ValueError ('g:pymode_lint_ignore should have a list type')
4244
select = env.var('g:pymode_lint_select').split(',')
4345
else:
4446
select = env.var('g:pymode_lint_select')

0 commit comments

Comments
 (0)