Skip to content

Conversation

@IanButterworth
Copy link

On the Pkg repo if I have bad formatting, when I commit the hook will fail but actually fix the formatting, then the 2nd commit will succeed.

I think this fixes the issue, which is that we're not re-staging files after modifying them?

cc. @KristofferC

@fredrikekre
Copy link
Owner

Not sure about this, I think the existing code works the way most other similar pre-commit hooks work, i.e. you have to inspect the changes and stage them yourself.

@IanButterworth
Copy link
Author

I see. I think the thing that's making this awkward for me is that I use GitHub Desktop, which automatically stages files you've selected in the UI when you press commit, and if the commit fails it remembers the ones you've selected. So perhaps it should be unselecting files that have been changed or something.

@IanButterworth
Copy link
Author

Or maybe it's that the hook reports formatting "failed" rather than something like "failed: auto-formatted, review changes"

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