Skip to content

Commit

Permalink
Merge pull request #809 from aiven/rriski-fix-golangci-lint
Browse files Browse the repository at this point in the history
feat: fix linter deprecation warnings
  • Loading branch information
rriski authored Sep 3, 2024
2 parents 50266bd + 273160a commit 187ec06
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
23 changes: 15 additions & 8 deletions .trunk/configs/.golangci.yml → .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
issues:
exclude-dirs:
- hack
exclude-files:
- api/v1alpha1/zz_generated.deepcopy.go
exclude-rules:
- path: _test\.go
linters:
Expand All @@ -8,8 +12,8 @@ issues:
- golint
text: underscore
- linters:
- gomnd
text: "mnd: Magic number: 0o644"
- mnd
text: "Magic number: 0o644"

linters:
disable-all: true
Expand All @@ -24,13 +28,16 @@ linters:
- staticcheck
- unconvert
- unused
- vet
- goimports
- gomnd
- govet
- mnd

linters-settings:
govet:
enable-all: true
disable:
- fieldalignment
- shadow

run:
timeout: 10m
skip-dirs:
- hack
skip-files:
- api/v1alpha1/zz_generated.deepcopy.go
2 changes: 1 addition & 1 deletion generators/docs/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func setUsageExamples(examplesDir string, validators map[string]schemaValidator,
Value: strings.TrimSpace(string(exampleData)),
}
title := strings.Split(match, ".")
// trunk-ignore(golangci-lint/gomnd): splits foo.title.yaml and takes the middle part
// nolint:mnd // splits foo.title.yaml and takes the middle part
if len(title) > 2 {
// Just takes the part after the kind name
example.Title = title[1]
Expand Down
2 changes: 1 addition & 1 deletion tests/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func getNamespacedName(keys ...string) (types.NamespacedName, error) {
case 1:
name = keys[0]
namespace = defaultNamespace
case 2: //nolint:gomnd
case 2: //nolint:mnd
name = keys[0]
namespace = keys[1]
default:
Expand Down

0 comments on commit 187ec06

Please sign in to comment.