-
Notifications
You must be signed in to change notification settings - Fork 4
chore: migrate linter #42
Conversation
WalkthroughThe updates include several modifications to project configuration and workflow files. The GitHub Actions workflows were simplified: the lint workflow now uses a newer version of the golangci-lint action and removes a step that checked for file changes, while the test workflow removes the integration test job entirely. The golangci-lint configuration file was upgraded to version 2 syntax, with changes to enabled linters, restructuring, and new exclusions and formatters. The Makefile's lint target no longer depends on the vet target. Additionally, the VS Code launch configuration file was deleted. Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the linter configuration to a newer setup and updates the associated GitHub workflow.
- Updates .golangci.yml with a new version, adjusted linter enable lists, and added exclusions and formatters.
- Updates the GitHub workflow to use an updated golangci-lint-action version.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .golangci.yml | Migrated configuration for linters with updated rules and exclusions. |
| .github/workflows/lint.yml | Updated linter action version from v3.7.0 to v7.0.0. |
Files not reviewed (1)
- Makefile: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
.github/workflows/lint.yml (1)
16-23: 🛠️ Refactor suggestion
⚠️ Potential issueFix the conditional guard for the lint step.
The step still uses
if: env.GIT_DIFF, but you removed the action that setsGIT_DIFF. As a result, thegolangci-lint-actionjob will never run. Either:
- Remove the
if: env.GIT_DIFFline, or- Reintroduce a diff-generation step before running the linter.
♻️ Duplicate comments (1)
.golangci.yml (1)
6-10: Remove duplicatedgoseclinter.The
goseclinter appears twice in theenablelist (lines 6 and 10), resulting in redundant scans. Please remove one of the entries.
🧹 Nitpick comments (1)
Makefile (1)
40-43: Consider reintroducinggo vet.By removing the
vetprerequisite from thelinttarget, foundational checks viago vetare skipped. You may want to:lint: @echo "--> Running go vet" @go vet $(pkgs) @echo "--> Running golangci-lint" @golangci-lint run ...or document explicitly that
vetis only run undertest.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.github/workflows/lint.yml(1 hunks).github/workflows/test.yml(0 hunks).golangci.yml(1 hunks).vscode/launch.json(0 hunks)Makefile(1 hunks)
💤 Files with no reviewable changes (2)
- .github/workflows/test.yml
- .vscode/launch.json
🔇 Additional comments (4)
.golangci.yml (4)
1-3: Confirm v2 syntax requirements.Upgrading to
version: "2"is correct for golangci-lint v7, but by removing the globaltimeoutunderrun, the default (1m) may be too short for larger codebases. Consider explicitly adding:run: timeout: 5m modules-download-mode: readonlyto avoid unexpected timeouts.
9-13: Approve additional static-analysis linters.Adding
errorlint,unconvert, andstaticcheckstrengthens error-handling checks and removes unnecessary conversions. This modernization aligns with current Go best practices.
14-24: Verify thesettingssection and exclusions syntax.You renamed
linters-settingsto a genericsettingsblock and introduced anexclusionssubsection. Ensure that:
- golangci-lint v2 accepts
settings(notlinters-settings) as the root key.exclusionsis the correct v2 field (versusissues.exclude-rules).
If not, revert to the documented v2 schema to prevent silent config omissions.
30-43: Approveformattersconfiguration.Enabling
gofmtandgoimportsas formatters withlocal-prefixes: github.com/rollkitis a solid choice. The exclusions for generated code andthird_party,builtin, andexamplesdirectories match the project structure.
Co-authored-by: Copilot <[email protected]>
|
closing as we will archive this repo |
Overview
Summary by CodeRabbit