Skip to content

Commit aab6e17

Browse files
committed
Check MISRA C 2012 tags are not on other rules
1 parent 4b9e9fd commit aab6e17

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/verify_rule_package_consistency.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@
103103
for query in rule_details["queries"]:
104104
if standard_name == "MISRA-C-2012" and not any(tag for tag in query["tags"] if tag.startswith("external/misra/c/2012/")):
105105
print(
106-
f" - ERROR: MISRA C 2012 query {query["name"]} for Rule {rule_id} in {package_name}.json is missing a `external/misra/c/2012/...` tag.")
106+
f" - ERROR: MISRA C 2012 query {query["short_name"]}.ql for Rule {rule_id} in {package_name}.json is missing a `external/misra/c/2012/...` tag.")
107+
failed = True
108+
if not standard_name == "MISRA-C-2012" and any(tag for tag in query["tags"] if tag.startswith("external/misra/c/2012/")):
109+
print(
110+
f" - ERROR: {standard_name} query {query["short_name"]}.ql for Rule {rule_id} in {package_name}.json has a spurious `external/misra/c/2012/...` tag.")
107111
failed = True
108112
rules_csv_rule_ids = package_rules_from_csv[package_name]
109113

0 commit comments

Comments
 (0)