Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-shell
Commits
5fd923bd
Commit
5fd923bd
authored
May 03, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check go formatting in CI
parent
e3dc9c76
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
.gitlab-ci.yml
.gitlab-ci.yml
+1
-0
support/go-format
support/go-format
+16
-0
No files found.
.gitlab-ci.yml
View file @
5fd923bd
...
...
@@ -52,3 +52,4 @@ go:
-
which go
-
bin/compile
-
support/go-test
-
support/go-format check
support/go-format
0 → 100755
View file @
5fd923bd
#!/usr/bin/env ruby
def
main
(
check
)
go_files
=
Dir
[
'go/**/*.go'
].
reject
{
|
p
|
p
.
start_with?
(
'go/vendor/'
)
}
cmd
=
%w[gofmt -s -l]
cmd
<<
'-w'
unless
check
cmd
+=
go_files
output
=
IO
.
popen
(
cmd
,
'r'
)
{
|
io
|
io
.
read
}
$stdout
.
write
(
output
)
abort
'gofmt failed'
unless
$?
.
success?
if
check
&&
output
.
lines
.
any?
{
|
l
|
l
!=
"
\n
"
}
abort
"
\n
Please run
#{
$0
}
to fix formatting"
end
end
main
(
ARGV
.
first
==
'check'
)
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