Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rule/name docs #1061

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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