diff --git a/.gitignore b/.gitignore index c81da31d..e50cdd58 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,8 @@ _testmain.go *.prof .idea +.vscode +bin .DS_Store coverage.txt diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..c78c12f4 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,58 @@ +run: + modules-download-mode: readonly + issues-exit-code: 0 + timeout: 5m + +linters: + enable-all: true + disable: + # TODO: enable one by one + - goconst + - nilerr + - maintidx + - whitespace + - prealloc + - godox + - gocyclo + - ifshort + - wastedassign + - gofumpt + - lll + - nestif + - errchkjson + - exportloopref + - errorlint + - gosimple + - tenv + - ineffassign + - gocritic + - gocognit + - ireturn + - forbidigo + - containedctx + - tagliatelle + - cyclop + - errcheck + - exhaustivestruct + - forcetypeassert + - funlen + - gochecknoglobals + - gochecknoinits + - goerr113 + - godot + - gomnd + - gosec + - revive + - varnamelen + - wrapcheck + - noctx + - staticcheck + - stylecheck + - paralleltest + - golint + - interfacer + - maligned + - nlreturn + - scopelint + - testpackage + - wsl diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..cce62733 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +linter: + ./bin/golangci-lint run ./... +.PHONY: linter + +linter.download: + curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh +.PHONY: linter.download + +test: + env CGO_ENABLED=1 go test -race ./... +.PHONY: test + +alltest: linter test +.PHONY: alltest