Skip to content

Commit

Permalink
Use simpler golangci-lint configuration; enable defaults and gosec
Browse files Browse the repository at this point in the history
  • Loading branch information
mikerhodes committed Jun 5, 2023
1 parent 0f90f1e commit cb9670b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 46 deletions.
49 changes: 3 additions & 46 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ build:

test:
go test ./...

lint:
golangci-lint run

0 comments on commit cb9670b

Please sign in to comment.