-
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.
feat: Updated build infrastructure (#36)
* chore: updated linter configuration in .golangci.yml * chore: added Makefile * * chore: add .golangci.yml to the list of files to trigger linting on push and pull request for .github/workflows/lint.yml * chore: added target tidy to Makefile to call 'go mod tidy' on all existing go.mod files * build: bumped version of go to 1.20 in all GitHub worklfows * build: update GitHub workflow definitions * bumped default version of golangci_version to 1.55.2 in all GitHub workflows * removed pull_request trigger from lint.yml workflow --------- Co-authored-by: Thomas Meckel <[email protected]>
- Loading branch information
Showing
5 changed files
with
93 additions
and
36 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
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,41 +1,68 @@ | ||
run: | ||
timeout: 60m | ||
tests: true | ||
|
||
output: | ||
print-issued-lines: false | ||
|
||
issues: | ||
max-per-linter: 0 | ||
max-same-issues: 0 | ||
exclude-rules: | ||
- linters: | ||
- unparam | ||
text: ".*\\(error\\) is always nil$" | ||
- linters: | ||
- revive | ||
text: "unused-parameter: parameter '[^']+' seems to be unused, consider removing or renaming it as _" | ||
linters: | ||
disable-all: true | ||
enable: | ||
- asciicheck | ||
- bidichk | ||
- errname | ||
- dupl | ||
- errcheck | ||
- errorlint | ||
- exhaustive | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- gofmt | ||
- gofumpt | ||
- goimports | ||
- gosimple | ||
- govet | ||
- gosec | ||
- ineffassign | ||
- loggercheck | ||
- misspell | ||
- nilnil | ||
- nolintlint | ||
- reassign | ||
- nilerr | ||
- paralleltest | ||
- revive | ||
- staticcheck | ||
- typecheck | ||
- unused | ||
- testifylint | ||
- unconvert | ||
- unparam | ||
- unused | ||
- vet | ||
- paralleltest | ||
- vetshadow | ||
- wastedassign | ||
|
||
linters-settings: | ||
vet: | ||
check-shadowing: true | ||
use-installed-packages: true | ||
goconst: | ||
min-len: 8 | ||
min-occurrences: 3 | ||
gocyclo: | ||
min-complexity: 20 | ||
gocritic: | ||
disabled-checks: | ||
- ifElseChain | ||
revive: | ||
rules: | ||
- name: exported | ||
disabled: true | ||
- name: package-comments | ||
disabled: true | ||
gofmt: | ||
rewrite-rules: | ||
- pattern: 'interface{}' | ||
replacement: 'any' | ||
- pattern: 'a[b:len(a)]' | ||
replacement: 'a[b:]' | ||
exhaustive: | ||
default-signifies-exhaustive: true | ||
|
||
issues: | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
exclude-use-default: false | ||
exclude: | ||
# Captured by errcheck. | ||
- "^(G104|G204):" | ||
# Very commonly not checked. | ||
- 'Error return value of .(.*\.Help|.*\.MarkFlagRequired|(os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*Print(f|ln|)|os\.(Un)?Setenv). is not checked' |
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,35 @@ | ||
.DEFAULT_GOAL := help | ||
|
||
ifneq (,$(wildcard ./.env)) | ||
include .env | ||
export | ||
endif | ||
|
||
TIMEOUT ?= 120m | ||
GOMAXPROCS ?= 5 | ||
TESTARGS ?= ./... | ||
|
||
build: ## Build provider | ||
go build cmd/azdo/azdo.go | ||
|
||
dist: ## create new release | ||
goreleaser release --clean --skip publish | ||
|
||
clean: ## Clean repositorty | ||
rm -f azdo | ||
rm -rf dist | ||
|
||
.PHONY: lint | ||
lint: ## lint source | ||
@echo "Check for golangci-lint"; [ -e "$(shell which golangci-lint)" ] | ||
@echo "Executing golangci-lint"; golangci-lint run -v --timeout $(TIMEOUT) | ||
|
||
.PHONY: help | ||
tidy: # call go mod tidy on all existing go.mod files | ||
find . -name go.mod -execdir go mod tidy \; | ||
|
||
.PHONY: help | ||
help: | ||
@grep '^[^#.][A-Za-z._/]\+:\s\+.*#' Makefile | \ | ||
sed "s/\(.\+\):\s*\(.*\) #\s*\(.*\)/`printf "\033[93m"`\1`printf "\033[0m"` \3 [\2]/" | \ | ||
expand -t30 |