@@ -29,7 +29,7 @@ type contributorProfileFrontmatter struct {
2929 ContributorStatus * string `yaml:"status"`
3030}
3131
32- type contributorProfile struct {
32+ type contributorProfileReadme struct {
3333 frontmatter contributorProfileFrontmatter
3434 filePath string
3535}
@@ -192,57 +192,57 @@ func validateContributorAvatarURL(avatarURL *string) []error {
192192 return errs
193193}
194194
195- func validateContributorYaml ( yml contributorProfile ) []error {
195+ func validateContributorReadme ( rm contributorProfileReadme ) []error {
196196 allErrs := []error {}
197197
198- if err := validateContributorGithubUsername (yml .frontmatter .GithubUsername ); err != nil {
199- allErrs = append (allErrs , addFilePathToError (yml .filePath , err ))
198+ if err := validateContributorGithubUsername (rm .frontmatter .GithubUsername ); err != nil {
199+ allErrs = append (allErrs , addFilePathToError (rm .filePath , err ))
200200 }
201- if err := validateContributorDisplayName (yml .frontmatter .DisplayName ); err != nil {
202- allErrs = append (allErrs , addFilePathToError (yml .filePath , err ))
201+ if err := validateContributorDisplayName (rm .frontmatter .DisplayName ); err != nil {
202+ allErrs = append (allErrs , addFilePathToError (rm .filePath , err ))
203203 }
204- if err := validateContributorLinkedinURL (yml .frontmatter .LinkedinURL ); err != nil {
205- allErrs = append (allErrs , addFilePathToError (yml .filePath , err ))
204+ if err := validateContributorLinkedinURL (rm .frontmatter .LinkedinURL ); err != nil {
205+ allErrs = append (allErrs , addFilePathToError (rm .filePath , err ))
206206 }
207- if err := validateContributorWebsite (yml .frontmatter .WebsiteURL ); err != nil {
208- allErrs = append (allErrs , addFilePathToError (yml .filePath , err ))
207+ if err := validateContributorWebsite (rm .frontmatter .WebsiteURL ); err != nil {
208+ allErrs = append (allErrs , addFilePathToError (rm .filePath , err ))
209209 }
210- if err := validateContributorStatus (yml .frontmatter .ContributorStatus ); err != nil {
211- allErrs = append (allErrs , addFilePathToError (yml .filePath , err ))
210+ if err := validateContributorStatus (rm .frontmatter .ContributorStatus ); err != nil {
211+ allErrs = append (allErrs , addFilePathToError (rm .filePath , err ))
212212 }
213213
214- for _ , err := range validateContributorEmployerGithubUsername (yml .frontmatter .EmployerGithubUsername , yml .frontmatter .GithubUsername ) {
215- allErrs = append (allErrs , addFilePathToError (yml .filePath , err ))
214+ for _ , err := range validateContributorEmployerGithubUsername (rm .frontmatter .EmployerGithubUsername , rm .frontmatter .GithubUsername ) {
215+ allErrs = append (allErrs , addFilePathToError (rm .filePath , err ))
216216 }
217- for _ , err := range validateContributorSupportEmail (yml .frontmatter .SupportEmail ) {
218- allErrs = append (allErrs , addFilePathToError (yml .filePath , err ))
217+ for _ , err := range validateContributorSupportEmail (rm .frontmatter .SupportEmail ) {
218+ allErrs = append (allErrs , addFilePathToError (rm .filePath , err ))
219219 }
220- for _ , err := range validateContributorAvatarURL (yml .frontmatter .AvatarURL ) {
221- allErrs = append (allErrs , addFilePathToError (yml .filePath , err ))
220+ for _ , err := range validateContributorAvatarURL (rm .frontmatter .AvatarURL ) {
221+ allErrs = append (allErrs , addFilePathToError (rm .filePath , err ))
222222 }
223223
224224 return allErrs
225225}
226226
227- func parseContributorProfile (rm readme ) (contributorProfile , error ) {
227+ func parseContributorProfile (rm readme ) (contributorProfileReadme , error ) {
228228 fm , _ , err := separateFrontmatter (rm .rawText )
229229 if err != nil {
230- return contributorProfile {}, fmt .Errorf ("%q: failed to parse frontmatter: %v" , rm .filePath , err )
230+ return contributorProfileReadme {}, fmt .Errorf ("%q: failed to parse frontmatter: %v" , rm .filePath , err )
231231 }
232232
233233 yml := contributorProfileFrontmatter {}
234234 if err := yaml .Unmarshal ([]byte (fm ), & yml ); err != nil {
235- return contributorProfile {}, fmt .Errorf ("%q: failed to parse: %v" , rm .filePath , err )
235+ return contributorProfileReadme {}, fmt .Errorf ("%q: failed to parse: %v" , rm .filePath , err )
236236 }
237237
238- return contributorProfile {
238+ return contributorProfileReadme {
239239 filePath : rm .filePath ,
240240 frontmatter : yml ,
241241 }, nil
242242}
243243
244- func parseContributorFiles (readmeEntries []readme ) (map [string ]contributorProfile , error ) {
245- profilesByUsername := map [string ]contributorProfile {}
244+ func parseContributorFiles (readmeEntries []readme ) (map [string ]contributorProfileReadme , error ) {
245+ profilesByUsername := map [string ]contributorProfileReadme {}
246246 yamlParsingErrors := []error {}
247247 for _ , rm := range readmeEntries {
248248 p , err := parseContributorProfile (rm )
@@ -267,7 +267,7 @@ func parseContributorFiles(readmeEntries []readme) (map[string]contributorProfil
267267 employeeGithubGroups := map [string ][]string {}
268268 yamlValidationErrors := []error {}
269269 for _ , p := range profilesByUsername {
270- errors := validateContributorYaml (p )
270+ errors := validateContributorReadme (p )
271271 if len (errors ) > 0 {
272272 yamlValidationErrors = append (yamlValidationErrors , errors ... )
273273 continue
@@ -332,7 +332,7 @@ func aggregateContributorReadmeFiles() ([]readme, error) {
332332 return allReadmeFiles , nil
333333}
334334
335- func validateContributorRelativeUrls (contributors map [string ]contributorProfile ) error {
335+ func validateContributorRelativeUrls (contributors map [string ]contributorProfileReadme ) error {
336336 // This function only validates relative avatar URLs for now, but it can be
337337 // beefed up to validate more in the future
338338 errs := []error {}
0 commit comments