From f87e35b5f878ebdab85f76ed1ef2fd31617598d6 Mon Sep 17 00:00:00 2001 From: Damian Date: Fri, 10 Nov 2023 17:03:30 +0000 Subject: [PATCH] add basic linting rules --- .golangci-lint.yaml | 24 ++++++++++++++++++++++++ Makefile | 8 ++++++++ 2 files changed, 32 insertions(+) create mode 100644 .golangci-lint.yaml create mode 100644 Makefile diff --git a/.golangci-lint.yaml b/.golangci-lint.yaml new file mode 100644 index 0000000..d15b8a4 --- /dev/null +++ b/.golangci-lint.yaml @@ -0,0 +1,24 @@ +linters: + enable: + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - unused + - cyclop + - dupword + - wsl + - varnamelen + - usestdlibvars + - unparam + - revive + - prealloc + - misspell + - gocyclo + - funlen + - bodyclose + +linters-settings: + cyclop: + max-complexity: 15 \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..331be44 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +lint: + gofumpt -l -w . + golangci-lint run + go mod tidy + +install-linters: + go install mvdan.cc/gofumpt@latest + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 \ No newline at end of file