From cb9670b6b37db1ca772edacd4c53386df8d7c34f Mon Sep 17 00:00:00 2001 From: Mike Rhodes Date: Mon, 5 Jun 2023 20:53:57 +0100 Subject: [PATCH] Use simpler golangci-lint configuration; enable defaults and gosec --- .golangci.yml | 49 +++---------------------------------------------- Makefile | 3 +++ 2 files changed, 6 insertions(+), 46 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index db0a678..38e0f35 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,59 +3,16 @@ run: timeout: 5m -output: - format: checkstyle - linters: - # please, do not use `enable-all`: it's deprecated and will be removed soon. - # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint disable-all: true enable: - # re-enable defaults - # - govet - # - errcheck - # - staticcheck - # - unused - # - gochecknoinits - # - gosimple - # - structcheck - # - varcheck - # - ineffassign - # - deadcode - # - typecheck - # - interfacer - # enable others - - bodyclose - - deadcode - - depguard - - dogsled - - dupl - - errcheck - - goconst - - gocritic - - gocyclo - - gofmt - - goimports - - golint - - gomnd - - goprintffuncname + # Add gosec - gosec + # Defaults per 1.52.2 + - errcheck - gosimple - govet - ineffassign - - nakedret - - nolintlint - - scopelint - staticcheck - - structcheck - typecheck - - unconvert - - unparam - unused - - varcheck - - whitespace - -linters-settings: - gofmt: - # VSCode uses goreturns by default which doesn't support -s/simplify - simplify: false diff --git a/Makefile b/Makefile index d76a765..aef55c4 100644 --- a/Makefile +++ b/Makefile @@ -10,3 +10,6 @@ build: test: go test ./... + +lint: + golangci-lint run