Skip to content

Commit

Permalink
ci: update golangci-lint to v1.64.5
Browse files Browse the repository at this point in the history
In the process, disable deprecated linters and enable new ones.

Signed-off-by: Robin Hahling <code@hahling.ch>
  • Loading branch information
rolinh committed Feb 14, 2025
1 parent 158ac7b commit d439420
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- v*
pull_request:
branches:
- master
- v*
- master
- v*

jobs:
build:
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Run static checks
uses: golangci/golangci-lint-action@e0ebdd245eea59746bb0b28ea6a9871d3e35fbc9
with:
version: v1.51.1
version: v1.64.5
# use our .golangci.yml and configure output to be logged in the GHA, in addition to annotating the commit.
# see https://github.com/golangci/golangci-lint-action/issues/119#issuecomment-981090648 for output
args: --config=.golangci.yml --verbose --out-${NO_FUTURE}format colored-line-number --timeout 5m
Expand Down
41 changes: 33 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# See https://golangci-lint.run/usage/configuration/ for available options.
# Also https://github.com/cilium/cilium/blob/master/.golangci.yaml as a
# Also https://github.com/cilium/cilium/blob/main/.golangci.yaml as a
# reference.
run:
go: '1.20'
timeout: 1m
linters:
disable-all: true
Expand All @@ -13,37 +12,39 @@ linters:
- bodyclose
- containedctx
- contextcheck
- copyloopvar
- cyclop
- decorder
- dogsled
- dupl
- dupword
- durationcheck
- err113
- errcheck
- errname
- errorlint
- exptostd
- exhaustive
- exportloopref
- forcetypeassert
- gocheckcompilerdirectives
- gocognit
- goconst
- gocritic
- godot
- goerr113
- gofmt
- goheader
- goimports
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- grouper
- ineffassign
- interfacebloat
- intrange
- ireturn
- makezero
- mirror
- misspell
- musttag
- nakedret
Expand All @@ -52,29 +53,53 @@ linters:
- nilnil
- noctx
- nosprintfhostport
- perfsprint
- prealloc
- predeclared
- reassign
- revive
- rowserrcheck
- sloglint
- staticcheck
- tenv
- tagalign
- testifylint
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- usetesting
- wastedassign

linters-settings:
cyclop:
skip-tests: true

goheader:
template: |-
SPDX-License-Identifier: Apache-2.0
Copyright Authors of Cilium
govet:
enable-all: true
perfsprint:
strconcat: false
sloglint:
no-mixed-args: true
static-msg: true
no-global: "all"
key-naming-case: kebab # be consistent with key names
forbidden-keys: # let's no use reserved log keys
- level
- msg
- source
- time
issues:
# Maximum issues count per one linter.
# Set to 0 to disable (default is 50)
max-issues-per-linter: 0
# Maximum count of issues with the same text.
# Set to 0 to disable (default is 3)
max-same-issues: 0
fix: true # fix found issues (if it's supported by the linter).
exclude-use-default: false # default rules exclude doc comments check :(
exclude-generated: strict

0 comments on commit d439420

Please sign in to comment.