Skip to content

Commit

Permalink
Fix code climate issues in no_new_global_applicable_rules.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Mab879 committed Nov 9, 2023
1 parent 93e582c commit de666d5
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions utils/no_new_global_applicable_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,21 @@ def _get_expected_set() -> set:
return expected_set


def _get_current_noprodtypes(rule_dirs):
current_no_prodtypes = set()
def _process_current_rule(current_no_prodtypes: set, rule: dict, rule_id: str):
rule_yaml = ssg.rule_yaml.get_yaml_contents(rule)
has_prodtype = False
for line in rule_yaml.contents:
if 'prodtype:' in line:
has_prodtype = True
break
if not has_prodtype:
current_no_prodtypes.add(rule_id)


def _get_current_noprodtypes(rule_dirs: dict) -> set:
current_no_prodtypes: Set[str] = set()
for rule_id, rule in rule_dirs.items():
rule_yaml = ssg.rule_yaml.get_yaml_contents(rule)
has_prodtype = False
for line in rule_yaml.contents:
if 'prodtype:' in line:
has_prodtype = True
break
if not has_prodtype:
current_no_prodtypes.add(rule_id)
_process_current_rule(current_no_prodtypes, rule, rule_id)
return current_no_prodtypes


Expand Down

0 comments on commit de666d5

Please sign in to comment.