refactor: split up package boundaries
This commit is contained in:
parent
bdf9c5f51b
commit
39b264a7f9
@ -1,15 +1,9 @@
|
|||||||
// This package is for validating all contributors within the main Registry
|
|
||||||
// directory. It validates that it has nothing but sub-directories, and that
|
|
||||||
// each sub-directory has a README.md file. Each of those files must then
|
|
||||||
// describe a specific contributor. The contents of these files will be parsed
|
|
||||||
// by the Registry site build step, to be displayed in the Registry site's UI.
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@ -449,32 +443,3 @@ func validateRelativeUrls(
|
|||||||
errors: problems,
|
errors: problems,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
|
||||||
log.Println("Starting README validation")
|
|
||||||
allReadmeFiles, err := aggregateContributorReadmeFiles()
|
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Printf("Processing %d README files\n", len(allReadmeFiles))
|
|
||||||
contributors, err := parseContributorFiles(allReadmeFiles)
|
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
log.Printf(
|
|
||||||
"Processed %d README files as valid contributor profiles",
|
|
||||||
len(contributors),
|
|
||||||
)
|
|
||||||
|
|
||||||
err = validateRelativeUrls(contributors)
|
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
log.Println("All relative URLs for READMEs are valid")
|
|
||||||
|
|
||||||
log.Printf(
|
|
||||||
"Processed all READMEs in the %q directory\n",
|
|
||||||
rootRegistryPath,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
39
scripts/contributors/main.go
Normal file
39
scripts/contributors/main.go
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
// This package is for validating all contributors within the main Registry
|
||||||
|
// directory. It validates that it has nothing but sub-directories, and that
|
||||||
|
// each sub-directory has a README.md file. Each of those files must then
|
||||||
|
// describe a specific contributor. The contents of these files will be parsed
|
||||||
|
// by the Registry site build step, to be displayed in the Registry site's UI.
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
log.Println("Starting README validation")
|
||||||
|
allReadmeFiles, err := aggregateContributorReadmeFiles()
|
||||||
|
if err != nil {
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Printf("Processing %d README files\n", len(allReadmeFiles))
|
||||||
|
contributors, err := parseContributorFiles(allReadmeFiles)
|
||||||
|
log.Printf(
|
||||||
|
"Processed %d README files as valid contributor profiles",
|
||||||
|
len(contributors),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = validateRelativeUrls(contributors)
|
||||||
|
if err != nil {
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
log.Println("All relative URLs for READMEs are valid")
|
||||||
|
|
||||||
|
log.Printf(
|
||||||
|
"Processed all READMEs in the %q directory\n",
|
||||||
|
rootRegistryPath,
|
||||||
|
)
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user