Skip to content

chore: golangci lint/v2 #1434

Merged
hilmarf merged 1 commit into
mainfrom
chore/golangci-lint
May 2, 2025
Merged

chore: golangci lint/v2 #1434
hilmarf merged 1 commit into
mainfrom
chore/golangci-lint

Conversation

@hilmarf
Copy link
Copy Markdown
Member

@hilmarf hilmarf commented May 2, 2025

2nd try, because 1st did include unsigned commits

What this PR does / why we need it

I was checking originally on the linter issues in
https://github.com/open-component-model/ocm-k8s-toolkit and realizing, that there is a newer version of golangci-lint available.

This PR upgrades to golangci-lint v2.1.5.

I've followed the https://golangci-lint.run/product/migration-guide/ and then added some more exclusions:

- linters:
- staticcheck
path: cmds/.*|api/.*
text: 'QF1008: could remove embedded field'
- linters:
- staticcheck
path: cmds/.*|api/.*
text: 'ST1006: receiver name should'
- linters:
- staticcheck
path: cmds/.*|api/.*
text: 'ST1001: should not use dot imports'
- linters:
- staticcheck
path: cmds/.*|api/.*
text: 'ST1005: error strings should not'
- linters:
- staticcheck
path: cmds/.*|api/.*
text: 'QF1001: could apply De Morgan'
- linters:
- staticcheck
path: cmds/.*|api/.*
text: 'QF1012: Use fmt.Fprintf'
- linters:
- staticcheck
path: cmds/.*|api/.*
text: 'QF1003: could use tagged switch'
- linters:
- staticcheck
path: cmds/.*|api/.*
text: 'QF1009: probably want to use time.Time.Equal'

until no more errors occurred.

Not sure if someone wants to fix some of those staticcheck.

What this PR does / why we need it

Which issue(s) this PR fixes

#### What this PR does / why we need it

I was checking originally on the linter issues in
https://github.com/open-component-model/ocm-k8s-toolkit and realizing,
that there is a newer version of `golangci-lint` available.

This PR upgrades to golangci-lint v2.1.5.

I've followed the https://golangci-lint.run/product/migration-guide/ and
then added some more exclusions:

https://github.com/open-component-model/ocm/blob/d50bee9eac6f2ec6b4816dc754291f085f4ab5bd/.github/config/golangci.yaml#L141-L172

until no more errors occurred.

Not sure if someone wants to fix some of those `staticcheck`.
@hilmarf hilmarf requested a review from a team as a code owner May 2, 2025 07:43
@hilmarf hilmarf enabled auto-merge (squash) May 2, 2025 07:43
@github-actions github-actions Bot added kind/chore chore, maintenance, etc. size/l Large component/github-actions Changes on GitHub Actions or within `.github/` directory kind/dependency dependency update, etc. labels May 2, 2025
@hilmarf hilmarf merged commit cb5eaee into main May 2, 2025
26 checks passed
@hilmarf hilmarf deleted the chore/golangci-lint branch May 2, 2025 07:53
@ocmbot ocmbot Bot added this to the 2025-Q2 milestone May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/github-actions Changes on GitHub Actions or within `.github/` directory kind/chore chore, maintenance, etc. kind/dependency dependency update, etc. size/l Large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants