forked from go-co-op/gocron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add makefile * remove deprecated StartImmediately() * go test -race, remove race conditions * use make vet, test in actions
- Loading branch information
1 parent
f0a0fc2
commit caab14a
Showing
7 changed files
with
235 additions
and
114 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
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,33 @@ | ||
.PHONY: fmt check-fmt lint vet test | ||
|
||
GO_PKGS := $(shell go list -f {{.Dir}} ./...) | ||
|
||
fmt: | ||
@go list -f {{.Dir}} ./... | xargs -I{} gofmt -w -s {} | ||
|
||
check-fmt: | ||
@echo "Checking formatting..." | ||
@FMT="0"; \ | ||
for pkg in $(GO_PKGS); do \ | ||
OUTPUT=`gofmt -l $$pkg/*.go`; \ | ||
if [ -n "$$OUTPUT" ]; then \ | ||
echo "$$OUTPUT"; \ | ||
FMT="1"; \ | ||
fi; \ | ||
done ; \ | ||
if [ "$$FMT" -eq "1" ]; then \ | ||
echo "Problem with formatting in files above."; \ | ||
exit 1; \ | ||
else \ | ||
echo "Success - way to run gofmt!"; \ | ||
fi | ||
|
||
lint: | ||
# Add -set_exit_status=true when/if we want to enforce the linter rules | ||
@golint -min_confidence 0.8 -set_exit_status $(GO_PKGS) | ||
|
||
vet: | ||
@go vet $(GO_FLAGS) $(GO_PKGS) | ||
|
||
test: | ||
@go test -race $(GO_FLAGS) -count=1 $(GO_PKGS) |
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
Oops, something went wrong.