Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inspectors fix #39

Merged
merged 3 commits into from
May 31, 2021
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
1 change: 1 addition & 0 deletions src/python/review/inspectors/flake8/.flake8
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ ignore=W291, # trailing whitespaces
WPS431, # Forbid nested classes.
WPS435, # Forbid multiplying lists.
# WPS: Refactoring
WPS518, # Forbid implicit enumerate() calls. TODO: Collision with "C0200"
WPS527, # Require tuples as arguments for frozenset.
# WPS: OOP
WPS602, # Forbid @staticmethod decorator.
Expand Down
7 changes: 6 additions & 1 deletion src/python/review/inspectors/radon/radon.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
from src.python.review.inspectors.tips import get_maintainability_index_tip


MAINTAINABILITY_ORIGIN_CLASS = "RAD100"


class RadonInspector(BaseInspector):
inspector_type = InspectorType.RADON

Expand Down Expand Up @@ -41,7 +44,9 @@ def mi_parse(cls, mi_output: str) -> List[BaseIssue]:
file_path = Path(groups[0])
maintainability_lack = convert_percentage_of_value_to_lack_of_value(float(groups[1]))

issue_data = IssueData.get_base_issue_data_dict(file_path, cls.inspector_type)
issue_data = IssueData.get_base_issue_data_dict(
file_path, cls.inspector_type, origin_class=MAINTAINABILITY_ORIGIN_CLASS,
)
issue_data[IssueData.DESCRIPTION.value] = get_maintainability_index_tip()
issue_data[IssueData.MAINTAINABILITY_LACK.value] = maintainability_lack
issue_data[IssueData.ISSUE_TYPE.value] = IssueType.MAINTAINABILITY
Expand Down