Skip to content

Add golangci-lint v2 hooks with formatting support #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JackismyShephard
Copy link

@JackismyShephard JackismyShephard commented Aug 6, 2025

Adds 7 new hooks for golangci-lint v2 architecture with support for version: "2" config files. Includes both linting hooks (golangci-lint-v2*) and formatting hooks (golangci-lint-v2-fmt*) that use the built-in fmt command.

Issue: #41

@TekWizely
Copy link
Owner

Greetings @JackismyShephard and thank you for taking the time to create a PR for my project ...

Upon reviewing the changes and looking into it, I have some issues with:

go install github.com/golangci/golangci-lint/cmd/golangci-lint-v2@latest

This command does not actually appear to work?

And indeed there is no golangci-lint-v2 folder in the cmd folder:

Additionally, installing it via any of the local installation options does not install the binary as golangci-lint-v2 - It appears to just install as golangci-lint

Q: (assuming v2 is installed with its standard name golangci-lint) will the existing hooks still invoke the linting (run) actions correctly?

I'm going to assume yes for the moment as I haven't seen anything to suggest otherwise yet. If true, then we don't necessarily need two sets of hooks for the lint action.

Its nice to see that they've added support for formatters. However golangci-lint-fmt-repo-mod is a mouthful :)

I'm wondering if we might instead introduce the formatting option hooks as golangci-fmt (i.e. golang-fmt, golang-fmt-mod, etc) ? It doesn't match the binary name but it matches the spirit of the formatting action.

Please take a minute to read and reply and we can continue the discussion.

Thanks again!

-TW

Copy link
Owner

@TekWizely TekWizely left a comment

Choose a reason for hiding this comment

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

Hi, see previous comment - Looking forward to future discussion on this PR, thanks!

@JackismyShephard
Copy link
Author

Hi, see previous comment - Looking forward to future discussion on this PR, thanks!

Sorry for not getting back to you. I am a bit busy this week. Will see if I have proper time to look at this this weekend 😊

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.

2 participants