diff --git a/.errcheck.txt b/.errcheck.txt new file mode 100644 index 0000000..086d571 --- /dev/null +++ b/.errcheck.txt @@ -0,0 +1,7 @@ +(*github.com/tektoncd/pipeline/vendor/go.uber.org/zap.SugaredLogger).Sync +flag.Set +logger.Sync +fmt.Fprintf +fmt.Fprintln +(io.Closer).Close +updateConfigMap diff --git a/.golangci.yml b/.golangci.yml index 2714f0c..5802fe6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,57 +1,115 @@ run: skip-dirs: - - vendor - tint + - vendor linters-settings: gocritic: disabled-checks: - unlambda + errcheck: + exclude: .errcheck.txt + gofumpt: + extra-rules: true linters: enable: + - asasalint - asciicheck - # - bodyclose - # - depguard + - bidichk + - bodyclose + #- containedctx + #- contextcheck + #- cyclop + - decorder + #- depguard - dogsled + - dupl + - dupword - durationcheck + - errcheck + - errchkjson + - errname + - errorlint + - execinquery - exhaustive - # - exhaustivestruct + #- exhaustruct - exportloopref - forbidigo - forcetypeassert + #- funlen + #- gci + - ginkgolinter + - gocheckcompilerdirectives + #- gochecknoglobals - gochecknoinits - - dupl - - errcheck - - errorlint + - gochecksumtype + #- gocognit + #- goconst + - gocritic + #- gocyclo + - godot + #- godox + #- goerr113 + #- gofmt - gofumpt + - goheader - goimports + #- gomnd + #- gomoddirectives + - gomodguard + - goprintffuncname - gosec - - gocritic - - misspell - - gosec + # - gosimple + - gosmopolitan - govet + - grouper - importas + #- inamedparam + #- interfacebloat + #- ireturn + #- lll + - loggercheck + #- maintidx - makezero + - mirror + - misspell + #- musttag - nakedret + #- nestif + - nilerr + #- nilnil + #- nlreturn + - noctx + #- nolintlint + #- nonamedreturns + - nosprintfhostport + #- paralleltest + #- perfsprint + - prealloc - predeclared + - promlinter + - protogetter + - reassign - revive + #- rowserrcheck + - sloglint + #- sqlclosecheck + # - staticcheck - stylecheck - # - unparam - - gochecknoinits - # - goconst - # - gocyclo - # - goerr113 - - gofmt - - goheader - - gomodguard - - goprintffuncname - # - nilerr - # - noctx - - nolintlint - - prealloc - - promlinter - # - rowserrcheck - # - sqlclosecheck - # - tparallel + - tagalign + #- tagliatelle + - tenv + - testableexamples + - testifylint + #- testpackage + #- thelper + - tparallel #- unconvert - # - wastedassign + - unparam + # - unused + - usestdlibvars + #- varnamelen + #- wastedassign - whitespace + #- wrapcheck + #- wsl + - zerologlint diff --git a/.markdownlint.json b/.markdownlint.json index 509914b..8bf9aab 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -1,7 +1,7 @@ { - "line-length": false, - "first-header-h1": false, - "no-inline-html": false, - "MD013": false, - "MD025": false + "line-length": false, + "first-header-h1": false, + "no-inline-html": false, + "MD013": false, + "MD025": false } diff --git a/Makefile b/Makefile index 8e9821d..7ebcba3 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ NAME := gosmee TARGET_URL ?= http://localhost:8080 SMEE_URL ?= https://smee.io/new IMAGE_VERSION ?= latest -MD_FILES := $(shell find . -type f -regex ".*md" -not -regex '^./vendor/.*' -not -regex '^./.vale/.*' -not -regex "^./.git/.*" -print) +MD_FILES := $(shell find . -type f -regex ".*md" -not -regex '^./vendor/.*' -not -regex '^./tint/.*' -not -regex '^./.vale/.*' -not -regex "^./.git/.*" -print) LDFLAGS := -s -w FLAGS += -ldflags "$(LDFLAGS)" -buildvcs=true diff --git a/gosmee/random.go b/gosmee/random.go index 47521b9..3f732d0 100644 --- a/gosmee/random.go +++ b/gosmee/random.go @@ -28,7 +28,7 @@ func randomString(length int) string { return string(result) } -// secureRandomBytes returns the requested number of bytes using crypto/rand +// secureRandomBytes returns the requested number of bytes using crypto/rand. func secureRandomBytes(length int) []byte { randomBytes := make([]byte, length) _, _ = rand.Read(randomBytes)