-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up Makefile recipes and CI workflow
Fix previous commit based on review feedback
- Loading branch information
Showing
3 changed files
with
13 additions
and
7 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 |
---|---|---|
|
@@ -23,3 +23,6 @@ deps/ | |
go.work | ||
|
||
.idea | ||
|
||
# Default build artifact | ||
smcli |
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 |
---|---|---|
|
@@ -101,7 +101,7 @@ $(DOWNLOAD_DEST): | |
curl -sSfL $(DEPLOC)/v$(DEPTAG)/$(FN) -o $(DOWNLOAD_DEST) | ||
|
||
.PHONY: install | ||
install: $(UNZIP_DEST) | ||
install: | ||
go mod download | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.52.0 | ||
go install gotest.tools/[email protected] | ||
|
@@ -128,37 +128,37 @@ test: $(UNZIP_DEST) | |
go test -v -count 1 -ldflags "-extldflags \"$(STATICLDFLAGS)\"" ./... | ||
|
||
.PHONY: test-tidy | ||
test-tidy: install | ||
test-tidy: | ||
# Working directory must be clean, or this test would be destructive | ||
git diff --quiet || (echo "\033[0;31mWorking directory not clean!\033[0m" && git --no-pager diff && exit 1) | ||
# We expect `go mod tidy` not to change anything, the test should fail otherwise | ||
make tidy | ||
git diff --exit-code || (git --no-pager diff && git checkout . && exit 1) | ||
|
||
.PHONY: test-fmt | ||
test-fmt: install | ||
test-fmt: | ||
git diff --quiet || (echo "\033[0;31mWorking directory not clean!\033[0m" && git --no-pager diff && exit 1) | ||
# We expect `go fmt` not to change anything, the test should fail otherwise | ||
go fmt ./... | ||
git diff --exit-code || (git --no-pager diff && git checkout . && exit 1) | ||
|
||
.PHONY: lint | ||
lint: install | ||
lint: | ||
CGO_CFLAGS="-I$(REAL_DEST)" \ | ||
CGO_LDFLAGS="-L$(REAL_DEST)" \ | ||
LD_LIBRARY_PATH=$(REAL_DEST) \ | ||
./bin/golangci-lint run --config .golangci.yml | ||
|
||
# Auto-fixes golangci-lint issues where possible. | ||
.PHONY: lint-fix | ||
lint-fix: install | ||
lint-fix: | ||
CGO_CFLAGS="-I$(REAL_DEST)" \ | ||
CGO_LDFLAGS="-L$(REAL_DEST)" \ | ||
LD_LIBRARY_PATH=$(REAL_DEST) \ | ||
./bin/golangci-lint run --config .golangci.yml --fix | ||
|
||
.PHONY: lint-github-action | ||
lint-github-action: install | ||
lint-github-action: | ||
CGO_CFLAGS="-I$(REAL_DEST)" \ | ||
CGO_LDFLAGS="-L$(REAL_DEST)" \ | ||
LD_LIBRARY_PATH=$(REAL_DEST) \ | ||
|