Only reformat modified lines
- Dominant language
- Python
- Stars
- 14k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
For an established project it is difficult to justify a humongous commit with all yapf's changes in one go, so adoption becomes difficult.
A lighter approach would be to instruct authors to use yapf to format only the lines they modified in the commit. This gets most of the advantages (no discussions on style, no need to point out all formatting mistakes), with an easy adoption path (and long term convergence).
Sadly, the only option to limit the scope I see is the range of lines. I assume it would be possible to make a git hook to reformat only changed lines based on that, but it looks very cumbersome. Is this kind of git integration planned, already existing and I missed it, or something you would consider adding?
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.