Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: 1.23.5
go-version: 1.25.5
- name: Build
run: make build
- name: FMT
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: 1.23.5
go-version: 1.25.5
- name: ut
run: make test
env:
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: 1.23.5
go-version: 1.25.5
- name: fv
run: make create-cluster fv
env:
Expand Down
252 changes: 113 additions & 139 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,177 +1,151 @@
linters-settings:
dupl:
threshold: 200
errorlint:
# Use '%w' to format errors.
errorf: true
exhaustive:
# Ignore auto-generated code.
check-generated: false
default-signifies-exhaustive: false
forbidigo:
forbid:
# Forbid 'fmt.Print[|f|ln]() in shipping code.
- 'fmt\.Print.*'
funlen:
lines: 100
statements: 50
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint # conflicts with nolintlint config providing superset functionality
- wrapperFunc
gocyclo:
min-complexity: 20
goimports:
local-prefixes: github.com/projectsveltos
mnd:
checks: argument,case,condition,return
gomodguard:
# Although this is almost empty, we will evolve the list below with the
# modules we shouldn't use for technical and/or security reasons.
blocked:
modules:
- k8s.io/kubernetes:
reason: "There is no good, avoidable reason to use this package and often leads to issues such as https://bit.ly/3dlKScY. However, if you disagree please include @ravchama in code review highlighting the reason."
versions:
# Don't merge replace directives using local path.
local_replace_directives: true
govet:
shadow: true
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
grouper:
const-require-grouping: true
import-require-single-import: true
import-require-grouping: true
var-require-grouping: true
lll:
line-length: 160
maintidx:
# check https://bit.ly/3tlJX3n for maintainability index.
##
# starting with 25 to begin with, with the plan to bump it to 40 eventuallly.
##
under: 25
misspell:
locale: US
nolintlint:
allow-unused: false # report any unused nolint directives
require-explanation: true # require an explanation for nolint directives
require-specific: true # require nolint directives to be specific about which linter is being skipped
revive:
ignore-generated-header: true
# this is a new linter, so let's start with Warning instead of errors to
# begin with.
severity: warning
whitespace:
multi-if: true
multi-func: true

version: "2"
run:
allow-parallel-runners: true
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
fast: false
default: none
enable:
- bidichk
- containedctx
- bodyclose
- containedctx
- copyloopvar
- dogsled
- dupl
- durationcheck
- errcheck
- errname
- errorlint
- exhaustive
- copyloopvar
- forbidigo
- funlen
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- mnd
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- grouper
- ineffassign
- lll
- misspell
- maintidx
- misspell
- mnd
- nakedret
- noctx
- nolintlint
- nosprintfhostport
- predeclared
- revive
- staticcheck
- typecheck
- unconvert
- unparam
- unused
- whitespace

# don't enable:
# - asciicheck
# - exhaustivestruct # applicable to special cases.
# - gochecknoglobals
# - gocognit
# - godot
# - godox
# - goerr113
# - golint # deprecated
# - interfacer # deprecated
# - maligned #deprecated
# - nestif
# - prealloc
# - scopelint # deprecated
# - testpackage
# - wsl

settings:
dupl:
threshold: 200
errorlint:
errorf: true
exhaustive:
default-signifies-exhaustive: false
forbidigo:
forbid:
- pattern: fmt\.Print.*
funlen:
lines: 100
statements: 50
goconst:
min-len: 2
min-occurrences: 2
gocritic:
disabled-checks:
- dupImport
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
gocyclo:
min-complexity: 20
gomodguard:
blocked:
modules:
- k8s.io/kubernetes:
reason: There is no good, avoidable reason to use this package and often leads to issues such as https://bit.ly/3dlKScY. However, if you disagree please include @ravchama in code review highlighting the reason.
local-replace-directives: true
govet:
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
grouper:
const-require-grouping: true
import-require-single-import: true
import-require-grouping: true
var-require-grouping: true
lll:
line-length: 160
maintidx:
under: 25
misspell:
locale: US
mnd:
checks:
- argument
- case
- condition
- return
nolintlint:
require-explanation: true
require-specific: true
allow-unused: false
revive:
severity: warning
whitespace:
multi-if: true
multi-func: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- grouper
- maintidx
- mnd
path: _test\.go
- linters:
- gocritic
text: 'unnecessaryDefer:'
paths:
- third_party$
- builtin$
- examples$
issues:
# Excluding configuration per path, per linter, per text and per-source
exclude-rules:
- path: _test\.go
linters:
- mnd
- grouper
- maintidx

# https://github.com/go-critic/go-critic/issues/926
- linters:
- gocritic
text: "unnecessaryDefer:"
# Maximum issues count per one linter.
# Set to 0 to disable.
max-issues-per-linter: 0
# Maximum count of issues with the same text.
# Set to 0 to disable.
max-same-issues: 0

run:
# Allow multiple parallel golangci-lint instances running.
allow-parallel-runners: true
# Timeout for analysis
timeout: 5m

formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/projectsveltos
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.23.5 AS builder
FROM golang:1.25.5 AS builder

ARG BUILDOS
ARG TARGETARCH
Expand Down
Loading
Loading