-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All the tools are defined in 'tools/' so they are vendored and installed in the 'bin/' dir which is ignored from git. This way we can keep same version for everyone. The 'go:generate' have been changed to use the 'bin/*' folder binaries instead of the genral ones defined on /home/xescugc/go/bin:/home/xescugc/.bin:/home/xescugc/go/bin:/home/xescugc/.bin:/home/xescugc/go/bin:/home/xescugc/.bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl, this way we make sure those are the ones used
- Loading branch information
Showing
8 changed files
with
111 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
TOOL_BIN := $(PWD)/bin | ||
|
||
GOLINT := $(TOOL_BIN)/golint | ||
GOIMPORTS := $(TOOL_BIN)/goimports | ||
ENUMER := $(TOOL_BIN)/enumer | ||
|
||
|
||
.PHONY: help | ||
help: Makefile ## This help dialog | ||
@IFS=$$'\n' ; \ | ||
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//'`); \ | ||
for help_line in $${help_lines[@]}; do \ | ||
IFS=$$'#' ; \ | ||
help_split=($$help_line) ; \ | ||
help_command=`echo $${help_split[0]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \ | ||
help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \ | ||
printf "%-30s %s\n" $$help_command $$help_info ; \ | ||
done | ||
|
||
$(ENUMER): | ||
@GOBIN=$(TOOL_BIN) go get github.com/dmarkham/enumer | ||
|
||
$(GOLINT): | ||
@GOBIN=$(TOOL_BIN) go get golang.org/x/lint/golint | ||
|
||
$(GOIMPORTS): | ||
@GOBIN=$(TOOL_BIN) go get golang.org/x/tools/cmd/goimports | ||
|
||
.PHONY: test | ||
test: ## Tests all the project | ||
@go test ./... | ||
|
||
.PHONY: lint | ||
lint: $(GOLINT) $(GOIMPORTS) ## Runs the linter | ||
@$(GOLINT) -set_exit_status ./... && test -z "`go list -f {{.Dir}} ./... | xargs $(GOIMPORTS) -l | tee /dev/stderr`" | ||
|
||
.PHONY: generate | ||
generate: $(ENUMER) ## Generates the needed code | ||
@go generate ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// +build tools | ||
|
||
package tools | ||
|
||
import ( | ||
_ "github.com/dmarkham/enumer" | ||
_ "golang.org/x/lint/golint" | ||
_ "golang.org/x/tools/cmd/goimports" | ||
) |