Skip to content

Conversation

@NathanBaulch
Copy link
Contributor

@NathanBaulch NathanBaulch commented Oct 29, 2025

I recently tried linting this project to check something I was working on and golangci-lint v2.1.2 paniced because I'm using Go 1.25 and apparently they don't play nice together. So I figured I'd upgrade to v2.5.0 (latest).

I've pushed fixes for each linter in separate commits since they're generally quite opinionated and each will likely need to be reviewed in isolation.

Notes:

  • wsl_v5 (successor to wsl) - disabled - created a lot of churn.
  • embeddedstructfieldcheck - disabled - not against this but it created false positives related to comments I think.
  • noinlineerr - disabled - personal preference, feel free to overrule.
  • gofumpt - removed naked returns, somewhat controversial in the community.
  • noctx - used context.Background() in a couple of places, maybe should be context.TODO().
  • godot - some packages have a doc.go, most don't. I went with a light touch where possible.

@NathanBaulch NathanBaulch force-pushed the golangcilint branch 2 times, most recently from 0babb1f to c0ecafb Compare October 30, 2025 19:57
@jkowalski
Copy link
Contributor

can we keep wsl_v5 but override its config to be the same as the old one?

@jkowalski
Copy link
Contributor

btw, we'll first cut v0.22 release and then merge this change along with upgrading to golang 1.25.

@NathanBaulch
Copy link
Contributor Author

NathanBaulch commented Nov 11, 2025

Possibly @jkowalski, I didn't spend too much time on wsl_v5 in case it wasn't wanted.

@NathanBaulch NathanBaulch changed the title chore: upgrade to golangci-lint v2.5.0 chore(ci): upgrade to golangci-lint v2.5.0 Nov 11, 2025
@NathanBaulch
Copy link
Contributor Author

OK, wsl_v5 has been enabled, along with ~30 whitespace fixes to get it passing.
I've disabled the 4 rules (assign, expr, err, return) that caused > 10 issues each since that's probably a good indication that this project isn't following those ones.

@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.03%. Comparing base (cb455c6) to head (e65b3a3).
⚠️ Report is 743 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4931      +/-   ##
==========================================
+ Coverage   75.86%   78.03%   +2.17%     
==========================================
  Files         470      548      +78     
  Lines       37301    31429    -5872     
==========================================
- Hits        28299    24527    -3772     
+ Misses       7071     4850    -2221     
- Partials     1931     2052     +121     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@julio-lopez julio-lopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇Thanks for doing this.

See inline comments.

tp, _ = transport.(*http.Transport)
tp.DialContext = func(_ context.Context, _, _ string) (net.Conn, error) {
dial, err := net.Dial("unix", u.Path)
tp.DialContext = func(ctx context.Context, _, _ string) (net.Conn, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not completely clear (to me) what the side effect of the ctx changes might be w.r.t context cancellation.

Can you put the ctx changes in a separate PR please? maybe by disabling the noctx linter in the config for now.

That way, all the other changes in this PR, including the linter upgrade. Then the ctx changes can be merged after the release.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NathanBaulch and others added 4 commits November 12, 2025 06:47
Co-authored-by: Julio Lopez <1953782+julio-lopez@users.noreply.github.com>
Co-authored-by: Julio Lopez <1953782+julio-lopez@users.noreply.github.com>
This reverts commit 86ccd4d.
@julio-lopez julio-lopez merged commit 557940c into kopia:master Nov 11, 2025
26 of 27 checks passed
@julio-lopez
Copy link
Collaborator

Thanks!

@NathanBaulch NathanBaulch deleted the golangcilint branch November 11, 2025 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants