Further refine our logic handling selection

There was a *very* subtle bug in how we handle blanket select statements
with error codes that are in our DEFAULT_IGNORE. In the specific case,
users were specifying ``--select E`` and E126 was not being properly
reported. This unveiled further logic bugs as we refined this.

Closes #318
This commit is contained in:
Ian Cordasco 2017-05-27 19:22:38 -05:00
parent d890b8b683
commit 2baaf00e83
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A
2 changed files with 13 additions and 5 deletions

View file

@ -125,6 +125,9 @@ def test_is_user_selected_excludes_errors(select_list, error_code):
(['E41'], ['E2', 'E12', 'E4'], 'E410', style_guide.Decision.Selected),
(['E'], ['F'], 'E410', style_guide.Decision.Selected),
(['F'], [], 'E410', style_guide.Decision.Ignored),
(['E'], defaults.IGNORE, 'E126', style_guide.Decision.Selected),
(['W'], defaults.IGNORE, 'E126', style_guide.Decision.Ignored),
(['E'], defaults.IGNORE, 'W391', style_guide.Decision.Ignored),
])
def test_should_report_error(select_list, ignore_list, error_code, expected):
"""Verify we decide when to report an error."""
@ -141,7 +144,7 @@ def test_should_report_error(select_list, ignore_list, error_code, expected):
(defaults.SELECT, [], ['I1'], [], 'I100',
style_guide.Decision.Selected),
(defaults.SELECT, [], ['I1'], [], 'I201',
style_guide.Decision.Selected),
style_guide.Decision.Ignored),
(defaults.SELECT, ['I2'], ['I1'], [], 'I101',
style_guide.Decision.Selected),
(defaults.SELECT, ['I2'], ['I1'], [], 'I201',