RULEAPI-820 Don't indiscriminately crop rule names on "_" in coverage computation

This commit is contained in:
Fred Tingaud 2024-12-10 14:39:30 +01:00 committed by Fred Tingaud
parent dd3cecfbc8
commit a6f4f03031

View File

@ -47,14 +47,14 @@ CANONICAL_NAMES = {
'WEB': 'HTML'
}
RULES_FILENAME = 'covered_rules.json'
def get_rule_id(filename):
rule_id = filename[:-5]
if '_' in rule_id:
return rule_id[:rule_id.find('_')]
else:
return rule_id
return rule_id.removesuffix('_abap').removesuffix('_java')
def compatible_languages(rule, languages_from_sonarpedia):
'''