Skip to content

Commit 0e66d8a

Browse files
committed
Update comment
1 parent 0ca30a0 commit 0e66d8a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/rules.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,17 @@ func InTx(m dsl.Matcher) {
120120
// error messages for the api. A proper sentence includes proper capitalization
121121
// and ends with punctuation.
122122
// There are ways around the linter, but this should work in the common cases.
123+
// Example:
124+
// Message:
123125
func HttpAPIErrorMessage(m dsl.Matcher) {
124126
m.Import("github.com/coder/coder/coderd/httpapi")
125127

126128
isNotProperError := func(v dsl.Var) bool {
127129
return v.Type.Is("string") &&
128-
// Either starts with a lowercase, or ends without punctuation
130+
// Either starts with a lowercase, or ends without punctuation.
131+
// The reason I don't check for NOT ^[A-Z].*[.!?]$ is because there
132+
// are some exceptions. Any string starting with a formatting
133+
// directive (%s) for example is exempt.
129134
(m["m"].Text.Matches(`^"[a-z].*`) ||
130135
m["m"].Text.Matches(`.*[^.!?]"$`))
131136
}

0 commit comments

Comments
 (0)