pre-commit hook for `./x.py fmt` appears to not always know which files were changed.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this PR: https://github.com/rust-lang/rust/pull/125283 (original push was just the first two commits, which have invalid formatting)
I expected to see this happen: git push pre-commit-hook should have noticed that the formatting for library/alloc/src/sync.rs was invalid in the pre-commit hook.
Instead, this happened: The push completed successfully.
I haven't been able to reproduce the issue (intentionally trying to push code with invalid formatting is caught by the pre-commit-hook in the times I've tried since).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the pre-commit hook and the ./x.py fmt command, using the invalid formatting in library/alloc/src/sync.rs described in PR 125283 as the test case. Reproduce the push behavior and compare it with cases where the hook detects changed files; done means the hook consistently notices invalid formatting before the push completes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100