Skip to content

Commit

Permalink
consume golangci-lint 1.61.0
Browse files Browse the repository at this point in the history
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
  • Loading branch information
erhancagirici committed Oct 31, 2024
1 parent 399e615 commit 8b6ba5c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 30 deletions.
53 changes: 24 additions & 29 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
run:
deadline: 10m
# SPDX-FileCopyrightText: 2024 The Crossplane Authors <https://crossplane.io>
#
# SPDX-License-Identifier: CC0-1.0

skip-files:
- "zz_\\..+\\.go$"
run:
timeout: 10m
concurrency: 1

output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number
formats:
- format: colored-line-number
print-linter-name: true

linters-settings:
errcheck:
Expand All @@ -18,18 +22,18 @@ linters-settings:
# default is false: such cases aren't reported by default.
check-blank: false

# [deprecated] comma-separated list of pairs of the form pkg:regex
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
ignore: fmt:.*,io/ioutil:^Read.*
exclude-functions:
- io/ioutil.ReadFile
- io/ioutil.ReadDir
- io/ioutil.ReadAll

govet:
# report about shadowed variables
check-shadowing: false

golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
revive:
# confidence for issues, default is 0.8
confidence: 0.8

gofmt:
# simplify code: gofmt with `-s` option, true by default
Expand All @@ -44,10 +48,6 @@ linters-settings:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 10

maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true

dupl:
# tokens count to trigger issue, 150 by default
threshold: 100
Expand All @@ -62,13 +62,6 @@ linters-settings:
# tab width in spaces. Default to 1.
tab-width: 1

unused:
# treat code as a program (not a library) and report unused exported identifiers; default is false.
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false

unparam:
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
Expand Down Expand Up @@ -104,17 +97,18 @@ linters-settings:

linters:
enable:
- megacheck
- govet
- gocyclo
- gocritic
- interfacer
- goconst
- goimports
- gofmt # We enable this as well as goimports for its simplify mode.
- gosimple
- prealloc
- golint
- revive
- staticcheck
- unconvert
- unused
- misspell
- nakedret

Expand All @@ -123,8 +117,9 @@ linters:
- unused
fast: false


issues:
exclude-files:
- "zz_.*go$"
# Excluding configuration per-path and per-linter
exclude-rules:
# Exclude some linters from running on tests files.
Expand All @@ -136,7 +131,7 @@ issues:
- gosec
- scopelint
- unparam

# Ease some gocritic warnings on test files.
- path: _test\.go
text: "(unnamedResult|exitAfterDefer)"
Expand Down Expand Up @@ -189,7 +184,7 @@ issues:
new: false

# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-per-linter: 0
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
2 changes: 1 addition & 1 deletion build
Submodule build updated 1 files
+1 −1 makelib/golang.mk

0 comments on commit 8b6ba5c

Please sign in to comment.