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
a2bc90d1
Unverified
Commit
a2bc90d1
authored
8 years ago
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: spellcheck individual packages (Windows path limits)
parent
c01f8c3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
ci.go
build/ci.go
+9
-7
No files found.
build/ci.go
View file @
a2bc90d1
...
...
@@ -289,27 +289,29 @@ func doTest(cmdline []string) {
build
.
MustRun
(
goTool
(
"vet"
,
packages
...
))
}
if
*
misspell
{
// The spell checker doesn't work on packages, gather all .go files for it
sources
:=
[]
string
{}
// 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
{
//
Gather all the source files of the package
//
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
...
)
...
)
}
// 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"
)
...
...
This diff is collapsed.
Click to expand it.
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