Skip to content

Commit

Permalink
Cleanup check code
Browse files Browse the repository at this point in the history
Signed-off-by: romanodanilo <[email protected]>
  • Loading branch information
romanodanilo committed Jul 9, 2024
1 parent d0ca81d commit 3a6abd7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from collections import deque, defaultdict

MIN_RULE_VERSION = "1.2.0"
RULE_SEVERITY = IssueSeverity.ERROR


def check_rule(checker_data: models.CheckerData) -> None:
Expand All @@ -40,7 +41,6 @@ def check_rule(checker_data: models.CheckerData) -> None:
logging.info(f"- Version not found in the file. Skipping check")
return

rule_severity = IssueSeverity.ERROR
if utils.compare_versions(schema_version, MIN_RULE_VERSION) < 0:
logging.info(
f"- Version {schema_version} is less than minimum required version {MIN_RULE_VERSION}. Skipping check"
Expand Down Expand Up @@ -87,7 +87,7 @@ def check_rule(checker_data: models.CheckerData) -> None:
checker_bundle_name=constants.BUNDLE_NAME,
checker_id=reference_constants.CHECKER_ID,
description="Issue flagging when no Actor is specified but a PrivateAction is used",
level=rule_severity,
level=RULE_SEVERITY,
rule_uid=rule_uid,
)
private_actions_xpaths = [root.getpath(x) for x in private_actions]
Expand Down

0 comments on commit 3a6abd7

Please sign in to comment.