~seirdy/moac

b4bc5bc7fe93f9a39c85eb8a41b428ba2532504e — Rohan Kumar 5 months ago e561b86
Chore(lint): update/pin golangci-lint to v1.43.0

Update golangci-lint's configs for the new golangci-lint 1.43.0,
featuring two new linters.

The parent commit e561b8675a43d8a9030719a1329898692a2300a7 ensured
compliance with the new varnamelen linter.
2 files changed, 22 insertions(+), 2 deletions(-)

M .builds/install-linters.sh
M .golangci.yml
M .builds/install-linters.sh => .builds/install-linters.sh +1 -1
@@ 4,7 4,7 @@
set -e -u -x

# golangci-lint is installed from master
linters='github.com/golangci/golangci-lint/cmd/golangci-lint@master
linters='github.com/golangci/golangci-lint/cmd/golangci-lint@1.43.0
github.com/praetorian-inc/gokart@latest
github.com/mrtazz/checkmake/cmd/checkmake@latest
github.com/quasilyte/go-consistent@latest

M .golangci.yml => .golangci.yml +21 -1
@@ 41,6 41,7 @@ linters:
  disable-all: true
  enable:
    - asciicheck
    - bidichk
    - bodyclose
    - cyclop
    - deadcode


@@ 109,13 110,14 @@ linters:
    - unparam
    - unused
    - varcheck
    - varnamelen
    - wastedassign
    - whitespace
    - wrapcheck
    - wsl
    # - gomodguard # obsoleted by go-arch-lint
    # - paralleltest # not always relevant
    # - tenv # only for go117+
    # - tenv # only for go117+; I'll require go117+ when go119 is out.
    # - scopelint # deprecated
    # - maligned # deprecated
    # - golint # deprecated


@@ 124,6 126,8 @@ linters-settings:
  cyclop:
    max-complexity: 9
    package-average: 5
  unparam:
    check-exported: true
  dupl:
    threshold: 40
  errcheck:


@@ 131,6 135,11 @@ linters-settings:
    check-type-assertions: true
  goconst:
    numbers: true
  staticcheck:
    checks: ["all"]
    initialisms: []
  stylecheck:
    checks: ["all"]
  gocritic:
    enabled-tags:
      - diagnostic


@@ 271,6 280,17 @@ linters-settings:
    config:
      global:
        audit: enabled
  varnamelen:
    max-distance: 6
    ignore-names:
      - C
      - G
      - r # rune
    ignore-decls:
      - cs charsets.CharsetCollection
      - cs *charsets.CharsetCollection
      - cs CharsetCollection
      - cs *CharsetCollection
  wsl:
    force-case-trailing-whitespace: 2
    # force-short-decl-cuddling: true