Open
Description
Your feature request related to a problem? Please describe.
I use golangci-lint in pre-commit hooks and without adding a custom script to first stash unstaged changes this results in the pre-commit hook failing if there are issues in unstaged code.
Describe the solution you'd like.
A new flag --staged
which ignores all issues that are not in staged changes.
Describe alternatives you've considered.
A custom pre-commit script which first stashes the changes e.g.
git stash --keep-index --include-untracked --quiet
exitCode=0
golangci-lint run || exitCode=$?
git stash pop --quiet
exit $exitCode
The problem with this solution is that it can result in the loss of what is currently staged and what isn't.
Additional context.
No response