Skip to content

Commit

Permalink
allow INFO and BLOCKER for CCT rule quality severity to support Multi…
Browse files Browse the repository at this point in the history
…-Quality Rule mode
  • Loading branch information
erwan-serandour authored and frederic-tingaud-sonarsource committed Nov 5, 2024
1 parent 2a2c8c5 commit 47956ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/metadata.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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:

* `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"`.
6 changes: 3 additions & 3 deletions rspec-tools/rspec_tools/validation/rule-metadata-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@
"properties": {
"MAINTAINABILITY": {
"type": "string",
"enum": ["LOW", "MEDIUM", "HIGH"]
"enum": ["INFO", "LOW", "MEDIUM", "HIGH", "BLOCKER"]
},
"RELIABILITY": {
"type": "string",
"enum": ["LOW", "MEDIUM", "HIGH"]
"enum": ["INFO", "LOW", "MEDIUM", "HIGH", "BLOCKER"]
},
"SECURITY": {
"type": "string",
"enum": ["LOW", "MEDIUM", "HIGH"]
"enum": ["INFO", "LOW", "MEDIUM", "HIGH", "BLOCKER"]
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion rspec-tools/tests/validation/test_metadata_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_rule_with_invalid_impacts(invalid_rules: RulesRepository):

def test_rule_with_invalid_impact_level(invalid_rules: RulesRepository):
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)


Expand Down

0 comments on commit 47956ba

Please sign in to comment.