Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
e4181a7f
Unverified
Commit
e4181a7f
authored
Jan 13, 2017
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
travis, appveyor, build: add source spell checking
parent
c5df37c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
3 deletions
+26
-3
.travis.yml
.travis.yml
+1
-1
appveyor.yml
appveyor.yml
+1
-1
ci.go
build/ci.go
+24
-1
No files found.
.travis.yml
View file @
e4181a7f
...
...
@@ -90,7 +90,7 @@ install:
-
go get golang.org/x/tools/cmd/cover
script
:
-
go run build/ci.go install
-
go run build/ci.go test -coverage -vet
-
go run build/ci.go test -coverage -vet
-misspell
notifications
:
webhooks
:
...
...
appveyor.yml
View file @
e4181a7f
...
...
@@ -36,4 +36,4 @@ after_build:
test_script
:
-
set CGO_ENABLED=1
-
go run build\ci.go test -vet -coverage
-
go run build\ci.go test -vet -coverage
-misspell
build/ci.go
View file @
e4181a7f
...
...
@@ -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 ] [
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
...
...
@@ -262,6 +262,7 @@ func goToolArch(arch string, subcmd string, args ...string) *exec.Cmd {
func
doTest
(
cmdline
[]
string
)
{
var
(
vet
=
flag
.
Bool
(
"vet"
,
false
,
"Whether to run go vet"
)
misspell
=
flag
.
Bool
(
"misspell"
,
false
,
"Whether to run the spell checker"
)
coverage
=
flag
.
Bool
(
"coverage"
,
false
,
"Whether to record code coverage"
)
)
flag
.
CommandLine
.
Parse
(
cmdline
)
...
...
@@ -287,7 +288,29 @@ func doTest(cmdline []string) {
if
*
vet
{
build
.
MustRun
(
goTool
(
"vet"
,
packages
...
))
}
if
*
misspell
{
// The spell checker doesn't work on packages, gather all .go files for it
sources
:=
[]
string
{}
for
_
,
pkg
:=
range
packages
{
// Gather all the source files of the package
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
]
for
_
,
line
:=
range
lines
[
1
:
]
{
if
line
=
strings
.
TrimSpace
(
line
);
line
!=
""
{
sources
=
append
(
sources
,
filepath
.
Join
(
root
,
line
))
}
}
}
// Download the spell checker tool and run on all source files
build
.
MustRun
(
goTool
(
"get"
,
"github.com/client9/misspell/cmd/misspell"
))
build
.
MustRunCommand
(
filepath
.
Join
(
GOBIN
,
"misspell"
),
append
([]
string
{
"-error"
},
sources
...
)
...
)
}
// Run the actual tests.
gotest
:=
goTool
(
"test"
)
// Test a single package at a time. CI builders are slow
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment