Skip to content

Commit ba06233

Browse files
committed
fix: remove line numbers in error messages
1 parent 53c3efa commit ba06233

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

cmd/readmevalidation/coderResources.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ func validateCoderResourceReadmeBody(body string) []error {
121121
var errs []error
122122
errs = append(errs, validateReadmeBody(trimmed)...)
123123

124-
if true {
125-
return errs
126-
}
127-
128124
foundParagraph := false
129125
terraformCodeBlockCount := 0
130126
foundTerraformVersionRef := false
@@ -147,7 +143,7 @@ func validateCoderResourceReadmeBody(body string) []error {
147143

148144
if nextLine == "```" {
149145
if !isInsideCodeBlock {
150-
errs = append(errs, fmt.Errorf("line %d: found stray ``` (either an extra code block terminator, or a code block header without a specified language)", lineNum))
146+
errs = append(errs, errors.New("found stray ``` (either an extra code block terminator, or a code block header without a specified language)"))
151147
break
152148
}
153149

@@ -179,7 +175,7 @@ func validateCoderResourceReadmeBody(body string) []error {
179175
}
180176

181177
if strings.HasPrefix(nextLine, "```hcl") {
182-
errs = append(errs, fmt.Errorf("line %d: all .hcl language references must be converted to .tf", lineNum))
178+
errs = append(errs, errors.New("all .hcl language references must be converted to .tf"))
183179
}
184180

185181
continue
@@ -189,7 +185,7 @@ func validateCoderResourceReadmeBody(body string) []error {
189185
// are: (1) empty spaces, (2) paragraphs, (3) HTML, and (4) asset
190186
// references made via [] syntax
191187
trimmedLine := strings.TrimSpace(nextLine)
192-
isParagraph := trimmedLine != "" && !strings.HasPrefix(trimmedLine, "[") && !strings.HasPrefix(trimmedLine, "<")
188+
isParagraph := trimmedLine != "" && !strings.HasPrefix(trimmedLine, "![") && !strings.HasPrefix(trimmedLine, "<")
193189
foundParagraph = foundParagraph || isParagraph
194190
}
195191

0 commit comments

Comments
 (0)