File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -120,12 +120,17 @@ func InTx(m dsl.Matcher) {
120
120
// error messages for the api. A proper sentence includes proper capitalization
121
121
// and ends with punctuation.
122
122
// There are ways around the linter, but this should work in the common cases.
123
+ // Example:
124
+ // Message:
123
125
func HttpAPIErrorMessage (m dsl.Matcher ) {
124
126
m .Import ("github.com/coder/coder/coderd/httpapi" )
125
127
126
128
isNotProperError := func (v dsl.Var ) bool {
127
129
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.
129
134
(m ["m" ].Text .Matches (`^"[a-z].*` ) ||
130
135
m ["m" ].Text .Matches (`.*[^.!?]"$` ))
131
136
}
You can’t perform that action at this time.
0 commit comments