File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,13 @@ Changelog
22=========
33
44
5+ 1.x (unreleased)
6+ ----------------
7+
8+ * Fix ignoring too many checks when ``--select`` is used with codes
9+ declared in a flake8 extension. (Issue #216)
10+
11+
5121.4.6 (2013-07-02)
613------------------
714
Original file line number Diff line number Diff line change 4545700 statements
4646900 syntax error
4747"""
48- __version__ = '1.4.6 '
48+ __version__ = '1.4.7a0 '
4949
5050import os
5151import sys
@@ -1678,6 +1678,9 @@ def ignore_code(self, code):
16781678 return False. Else, if 'options.ignore' contains a prefix of
16791679 the error code, return True.
16801680 """
1681+ if len (code ) < 4 and any (s .startswith (code )
1682+ for s in self .options .select ):
1683+ return False
16811684 return (code .startswith (self .options .ignore ) and
16821685 not code .startswith (self .options .select ))
16831686
Original file line number Diff line number Diff line change @@ -219,6 +219,13 @@ def parse_argv(argstring):
219219 self .assertFalse (pep8style .ignore_code ('W191' ))
220220 self .assertTrue (pep8style .ignore_code ('E241' ))
221221
222+ pep8style = pep8 .StyleGuide (select = ('F401' ,), paths = [E11 ])
223+ self .assertEqual (pep8style .options .select , ('F401' ,))
224+ self .assertEqual (pep8style .options .ignore , ('' ,))
225+ self .assertFalse (pep8style .ignore_code ('F' ))
226+ self .assertFalse (pep8style .ignore_code ('F401' ))
227+ self .assertTrue (pep8style .ignore_code ('F402' ))
228+
222229 def test_styleguide_excluded (self ):
223230 pep8style = pep8 .StyleGuide (paths = [E11 ])
224231
You can’t perform that action at this time.
0 commit comments