Skip to content

Commit

Permalink
Merge pull request #1061 from cloudflare/name
Browse files Browse the repository at this point in the history
Fix rule/name docs
  • Loading branch information
prymitive authored Aug 12, 2024
2 parents c802c41 + af8416b commit 458f772
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/checks/rule/name.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ rule {
kind = "recording"
}

label "rec:.+" {
name "rec:.+" {
comment = "ALl recording rules must use the `rec:` prefix."
severity = "bug"
}
Expand Down Expand Up @@ -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"
}
Expand Down
8 changes: 4 additions & 4 deletions internal/checks/rule_name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 458f772

Please sign in to comment.