Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fix linter deprecation warnings #809

Merged
merged 4 commits into from
Sep 3, 2024
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
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
Loading