Skip to content

Commit 9fd7eb4

Browse files
committed
give validation phases more obvious name prefixes
Signed-off-by: Callum Styan <[email protected]>
1 parent 94f0cb0 commit 9fd7eb4

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

cmd/readmevalidation/coderresources.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ func parseCoderResourceReadmeFiles(resourceType string, rms []readme) (map[strin
247247
}
248248
if len(yamlParsingErrs) != 0 {
249249
return nil, validationPhaseError{
250-
phase: readmeParsing,
250+
phase: validationPhaseReadme,
251251
errors: yamlParsingErrs,
252252
}
253253
}
@@ -261,7 +261,7 @@ func parseCoderResourceReadmeFiles(resourceType string, rms []readme) (map[strin
261261
}
262262
if len(yamlValidationErrors) != 0 {
263263
return nil, validationPhaseError{
264-
phase: readmeParsing,
264+
phase: validationPhaseReadme,
265265
errors: yamlValidationErrors,
266266
}
267267
}
@@ -319,7 +319,7 @@ func aggregateCoderResourceReadmeFiles(resourceType string) ([]readme, error) {
319319

320320
if len(errs) != 0 {
321321
return nil, validationPhaseError{
322-
phase: fileLoad,
322+
phase: validationPhaseFile,
323323
errors: errs,
324324
}
325325
}

cmd/readmevalidation/contributors.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func parseContributorFiles(readmeEntries []readme) (map[string]contributorProfil
206206
}
207207
if len(yamlParsingErrors) != 0 {
208208
return nil, validationPhaseError{
209-
phase: readmeParsing,
209+
phase: validationPhaseReadme,
210210
errors: yamlParsingErrors,
211211
}
212212
}
@@ -220,7 +220,7 @@ func parseContributorFiles(readmeEntries []readme) (map[string]contributorProfil
220220
}
221221
if len(yamlValidationErrors) != 0 {
222222
return nil, validationPhaseError{
223-
phase: readmeParsing,
223+
phase: validationPhaseReadme,
224224
errors: yamlValidationErrors,
225225
}
226226
}
@@ -258,7 +258,7 @@ func aggregateContributorReadmeFiles() ([]readme, error) {
258258

259259
if len(errs) != 0 {
260260
return nil, validationPhaseError{
261-
phase: fileLoad,
261+
phase: validationPhaseFile,
262262
errors: errs,
263263
}
264264
}
@@ -299,7 +299,7 @@ func validateContributorRelativeURLs(contributors map[string]contributorProfileR
299299
return nil
300300
}
301301
return validationPhaseError{
302-
phase: assetCrossReference,
302+
phase: validationPhaseCrossReference,
303303
errors: errs,
304304
}
305305
}

cmd/readmevalidation/readmefiles.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ const (
1616
rootRegistryPath = "./registry"
1717

1818
// --- validationPhases ---
19-
// fileStructureValidation indicates when the entire Registry
19+
// validationPhaseStructure indicates when the entire Registry
2020
// directory is being verified for having all files be placed in the file
2121
// system as expected.
22-
fileStructureValidation validationPhase = "File structure validation"
22+
validationPhaseStructure validationPhase = "File structure validation"
2323

24-
// FileLoad indicates when README files are being read from
24+
// validationPhaseFile indicates when README files are being read from
2525
// the file system.
26-
fileLoad validationPhase = "Filesystem reading"
26+
validationPhaseFile validationPhase = "Filesystem reading"
2727

28-
// ReadmeParsing indicates when a README's frontmatter is
28+
// validationPhaseReadme indicates when a README's frontmatter is
2929
// being parsed as YAML. This phase does not include YAML validation.
30-
readmeParsing validationPhase = "README parsing"
30+
validationPhaseReadme validationPhase = "README parsing"
3131

32-
// AssetCrossReference indicates when a README's frontmatter
32+
// validationPhaseCrossReference indicates when a README's frontmatter
3333
// is having all its relative URLs be validated for whether they point to
3434
// valid resources.
35-
assetCrossReference validationPhase = "Cross-referencing relative asset URLs"
35+
validationPhaseCrossReference validationPhase = "Cross-referencing relative asset URLs"
3636
// --- end of validationPhases ---.
3737
)
3838

cmd/readmevalidation/repostructure.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func validateRepoStructure() error {
128128

129129
if len(errs) != 0 {
130130
return validationPhaseError{
131-
phase: fileStructureValidation,
131+
phase: validationPhaseStructure,
132132
errors: errs,
133133
}
134134
}

0 commit comments

Comments
 (0)