Skip to content

Commit 4b9e9fd

Browse files
committed
Check MISRA C 2012 rules have MISRA C 2012 tags
Needed to specify which amendment or rule set they come from.
1 parent 5497cfa commit 4b9e9fd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/verify_rule_package_consistency.py

+5
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@
100100
print(
101101
f" - ERROR: Rule {rule_id} included in {package_name}.json but not marked as supportable in rules.csv.")
102102
failed = True
103+
for query in rule_details["queries"]:
104+
if standard_name == "MISRA-C-2012" and not any(tag for tag in query["tags"] if tag.startswith("external/misra/c/2012/")):
105+
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.")
107+
failed = True
103108
rules_csv_rule_ids = package_rules_from_csv[package_name]
104109

105110
json_missing_rules = rules_csv_rule_ids.difference(package_json_rule_ids)

0 commit comments

Comments
 (0)