-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go: bumped to v1.20 & upgraded all deps
- Loading branch information
1 parent
e84fec5
commit b564393
Showing
11 changed files
with
109 additions
and
197 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 |
---|---|---|
|
@@ -24,7 +24,7 @@ trap cleanup EXIT | |
# Build the binaries using a prerelease tag | ||
git tag -d edge | ||
git tag -f ${PRERELEASE_TAG} | ||
goreleaser release \ | ||
go run github.com/goreleaser/[email protected] release \ | ||
--rm-dist \ | ||
--skip-validate \ | ||
-f .goreleaser.pre.yml | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
linters: | ||
enable: | ||
- gci | ||
- gofmt | ||
- goimports | ||
- gosec | ||
- loggercheck | ||
- misspell | ||
- nilerr | ||
- nilnil | ||
- noctx | ||
- unparam | ||
|
||
linters-settings: | ||
gci: | ||
sections: | ||
- standard | ||
- default | ||
- prefix(github.com/mvisonneau) |
This file was deleted.
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
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 |
---|---|---|
@@ -1,24 +1,26 @@ | ||
NAME := vac | ||
FILES := $(shell git ls-files */*.go) | ||
COVERAGE_FILE := coverage.out | ||
REPOSITORY := mvisonneau/$(NAME) | ||
.DEFAULT_GOAL := help | ||
|
||
.PHONY: setup | ||
setup: ## Install required libraries/tools for build tasks | ||
@command -v gofumpt 2>&1 >/dev/null || go install mvdan.cc/[email protected] | ||
@command -v golangci-lint 2>&1 >/dev/null || go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
|
||
.PHONY: fmt | ||
fmt: setup ## Format source code | ||
gofumpt -w $(FILES) | ||
fmt: ## Format source code | ||
go run mvdan.cc/[email protected] -w $(shell git ls-files **/*.go) | ||
go run github.com/daixiang0/[email protected] write -s standard -s default -s "prefix(github.com/mvisonneau)" . | ||
|
||
.PHONY: lint | ||
lint: setup ## Run all lint related tests upon the codebase | ||
golangci-lint run -v --fast | ||
lint: ## Run all lint related tests upon the codebase | ||
go run github.com/golangci/golangci-lint/cmd/[email protected] run -v --fast | ||
|
||
.PHONY: test | ||
test: ## Run the tests against the codebase | ||
go test -v -count=1 -race ./... | ||
@rm -rf $(COVERAGE_FILE) | ||
go test -v -count=1 -race ./... -coverprofile=$(COVERAGE_FILE) | ||
@go tool cover -func $(COVERAGE_FILE) | awk '/^total/ {print "coverage: " $$3}' | ||
|
||
.PHONY: coverage | ||
coverage: ## Prints coverage report | ||
go tool cover -func $(COVERAGE_FILE) | ||
|
||
.PHONY: install | ||
install: ## Build and install locally the binary (dev purpose) | ||
|
@@ -28,11 +30,6 @@ install: ## Build and install locally the binary (dev purpose) | |
build: ## Build the binaries using local GOOS | ||
go build ./cmd/$(NAME) | ||
|
||
.PHONY: release | ||
release: ## Build & release the binaries (stable) | ||
git tag -d edge | ||
goreleaser release --rm-dist | ||
|
||
.PHONY: prerelease | ||
prerelease: setup ## Build & prerelease the binaries (edge) | ||
@\ | ||
|
@@ -45,28 +42,6 @@ prerelease: setup ## Build & prerelease the binaries (edge) | |
clean: ## Remove binary if it exists | ||
rm -f $(NAME) | ||
|
||
.PHONY: coverage | ||
coverage: ## Generates coverage report | ||
rm -rf *.out | ||
go test -count=1 -race -v ./... -coverpkg=./... -coverprofile=coverage.out | ||
|
||
.PHONY: coverage-html | ||
coverage-html: ## Generates coverage report and displays it in the browser | ||
go tool cover -html=coverage.out | ||
|
||
.PHONY: dev-env | ||
dev-env: ## Build a local development environment using Docker | ||
@docker run -it --rm \ | ||
-v $(shell pwd):/go/src/github.com/mvisonneau/$(NAME) \ | ||
-w /go/src/github.com/mvisonneau/$(NAME) \ | ||
golang:1.19 \ | ||
/bin/bash -c 'make setup; make install; bash' | ||
|
||
.PHONY: is-git-dirty | ||
is-git-dirty: ## Tests if git is in a dirty state | ||
@git status --porcelain | ||
@test $(shell git status --porcelain | grep -c .) -eq 0 | ||
|
||
.PHONY: all | ||
all: lint test build coverage ## Test, builds and ship package for all supported platforms | ||
|
||
|
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.