-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding golangci-lint.yml and updating GNUmakefile and test.yml (#135)
- Loading branch information
1 parent
f269837
commit 3f41ccd
Showing
5 changed files
with
75 additions
and
106 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,17 @@ | ||
linters: | ||
# Default linters enabled | ||
# See: https://golangci-lint.run/usage/linters/#enabled-by-default-linters | ||
|
||
# Additional linters enabled | ||
enable: | ||
- durationcheck | ||
- exportloopref | ||
- godot | ||
- gofmt | ||
- makezero | ||
- misspell | ||
- nilerr | ||
- predeclared | ||
- tenv | ||
- unconvert | ||
- unparam |
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 |
---|---|---|
@@ -1,44 +1,25 @@ | ||
TEST?=$$(go list ./...) | ||
GOFMT_FILES?=$$(find . -name '*.go') | ||
PKG_NAME=http | ||
|
||
default: build | ||
|
||
build: fmtcheck | ||
go install | ||
build: | ||
go build -v ./... | ||
|
||
test: fmtcheck | ||
go test -i $(TEST) || exit 1 | ||
echo $(TEST) | \ | ||
xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 | ||
install: build | ||
go install -v ./... | ||
|
||
testacc: fmtcheck | ||
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m | ||
# See https://golangci-lint.run/ | ||
lint: | ||
golangci-lint run | ||
|
||
vet: | ||
@echo "go vet ." | ||
@go vet $$(go list ./...) ; if [ $$? -eq 1 ]; then \ | ||
echo ""; \ | ||
echo "Vet found suspicious constructs. Please check the reported constructs"; \ | ||
echo "and fix them if necessary before submitting the code for review."; \ | ||
exit 1; \ | ||
fi | ||
generate: | ||
go generate ./... | ||
|
||
fmt: | ||
gofmt -w $(GOFMT_FILES) | ||
|
||
fmtcheck: | ||
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" | ||
gofmt -s -w -e . | ||
|
||
errcheck: | ||
@sh -c "'$(CURDIR)/scripts/errcheck.sh'" | ||
test: | ||
go test -v -cover -timeout=120s -parallel=4 ./... | ||
|
||
test-compile: | ||
@if [ "$(TEST)" = "./..." ]; then \ | ||
echo "ERROR: Set TEST to a specific package. For example,"; \ | ||
echo " make test-compile TEST=./$(PKG_NAME)"; \ | ||
exit 1; \ | ||
fi | ||
go test -c $(TEST) $(TESTARGS) | ||
testacc: | ||
TF_ACC=1 go test -v -cover -timeout 120m ./... | ||
|
||
.PHONY: build test testacc vet fmt fmtcheck errcheck test-compile | ||
.PHONY: build install lint generate fmt test testacc |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.