diff --git a/.golangci.yml b/.golangci.yml index 4e03a03..363296b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,10 +1,12 @@ run: + timeout: 2m tests: false skip-dirs: - ".*test.*" - ".*mock.*" - ".*generated.*" - ".*example.*" + - ".*utils.*" skip-files: - ".*Mock.*" - ".*_mock.*" @@ -16,6 +18,7 @@ output: linters: disable-all: true enable: + # Default - errcheck - gosimple - govet @@ -23,31 +26,30 @@ linters: - staticcheck - typecheck - unused + # Custom - errchkjson - errname - errorlint - execinquery + - forcetypeassert - gocritic - goerr113 - gofumpt + - gomodguard - gosec - importas - makezero - nilnil - prealloc + - reassign + # - rowserrcheck + - sqlclosecheck - unconvert + # - wastedassign fast: true linters-settings: - gosec: - excludes: - - G101 - - G112 - - G402 - - G404 - - G501 - - G505 - exclude-generated: true + # Default govet: check-shadowing: false disable-all: true @@ -67,9 +69,17 @@ linters-settings: - unmarshal - unreachable - unusedresult - staticcheck: - checks: ["all", "-SA1019"] + # Custom gocritic: + disabled-checks: + - ifElseChain + - singleCaseSwitch enabled-tags: + - diagnostic - style - performance + gosec: + exclude-generated: true + reassign: + patterns: + - ".*" diff --git a/Makefile b/Makefile index d6efa92..562da3b 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,10 @@ all: test-color lint go mod tidy + $(MAKE) test-color + $(MAKE) lint + $(MAKE) build + $(MAKE) clean test-color: go install github.com/haunt98/go-test-color@latest @@ -12,3 +16,10 @@ lint: try-4-real: go run . -race ./example/... + +build: + $(MAKE) clean + go build -o go-test-color . + +clean: + rm -f go-test-color