Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: error out if go files aren't correctly formatted #1064

Merged
merged 1 commit into from Sep 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -51,7 +51,7 @@ vet:
@go vet $(shell go list ./... | grep -v '/vendor/')

fmt:
@go fmt $(shell go list ./... | grep -v '/vendor/')
@./scripts/gofmt $(shell go list ./... | grep -v '/vendor/')

lint:
@for package in $(shell go list ./... | grep -v '/vendor/' | grep -v '/api' | grep -v '/server/internal'); do \
Expand Down
6 changes: 3 additions & 3 deletions connector/github/github.go
Expand Up @@ -503,13 +503,13 @@ func (c *githubConnector) userEmail(ctx context.Context, client *http.Client) (s
advised them not to check for verified emails
(https://circleci.com/enterprise/changelog/#1-47-1).
In addition, GitHub Enterprise support replied to a support
ticket with "There is no way to verify an email address in
GitHub Enterprise."
ticket with "There is no way to verify an email address in
GitHub Enterprise."
*/
if c.hostName != "" {
email.Verified = true
}

if email.Verified && email.Primary {
return email.Email, nil
}
Expand Down
7 changes: 7 additions & 0 deletions scripts/gofmt
@@ -0,0 +1,7 @@
#!/bin/bash -e

result=$( go fmt $@ )
if [[ $result != "" ]]; then
>&2 echo "The following files are not formatted correctly: $result"
exit 1
fi