Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/python/review/inspectors/flake8/issue_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
'C818': IssueType.CODE_STYLE,
'C819': IssueType.CODE_STYLE,

# flake8-spellcheck
'SC100': IssueType.INFO,
'SC200': IssueType.INFO,

# WPS: Naming
'WPS117': IssueType.CODE_STYLE, # Forbid naming variables self, cls, or mcs.
'WPS125': IssueType.ERROR_PRONE, # Forbid variable or module names which shadow builtin names.
Expand Down Expand Up @@ -71,7 +75,7 @@
'WPS419': IssueType.ERROR_PRONE, # Forbid multiple returning paths with try / except case.
'WPS424': IssueType.ERROR_PRONE, # Forbid BaseException exception.
'WPS426': IssueType.ERROR_PRONE, # Forbid lambda inside loops.
'WPS432': IssueType.CODE_STYLE, # Forbid magic numbers.
'WPS432': IssueType.INFO, # Forbid magic numbers.
'WPS433': IssueType.CODE_STYLE, # Forbid imports nested in functions.
'WPS439': IssueType.ERROR_PRONE, # Forbid Unicode escape sequences in binary strings.
'WPS440': IssueType.ERROR_PRONE, # Forbid overlapping local and block variables.
Expand Down
1 change: 1 addition & 0 deletions src/python/review/inspectors/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class IssueType(Enum):
CLASS_RESPONSE = 'CLASS_RESPONSE'
METHOD_NUMBER = 'METHOD_NUMBER'
MAINTAINABILITY = 'MAINTAINABILITY'
INFO = 'INFO'


# Keys in results dictionary
Expand Down
6 changes: 3 additions & 3 deletions test/python/inspectors/test_flake8_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_file_with_issues(file_name: str, n_issues: int):
n_cc=8,
n_other_complexity=2)),
('case3_redefining_builtin.py', IssuesTestInfo(n_error_prone=2)),
('case4_naming.py', IssuesTestInfo(n_code_style=7, n_best_practices=3, n_cc=5, n_cohesion=1)),
('case4_naming.py', IssuesTestInfo(n_code_style=7, n_cc=5, n_cohesion=1)),
('case6_unused_variables.py', IssuesTestInfo(n_best_practices=3,
n_cc=1)),
('case8_good_class.py', IssuesTestInfo(n_cc=1, n_cohesion=1)),
Expand Down Expand Up @@ -107,13 +107,13 @@ def test_parse():
assert [issue.description for issue in issues] == ['test 1', 'test 2', 'test 3']
assert [issue.type for issue in issues] == [IssueType.CODE_STYLE,
IssueType.CODE_STYLE,
IssueType.BEST_PRACTICES]
IssueType.INFO]


def test_choose_issue_type():
error_codes = ['B006', 'SC100', 'R503', 'ABC123', 'E101']
expected_issue_types = [
IssueType.ERROR_PRONE, IssueType.BEST_PRACTICES,
IssueType.ERROR_PRONE, IssueType.INFO,
IssueType.ERROR_PRONE, IssueType.BEST_PRACTICES,
IssueType.CODE_STYLE,
]
Expand Down