@@ -17,11 +17,16 @@ import (
1717var (
1818 supportedResourceTypes = []string {"modules" , "templates" }
1919 operatingSystems = []string {"windows" , "macos" , "linux" }
20+ gfmAlertTypes = []string {"NOTE" , "IMPORTANT" , "CAUTION" , "WARNING" , "TIP" }
2021
2122 // TODO: This is a holdover from the validation logic used by the Coder Modules repo. It gives us some assurance, but
2223 // realistically, we probably want to parse any Terraform code snippets, and make some deeper guarantees about how it's
2324 // structured. Just validating whether it *can* be parsed as Terraform would be a big improvement.
2425 terraformVersionRe = regexp .MustCompile (`^\s*\bversion\s+=` )
26+
27+ // Matches the format "> [!INFO]". Deliberately using a broad pattern to catch formatting issues that can mess up
28+ // the renderer for the Registry website
29+ gfmAlertRegex = regexp .MustCompile (`^>(\s*)\[!(\w+)\](\s*)(.*)` )
2530)
2631
2732type coderResourceFrontmatter struct {
@@ -279,11 +284,6 @@ func aggregateCoderResourceReadmeFiles(resourceType string) ([]readme, error) {
279284 return allReadmeFiles , nil
280285}
281286
282- // Matches the format "> [!INFO]". Deliberately using a broad pattern to catch
283- // formatting issues that can mess up the renderer for the Registry website
284- var gfmAlertRegex = regexp .MustCompile (`^>(\s*)\[!(\w+)\](\s*)(.*)` )
285- var gfmAlertTypes = []string {"NOTE" , "IMPORTANT" , "CAUTION" , "WARNING" , "TIP" }
286-
287287func validateResourceGfmAlerts (readmeBody string ) []error {
288288 trimmed := strings .TrimSpace (readmeBody )
289289 if trimmed == "" {
0 commit comments