-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Latest pre-commit hook is broken when used with --all-files or --files flag using multiple packages #3715
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
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
Related to #3713 |
I worked through building a minimal reproduction with a coworker of mine (attached below in the details block). Notably because of pre-commit semantics it won't trigger unless you've at least staged files for commit. For the repro below you have to: git init
git add .
# continue testing... Some exploration w/ pre-commit config on my side showed:
I hope this is helpful, and thank you for your work on golangci-lint! 🙏 Repro set
|
I updated the PR to add Note: |
Thank you for the clarification, and thank you even more for the fix! |
Welcome
Description of the problem
Since the v1.52.0 release, the included pre-commit hook no longer works with the pre-commit
--all-files
flag or by passing multiple .go files living in different packages with the--files
flag, which severely limits its usefulness.Using v1.51.2:
After v1.52.0:
Note: this issue was pointed out in the MR after it was merged.
Version of golangci-lint
Configuration file
Go environment
Verbose output of running
golangci-lint runs as expected without the
--new-from-rev HEAD
flag specifiedCode example or link to a public repository
n/a
The text was updated successfully, but these errors were encountered: