Skip to content

chore: update golangci-lint tooling#160

Merged
ReneWerner87 merged 5 commits intomasterfrom
codex/2025-11-10-08-12-01
Nov 10, 2025
Merged

chore: update golangci-lint tooling#160
ReneWerner87 merged 5 commits intomasterfrom
codex/2025-11-10-08-12-01

Conversation

@ReneWerner87
Copy link
Copy Markdown
Member

@ReneWerner87 ReneWerner87 commented Nov 10, 2025

Summary

  • bump golangci-lint to v2.6.1 and migrate configuration to the v2 schema, including updated exclusions and disabled checks
  • add formatter configuration for gofmt/gofumpt and tune revive/staticcheck/testifylint settings for compatibility
  • update the lint workflow to use golangci-lint-action v9 and keep the Makefile in sync

Testing

  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.1 run ./...
  • go test ./...

Codex Task

Summary by CodeRabbit

  • Chores

    • Upgraded the development linting tooling to a newer release for improved static analysis.
  • Tests

    • Standardized assertions for empty/zero values across tests, replacing exact string equality checks with empty-value assertions for clearer intent and consistency.

@ReneWerner87 ReneWerner87 requested a review from a team as a code owner November 10, 2025 08:12
@ReneWerner87 ReneWerner87 requested review from efectn, gaby and sixcolors and removed request for a team November 10, 2025 08:12
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 10, 2025

Walkthrough

Upgrade Makefile lint invocation to the golangci-lint v2 module path and version; adjust several tests to use Empty assertions and simplify nolint directives in convert.go. No functional behavior or public API changes.

Changes

Cohort / File(s) Change Summary
Makefile / Linter
Makefile
Updated lint target from golangci-lint/cmd/golangci-lint@v1.61.0 to golangci-lint/v2/cmd/golangci-lint@v2.6.1 (module path/version bump).
Tests — empty-value assertions
cbor_test.go, common_test.go, http_test.go
Replaced explicit Equal(..., "") checks with Empty(...)/require.Empty(...) for empty-string/empty-value expectations; adjusted tests to assert emptiness rather than direct string equality.
Nolint directives
convert.go
Simplified lint suppression comments in ToString slice/array handling from nolint: revive,errcheck to nolint:errcheck (cosmetic lint directive change).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to test assertion intent in cbor_test.go, common_test.go, and http_test.go to ensure semantic equivalence.
  • Verify the Makefile module path/version change works in CI and local tooling.

Possibly related PRs

Suggested reviewers

  • gaby
  • sixcolors
  • efectn

Poem

🐇 I nibbled at warnings, hopped through each test,

Switched a lint path, and cleaned up the rest.
Empty assertions snug in their place,
A tidy Makefile, quick little race.
🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: update golangci-lint tooling' directly reflects the main change (golangci-lint upgrade from v1.61.0 to v2.6.1 in Makefile), matching the PR objectives and file modifications.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/2025-11-10-08-12-01

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 035c1d2 and f8d6b83.

⛔ Files ignored due to path filters (1)
  • .golangci.yml is excluded by !**/*.yml
📒 Files selected for processing (4)
  • cbor_test.go (1 hunks)
  • common_test.go (1 hunks)
  • convert.go (1 hunks)
  • http_test.go (3 hunks)
✅ Files skipped from review due to trivial changes (2)
  • convert.go
  • common_test.go
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: gofiber/fiber PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-22T13:48:12.485Z
Learning: Run golangci-lint (Make target: lint)
Learnt from: CR
Repo: gofiber/fiber PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-19T15:13:10.652Z
Learning: Run `make lint` for static analysis when modifying code
Learnt from: efectn
Repo: gofiber/fiber PR: 3162
File: hooks_test.go:228-228
Timestamp: 2024-12-13T08:14:22.851Z
Learning: In Go test files, prefer using the `require` methods from the `testify` package for assertions instead of manual comparisons and calls to `t.Fatal` or `t.Fatalf`.
Learnt from: ReneWerner87
Repo: gofiber/fiber PR: 3161
File: app.go:923-932
Timestamp: 2024-11-15T07:56:21.623Z
Learning: In the Fiber framework, breaking changes are acceptable when moving from version 2 to version 3, including modifications to method signatures such as in the `Test` method in `app.go`.
Learnt from: CR
Repo: gofiber/cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-03T12:18:29.841Z
Learning: Always run `make lint`
📚 Learning: 2024-12-13T08:14:22.851Z
Learnt from: efectn
Repo: gofiber/fiber PR: 3162
File: hooks_test.go:228-228
Timestamp: 2024-12-13T08:14:22.851Z
Learning: In Go test files, prefer using the `require` methods from the `testify` package for assertions instead of manual comparisons and calls to `t.Fatal` or `t.Fatalf`.

Applied to files:

  • http_test.go
📚 Learning: 2025-10-16T07:19:52.418Z
Learnt from: grivera64
Repo: gofiber/fiber PR: 3807
File: adapter_test.go:118-144
Timestamp: 2025-10-16T07:19:52.418Z
Learning: In the Fiber codebase, the linter does not allow `require` assertions from within HTTP handlers (including net/http-style handlers). Use `t.Fatalf`, `t.Errorf`, or similar `testing.T` methods for error handling inside handler functions instead.

Applied to files:

  • http_test.go
🧬 Code graph analysis (1)
http_test.go (1)
http.go (2)
  • ParseVendorSpecificContentType (43-74)
  • StatusMessage (83-88)
🔇 Additional comments (4)
cbor_test.go (1)

76-76: LGTM! More idiomatic empty-value assertion.

Using require.Empty is more expressive and idiomatic than comparing to an empty string literal.

http_test.go (3)

40-40: LGTM! Improved assertion for empty MIME type.

The require.Empty assertion is more expressive for verifying empty results.


117-117: LGTM! Cleaner assertion for empty content type.

Using require.Empty provides clearer intent when validating empty string results.


207-216: LGTM! Consistent empty assertions for invalid status codes.

All four test cases correctly use require.Empty to validate that invalid status codes return empty messages. This is more idiomatic and clearly expresses the expected behavior.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @ReneWerner87, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the project's linting infrastructure by moving to the latest major version of golangci-lint. This update includes a complete migration of the linting configuration to the new schema, integrates Go formatters directly into the linting process, and refines various linter settings. The goal is to enhance code quality, enforce modern Go best practices, and streamline the development workflow by ensuring consistent code style and catching potential issues earlier.

Highlights

  • golangci-lint Version Bump: The golangci-lint tool has been updated to version v2.6.1.
  • Configuration Migration: The .golangci.yml configuration has been migrated to the new v2 schema, involving structural changes to settings and exclusions.
  • Formatter Integration: Dedicated formatter configuration for gofmt and gofumpt has been added, ensuring consistent code styling.
  • Linter Settings Adjustment: Specific settings for revive, staticcheck, and testifylint have been tuned for compatibility and improved linting results.
  • Makefile Update: The Makefile has been updated to reflect the new golangci-lint version in the lint command.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/linter.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.31%. Comparing base (9417f80) to head (f8d6b83).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #160   +/-   ##
=======================================
  Coverage   83.31%   83.31%           
=======================================
  Files          11       11           
  Lines         755      755           
=======================================
  Hits          629      629           
  Misses        115      115           
  Partials       11       11           
Flag Coverage Δ
unittests 83.31% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@ReneWerner87 ReneWerner87 merged commit 7ee9f45 into master Nov 10, 2025
18 of 19 checks passed
@ReneWerner87 ReneWerner87 deleted the codex/2025-11-10-08-12-01 branch November 10, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant