allow INFO and BLOCKER for CCT rule quality severity to support Multi-Quality Rule mode

This commit is contained in:
erwan.serandour 2024-10-31 16:24:31 +01:00 committed by Fred Tingaud
parent 2a2c8c536b
commit 47956ba750
3 changed files with 5 additions and 5 deletions

View File

@ -40,6 +40,6 @@ You can update the quickfix field using this GitHub Workflow: https://github.com
The code field is an object that contains information related to the clean code taxonomy. It is an object with two required properties: The code field is an object that contains information related to the clean code taxonomy. It is an object with two required properties:
* `impacts`: A nested object that is treated as a mapping from a software quality to a level (`"LOW"`, `"MEDIUM"` or `"HIGH"`). Note that at least one software quality has to be specified. The current list of allowed software qualities is `"MAINTAINABILITY"`, `"RELIABILITY"` and `"SECURITY"`. * `impacts`: A nested object that is treated as a mapping from a software quality to a level (`"INFO"`, `"LOW"`, `"MEDIUM"`, `"HIGH"` or `"BLOCKER"`). Note that at least one software quality has to be specified. The current list of allowed software qualities is `"MAINTAINABILITY"`, `"RELIABILITY"` and `"SECURITY"`.
* `attribute`: A single clean code attribute that the rule aims to achieve. This has to be one of the following values: `"FORMATTED"`, `"CONVENTIONAL"`, `"IDENTIFIABLE"`, `"CLEAR"`, `"LOGICAL"`, `"COMPLETE"`, `"EFFICIENT"`, `"FOCUSED"`, `"DISTINCT"`, `"MODULAR"`, `"TESTED"`, `"LAWFUL"`, `"TRUSTWORTHY"`, `"RESPECTFUL"`. * `attribute`: A single clean code attribute that the rule aims to achieve. This has to be one of the following values: `"FORMATTED"`, `"CONVENTIONAL"`, `"IDENTIFIABLE"`, `"CLEAR"`, `"LOGICAL"`, `"COMPLETE"`, `"EFFICIENT"`, `"FOCUSED"`, `"DISTINCT"`, `"MODULAR"`, `"TESTED"`, `"LAWFUL"`, `"TRUSTWORTHY"`, `"RESPECTFUL"`.

View File

@ -267,15 +267,15 @@
"properties": { "properties": {
"MAINTAINABILITY": { "MAINTAINABILITY": {
"type": "string", "type": "string",
"enum": ["LOW", "MEDIUM", "HIGH"] "enum": ["INFO", "LOW", "MEDIUM", "HIGH", "BLOCKER"]
}, },
"RELIABILITY": { "RELIABILITY": {
"type": "string", "type": "string",
"enum": ["LOW", "MEDIUM", "HIGH"] "enum": ["INFO", "LOW", "MEDIUM", "HIGH", "BLOCKER"]
}, },
"SECURITY": { "SECURITY": {
"type": "string", "type": "string",
"enum": ["LOW", "MEDIUM", "HIGH"] "enum": ["INFO", "LOW", "MEDIUM", "HIGH", "BLOCKER"]
} }
} }
}, },

View File

@ -82,7 +82,7 @@ def test_rule_with_invalid_impacts(invalid_rules: RulesRepository):
def test_rule_with_invalid_impact_level(invalid_rules: RulesRepository): def test_rule_with_invalid_impact_level(invalid_rules: RulesRepository):
s506 = invalid_rules.get_rule('S506') s506 = invalid_rules.get_rule('S506')
with pytest.raises(RuleValidationError, match=re.escape("Rule S506 failed validation for these reasons:\n - Rule scala:S506 has invalid metadata in MAINTAINABILITY: 'INVALID' is not one of ['LOW', 'MEDIUM', 'HIGH']")): with pytest.raises(RuleValidationError, match=re.escape("Rule S506 failed validation for these reasons:\n - Rule scala:S506 has invalid metadata in MAINTAINABILITY: 'INVALID' is not one of ['INFO', 'LOW', 'MEDIUM', 'HIGH', 'BLOCKER']")):
validate_rule_metadata(s506) validate_rule_metadata(s506)