aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-01-13 17:54:17 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-01-13 18:04:55 +0800
commit54fcab20e30cdae23809deb371f120b5ba47d258 (patch)
tree22c70d9b509e14d08f44913db2066f60540df5dd /build
parenta2bc90d1d7ec796e51d8783a97558dfa4f2e7f45 (diff)
downloaddexon-54fcab20e30cdae23809deb371f120b5ba47d258.tar
dexon-54fcab20e30cdae23809deb371f120b5ba47d258.tar.gz
dexon-54fcab20e30cdae23809deb371f120b5ba47d258.tar.bz2
dexon-54fcab20e30cdae23809deb371f120b5ba47d258.tar.lz
dexon-54fcab20e30cdae23809deb371f120b5ba47d258.tar.xz
dexon-54fcab20e30cdae23809deb371f120b5ba47d258.tar.zst
dexon-54fcab20e30cdae23809deb371f120b5ba47d258.zip
appveyor, build: fix review requests
Diffstat (limited to 'build')
-rw-r--r--build/ci.go54
1 files changed, 30 insertions, 24 deletions
diff --git a/build/ci.go b/build/ci.go
index 152c86d1b..a3213e7c9 100644
--- a/build/ci.go
+++ b/build/ci.go
@@ -24,7 +24,7 @@ Usage: go run ci.go <command> <command flags/arguments>
Available commands are:
install [-arch architecture] [ packages... ] -- builds packages and executables
- test [ -coverage ] [ -vet ] [ -misspell] [ packages... ] -- runs the tests
+ test [ -coverage ] [ -vet ] [ -misspell ] [ packages... ] -- runs the tests
archive [-arch architecture] [ -type zip|tar ] [ -signer key-envvar ] [ -upload dest ] -- archives build artefacts
importkeys -- imports signing keys from env
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package
@@ -289,29 +289,7 @@ func doTest(cmdline []string) {
build.MustRun(goTool("vet", packages...))
}
if *misspell {
- // Ensure the spellchecker is available
- build.MustRun(goTool("get", "github.com/client9/misspell/cmd/misspell"))
-
- // Windows (AppVeyor) chokes on long argument lists, check packages individualy
- for _, pkg := range packages {
- // The spell checker doesn't work on packages, gather all .go files for it
- out, err := goTool("list", "-f", "{{.Dir}}{{range .GoFiles}}\n{{.}}{{end}}{{range .CgoFiles}}\n{{.}}{{end}}{{range .TestGoFiles}}\n{{.}}{{end}}", pkg).CombinedOutput()
- if err != nil {
- log.Fatalf("source file listing failed: %v\n%s", err, string(out))
- }
- // Retrieve the folder and assemble the source list
- lines := strings.Split(string(out), "\n")
- root := lines[0]
-
- sources := make([]string, 0, len(lines)-1)
- for _, line := range lines[1:] {
- if line = strings.TrimSpace(line); line != "" {
- sources = append(sources, filepath.Join(root, line))
- }
- }
- // Run the spell checker for this particular package
- build.MustRunCommand(filepath.Join(GOBIN, "misspell"), append([]string{"-error"}, sources...)...)
- }
+ spellcheck(packages)
}
// Run the actual tests.
gotest := goTool("test")
@@ -325,6 +303,34 @@ func doTest(cmdline []string) {
build.MustRun(gotest)
}
+// spellcheck runs the client9/misspell spellchecker package on all Go, Cgo and
+// test files in the requested packages.
+func spellcheck(packages []string) {
+ // Ensure the spellchecker is available
+ build.MustRun(goTool("get", "github.com/client9/misspell/cmd/misspell"))
+
+ // Windows chokes on long argument lists, check packages individualy
+ for _, pkg := range packages {
+ // The spell checker doesn't work on packages, gather all .go files for it
+ out, err := goTool("list", "-f", "{{.Dir}}{{range .GoFiles}}\n{{.}}{{end}}{{range .CgoFiles}}\n{{.}}{{end}}{{range .TestGoFiles}}\n{{.}}{{end}}", pkg).CombinedOutput()
+ if err != nil {
+ log.Fatalf("source file listing failed: %v\n%s", err, string(out))
+ }
+ // Retrieve the folder and assemble the source list
+ lines := strings.Split(string(out), "\n")
+ root := lines[0]
+
+ sources := make([]string, 0, len(lines)-1)
+ for _, line := range lines[1:] {
+ if line = strings.TrimSpace(line); line != "" {
+ sources = append(sources, filepath.Join(root, line))
+ }
+ }
+ // Run the spell checker for this particular package
+ build.MustRunCommand(filepath.Join(GOBIN, "misspell"), append([]string{"-error"}, sources...)...)
+ }
+}
+
// Release Packaging
func doArchive(cmdline []string) {