@@ -151,45 +151,28 @@ func validateReadmeBody(body string) []error {
151151// validationPhase represents a specific phase during README validation. It is
152152// expected that each phase is discrete, and errors during one will prevent a
153153// future phase from starting.
154- type validationPhase int
154+ type validationPhase string
155155
156156const (
157157 // validationPhaseFileStructureValidation indicates when the entire Registry
158158 // directory is being verified for having all files be placed in the file
159159 // system as expected.
160- validationPhaseFileStructureValidation validationPhase = iota
160+ validationPhaseFileStructureValidation validationPhase = "File structure validation"
161161
162162 // validationPhaseFileLoad indicates when README files are being read from
163163 // the file system
164- validationPhaseFileLoad
164+ validationPhaseFileLoad = "Filesystem reading"
165165
166166 // validationPhaseReadmeParsing indicates when a README's frontmatter is
167167 // being parsed as YAML. This phase does not include YAML validation.
168- validationPhaseReadmeParsing
168+ validationPhaseReadmeParsing = "README parsing"
169169
170170 // validationPhaseReadmeValidation indicates when a README's frontmatter is
171171 // being validated as proper YAML with expected keys.
172- validationPhaseReadmeValidation
172+ validationPhaseReadmeValidation = "README validation"
173173
174174 // validationPhaseAssetCrossReference indicates when a README's frontmatter
175175 // is having all its relative URLs be validated for whether they point to
176176 // valid resources.
177- validationPhaseAssetCrossReference
177+ validationPhaseAssetCrossReference = "Cross-referencing relative asset URLs"
178178)
179-
180- func (p validationPhase ) String () string {
181- switch p {
182- case validationPhaseFileStructureValidation :
183- return "File structure validation"
184- case validationPhaseFileLoad :
185- return "Filesystem reading"
186- case validationPhaseReadmeParsing :
187- return "README parsing"
188- case validationPhaseReadmeValidation :
189- return "README validation"
190- case validationPhaseAssetCrossReference :
191- return "Cross-referencing relative asset URLs"
192- default :
193- return fmt .Sprintf ("Unknown validation phase: %d" , p )
194- }
195- }
0 commit comments