diff --git a/src/flake8/style_guide.py b/src/flake8/style_guide.py index 38fc29a..ebc01ed 100644 --- a/src/flake8/style_guide.py +++ b/src/flake8/style_guide.py @@ -146,8 +146,8 @@ class StyleGuide(object): return find_more_specific(extra_select, ignore) if select or (extra_select and self._using_default_select): return Decision.Selected - if ((select is None and extra_select is None) or - (not self._using_default_ignore and select is None)): + if (select is None and + (extra_select is None or not self._using_default_ignore)): return Decision.Ignored return Decision.Selected diff --git a/tests/unit/test_style_guide.py b/tests/unit/test_style_guide.py index 7ae77d7..5c24048 100644 --- a/tests/unit/test_style_guide.py +++ b/tests/unit/test_style_guide.py @@ -169,6 +169,8 @@ def test_should_report_error(select_list, ignore_list, error_code, expected): (['E2'], ['E21'], [], [], 'E212', style_guide.Decision.Ignored), (['F', 'W'], ['C90'], ['I1'], [], 'C901', style_guide.Decision.Ignored), + (['E', 'W'], ['C'], [], [], 'E131', + style_guide.Decision.Selected), (defaults.SELECT, defaults.IGNORE, [], ['I'], 'I101', style_guide.Decision.Selected), (defaults.SELECT, defaults.IGNORE, ['G'], ['I'], 'G101',