summaryrefslogtreecommitdiff
path: root/.golangci.yml
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-29 02:15:13 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-29 02:15:13 -0700
commit0b57145421e7e4f165f64e73ee7c5d8102945569 (patch)
tree25584309e42bb53469959a3725393bdbc8b225c7 /.golangci.yml
parentffee5c8516f3f55f82ed5bb8f0a4f340d485fa92 (diff)
parent7e00adcf43b18a22ffbbadc79b8681a5d871f448 (diff)
Merge branch 'lukeshu/quality'
This branch works to improve code quality, without making any substantive changes.
Diffstat (limited to '.golangci.yml')
-rw-r--r--.golangci.yml90
1 files changed, 84 insertions, 6 deletions
diff --git a/.golangci.yml b/.golangci.yml
index fb78da2..866c5a4 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -1,16 +1,94 @@
-# Copyright (C) 2022 Luke Shumaker <lukeshu@lukeshu.com>
+# Copyright (C) 2022-2023 Luke Shumaker <lukeshu@lukeshu.com>
#
# SPDX-License-Identifier: GPL-2.0-or-later
linters:
+ enable-all: true
disable:
- - structcheck # doesn't support Go 1.18 yet
- enable:
- - gofmt
+ # Deprecated
+ - deadcode # deprecated, replaced by 'unused'
+ - exhaustivestruct # deprecated, replaced by 'exhauststruct'
+ - golint # deprecated, replaced by 'revive'
+ - ifshort # deprecated
+ - interfacer # deprecated
+ - maligned # deprecated, replaced by 'govet fieldalignement'
+ - nosnakecase # deprecated, replaced by 'revive var-naming'
+ - scopelint # deprecated, replaced by 'exportloopref'
+ - structcheck # deprecated, replaced by 'unused'
+ - varcheck # deprecated, replaced by 'unused'
+
+ # Don't support Go 1.18 generics yet
+ - rowserrcheck
+ - sqlclosecheck
+ - wastedassign
+
+ # Style
+ - nlreturn
+ - nonamedreturns # I name returns for godoc purposes.
+ - tagliatelle
+ - wsl
+ - whitespace
+
+ # Complexity; sometimes code is just complex.
+ - cyclop
+ - funlen
+ - gocognit
+ - gocyclo
+ - maintidx
+ - nestif
+
+ # Miscellaneous
+ - asciicheck # it's fine to include Unicode
+ - godox # there are a few known TODOs, and that's OK
+ - goerr113 # forbids fmt.Errorf(%w), which is just silly
+
+ # These are disabled not because I think they're bad, but because
+ # they currently don't pass, and I haven't really evaluated them
+ # yet.
+ - errorlint
+ - exhaustive
+ - exhaustruct
+ - forcetypeassert
+ - gochecknoglobals
+ - gochecknoinits
+ - gomnd
+ - ireturn
+ - lll
+ - revive
+ - testpackage
+ - thelper
+ - varnamelen
+ - wrapcheck
linters-settings:
+ gci:
+ sections:
+ - standard
+ - default
+ - prefix(git.lukeshu.com/go/lowmemjson)
gofmt:
simplify: true
+ gosec:
+ excludes:
+ - G104 # duplicates errcheck
+ nolintlint:
+ require-explanation: true
+ require-specific: true
issues:
+ exclude-use-default: false
exclude-rules:
- path: borrowed_example_test.go
- linters: [errcheck]
+ - path: "borrowed_.*_test\\.go"
+ linters:
+ - errcheck
+ - godot
+ - gofumpt
+ - gosec
+ - noctx
+ - stylecheck
+ - path: "borrowed_.*_test\\.go"
+ linters: [gocritic]
+ text: "commentFormatting: put a space between `//` and comment text"
+ - path: "internal/"
+ linters: [stylecheck]
+ text: "ST1000" # package doc comment
+ max-issues-per-linter: 0
+ max-same-issues: 0