From 8b6ba5c51b1bc35bdca9dbd4d20c1a758b57a325 Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Thu, 31 Oct 2024 10:26:56 +0300 Subject: [PATCH] consume golangci-lint 1.61.0 Signed-off-by: Erhan Cagirici --- .golangci.yml | 53 +++++++++++++++++++++++---------------------------- build | 2 +- 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 1edfe892..677aaf90 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,12 +1,16 @@ -run: - deadline: 10m +# SPDX-FileCopyrightText: 2024 The Crossplane Authors +# +# 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: @@ -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 @@ -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 @@ -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: @@ -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 @@ -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. @@ -136,7 +131,7 @@ issues: - gosec - scopelint - unparam - + # Ease some gocritic warnings on test files. - path: _test\.go text: "(unnamedResult|exitAfterDefer)" @@ -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 diff --git a/build b/build index 6f2b7c5f..d3155548 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 6f2b7c5f0a88eac426439d6d9b40abd919d89fbe +Subproject commit d3155548bfab68fc8bea64c5526642b7b565ae33