Skip to content

chore: update golangci linter configuration#2736

Merged
theakshaypant merged 1 commit into
tektoncd:mainfrom
chmouel:fix-lint
May 20, 2026
Merged

chore: update golangci linter configuration#2736
theakshaypant merged 1 commit into
tektoncd:mainfrom
chmouel:fix-lint

Conversation

@chmouel

@chmouel chmouel commented May 19, 2026

Copy link
Copy Markdown
Member

Updated gomodguard to gomodguard_v2 for the latest linter version. Also disabled the inline check in govet to reduce false positives during code analysis.

Error was:

level=warning msg="The linter 'gomodguard' is deprecated (since v2.12.0) due to: new major version. Replaced by gomodguard_v2." level=warning
msg="Suggested new configuration:\nlinters:\n  enable:\n    -
gomodguard_v2\n" pkg/acl/owners_test.go:200:37: inline: cannot inline:
type parameter inference is not yet supported (govet) assert.Assert(t,
slices.Contains(tt.want, v), "got = %v, want %v", got, tt.want)
pkg/kubeinteraction/cleanups_test.go:33:34: inline: cannot inline: type
parameter inference is not yet supported (govet) cleanupAnnotations :=
maps.Clone(cleanupLabels) ^ test/pkg/configmap/configmap.go:21:11:
inline: cannot inline: type parameter inference is not yet supported
(govet) maps.Copy(newData, origCfgmap.Data) ^
test/pkg/configmap/configmap.go:22:11: inline: cannot inline: type
parameter inference is not yet supported (govet) maps.Copy(newData,
data)

📝 Description of the Change

🔗 Linked GitHub Issue

Fixes #

🧪 Testing Strategy

  • Unit tests
  • Integration tests
  • End-to-end tests
  • Manual testing
  • Not Applicable

🤖 AI Assistance

AI assistance can be used for various tasks, such as code generation,
documentation, or testing.

Please indicate whether you have used AI assistance
for this PR and provide details if applicable.

  • I have not used any AI assistance for this PR.
  • I have used AI assistance for this PR.

Important

Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project's standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.

If the majority of the code in this PR was generated by an AI, please add a Co-authored-by trailer to your commit message.
For example:

Co-authored-by: Claude noreply@anthropic.com

✅ Submitter Checklist

  • 📝 My commit messages are clear, informative, and follow the project's How to write a git commit message guide. The Gitlint linter ensures in CI it's properly validated
  • ✨ I have ensured my commit message prefix (e.g., fix:, feat:) matches the "Type of Change" I selected above.
  • ♽ I have run make test and make lint locally to check for and fix any
    issues. For an efficient workflow, I have considered installing
    pre-commit and running pre-commit install to
    automate these checks.
  • 📖 I have added or updated documentation for any user-facing changes.
  • 🧪 I have added sufficient unit tests for my code changes.
  • 🎁 I have added end-to-end tests where feasible. See README for more details.
  • 🔎 I have addressed any CI test flakiness or provided a clear reason to bypass it.
  • If adding a provider feature, I have filled in the following and updated the provider documentation:
    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

Updated gomodguard to gomodguard_v2 for the latest linter
version. Also disabled the inline check in govet to reduce
false positives during code analysis.

Error was:

level=warning msg="The linter 'gomodguard' is deprecated (since v2.12.0)
due to: new major version. Replaced by gomodguard_v2." level=warning
msg="Suggested new configuration:\nlinters:\n  enable:\n    -
gomodguard_v2\n" pkg/acl/owners_test.go:200:37: inline: cannot inline:
type parameter inference is not yet supported (govet) assert.Assert(t,
slices.Contains(tt.want, v), "got = %v, want %v", got, tt.want)
pkg/kubeinteraction/cleanups_test.go:33:34: inline: cannot inline: type
parameter inference is not yet supported (govet) cleanupAnnotations :=
maps.Clone(cleanupLabels) ^ test/pkg/configmap/configmap.go:21:11:
inline: cannot inline: type parameter inference is not yet supported
(govet) maps.Copy(newData, origCfgmap.Data) ^
test/pkg/configmap/configmap.go:22:11: inline: cannot inline: type
parameter inference is not yet supported (govet) maps.Copy(newData,
data)

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
@chmouel

chmouel commented May 19, 2026

Copy link
Copy Markdown
Member Author

/retest

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the .golangci.yml configuration by replacing the gomodguard linter with gomodguard_v2 and disabling the inline check within the govet settings. I have no feedback to provide.

@mathur07 mathur07 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@theakshaypant theakshaypant merged commit 9db1fec into tektoncd:main May 20, 2026
2 checks passed
@chmouel chmouel deleted the fix-lint branch May 20, 2026 05:45
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