Skip to content

Commit 976ffec

Browse files
committed
fix names for usage policy rules
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent ee5e986 commit 976ffec

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

policy/rules.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ def get_package_filter(self):
4646
return {f"package__{key}": value for key, value in self.package_filter.items()}
4747

4848

49-
class LicensePolicyErrorRule(PackageBaseRule):
50-
rule_type = "license_policy_error"
51-
label = "License Policy Error"
49+
class UsagePolicyErrorRule(PackageBaseRule):
50+
rule_type = "usage_policy_error"
51+
label = "Usage Policy Error"
5252
description = (
5353
"Detects packages assigned a usage policy with a compliance alert level of 'error'."
5454
)
5555
package_filter = {"usage_policy__compliance_alert": "error"}
5656

5757

58-
class LicensePolicyWarningRule(PackageBaseRule):
59-
rule_type = "license_policy_warning"
60-
label = "License Policy Warning"
58+
class UsagePolicyWarningRule(PackageBaseRule):
59+
rule_type = "usage_policy_warning"
60+
label = "Usage Policy Warning"
6161
description = (
6262
"Detects packages assigned a usage policy with a compliance alert level of 'warning'."
6363
)
@@ -101,8 +101,8 @@ def count_violations(self, product, threshold, parameters):
101101

102102

103103
RULE_REGISTRY = {
104-
LicensePolicyErrorRule.rule_type: LicensePolicyErrorRule(),
105-
LicensePolicyWarningRule.rule_type: LicensePolicyWarningRule(),
104+
UsagePolicyErrorRule.rule_type: UsagePolicyErrorRule(),
105+
UsagePolicyWarningRule.rule_type: UsagePolicyWarningRule(),
106106
LicenseCoverageGapRule.rule_type: LicenseCoverageGapRule(),
107107
VulnerabilityDetectedRule.rule_type: VulnerabilityDetectedRule(),
108108
}

0 commit comments

Comments
 (0)