File tree Expand file tree Collapse file tree 2 files changed +24
-20
lines changed
Expand file tree Collapse file tree 2 files changed +24
-20
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package main
33import (
44 "errors"
55 "fmt"
6+ "log"
67 "net/url"
78 "os"
89 "path"
@@ -371,3 +372,25 @@ func validateContributorRelativeUrls(contributors map[string]contributorProfile)
371372 errors : problems ,
372373 }
373374}
375+
376+ func validateAllContributors (errChan chan <- error ) {
377+ allReadmeFiles , err := aggregateContributorReadmeFiles ()
378+ if err != nil {
379+ errChan <- err
380+ return
381+ }
382+ log .Printf ("Processing %d README files\n " , len (allReadmeFiles ))
383+ contributors , err := parseContributorFiles (allReadmeFiles )
384+ log .Printf ("Processed %d README files as valid contributor profiles" , len (contributors ))
385+ if err != nil {
386+ errChan <- err
387+ return
388+ }
389+ err = validateContributorRelativeUrls (contributors )
390+ if err != nil {
391+ errChan <- err
392+ return
393+ }
394+ log .Println ("All relative URLs for READMEs are valid" )
395+ log .Printf ("Processed all READMEs in the %q directory\n " , rootRegistryPath )
396+ }
Original file line number Diff line number Diff line change @@ -87,26 +87,7 @@ func main() {
8787 wg .Add (1 )
8888 go func () {
8989 defer wg .Done ()
90-
91- allReadmeFiles , err := aggregateContributorReadmeFiles ()
92- if err != nil {
93- errChan <- err
94- return
95- }
96- log .Printf ("Processing %d README files\n " , len (allReadmeFiles ))
97- contributors , err := parseContributorFiles (allReadmeFiles )
98- log .Printf ("Processed %d README files as valid contributor profiles" , len (contributors ))
99- if err != nil {
100- errChan <- err
101- return
102- }
103- err = validateContributorRelativeUrls (contributors )
104- if err != nil {
105- errChan <- err
106- return
107- }
108- log .Println ("All relative URLs for READMEs are valid" )
109- log .Printf ("Processed all READMEs in the %q directory\n " , rootRegistryPath )
90+ validateAllContributors (errChan )
11091 }()
11192
11293 // Validate modules
You can’t perform that action at this time.
0 commit comments