diff --git a/docs/checks/rule/name.md b/docs/checks/rule/name.md index c22c475c..cc7b10e3 100644 --- a/docs/checks/rule/name.md +++ b/docs/checks/rule/name.md @@ -43,7 +43,7 @@ rule { kind = "recording" } - label "rec:.+" { + name "rec:.+" { comment = "ALl recording rules must use the `rec:` prefix." severity = "bug" } @@ -83,7 +83,7 @@ you can add a more specific comment. Example pint rule: ```js -label "rec:.+" { +name "rec:.+" { comment = "ALl recording rules must use the `rec:` prefix." severity = "bug" } diff --git a/internal/checks/rule_name_test.go b/internal/checks/rule_name_test.go index 5ac508f3..c2e78622 100644 --- a/internal/checks/rule_name_test.go +++ b/internal/checks/rule_name_test.go @@ -11,7 +11,7 @@ import ( func TestRuleName(t *testing.T) { testCases := []checkTest{ { - description: "doesn't ignore rules with syntax errors", + description: "recording rule name doesn't match", content: "- record: foo\n expr: sum(foo) without(\n", checker: func(_ *promapi.FailoverGroup) checks.RuleChecker { return checks.NewRuleNameCheck(checks.MustTemplatedRegexp("total:.+"), "some text", checks.Warning) @@ -33,7 +33,7 @@ func TestRuleName(t *testing.T) { }, }, { - description: "doesn't ignore rules with syntax errors", + description: "recording rule name match", content: "- record: total:foo\n expr: sum(foo) without(\n", checker: func(_ *promapi.FailoverGroup) checks.RuleChecker { return checks.NewRuleNameCheck(checks.MustTemplatedRegexp("total:.+"), "some text", checks.Warning) @@ -42,7 +42,7 @@ func TestRuleName(t *testing.T) { problems: noProblems, }, { - description: "doesn't ignore rules with syntax errors", + description: "alerting rule name doesn't match", content: "- alert: foo\n expr: sum(foo) without(\n", checker: func(_ *promapi.FailoverGroup) checks.RuleChecker { return checks.NewRuleNameCheck(checks.MustTemplatedRegexp("total:.+"), "some text", checks.Warning) @@ -64,7 +64,7 @@ func TestRuleName(t *testing.T) { }, }, { - description: "doesn't ignore rules with syntax errors", + description: "alerting rule name match", content: "- alert: total:foo\n expr: sum(foo) without(\n", checker: func(_ *promapi.FailoverGroup) checks.RuleChecker { return checks.NewRuleNameCheck(checks.MustTemplatedRegexp("total:.+"), "some text", checks.Warning)