Docs: add CONTRIBUTING guideline against incidental reformatting/refactoring#1198
Merged
tamirdresher merged 3 commits intoJun 5, 2026
Merged
Conversation
Add a 'Scoped Changes & Diff Hygiene' section to CONTRIBUTING.md instructing contributors to keep changes scoped, avoid incidental reformatting/refactoring of unrelated content, preserve existing line endings (core.autocrlf caveat), split genuine reformats into dedicated PRs, and sanity-check the diff before pushing. Closes bradygaster#1197 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an explicit Scoped Changes & Diff Hygiene section to
CONTRIBUTING.mdinstructing contributors not to reformat, re-indent, change line endings, or refactor unrelated parts of a file when making a scoped change. Incidental formatting changes make a small edit appear as a whole-file rewrite, which makes review very hard and can hide the real change.Background
This came up during work on #1196, where
core.autocrlf=truenormalized a file's committed line endings, rewriting every line and turning an ~18-line addition into a 122/104 diff until the endings were restored. This PR captures the general lesson so it doesn't recur.Changes
## Scoped Changes & Diff Hygienesection inCONTRIBUTING.mdcovering:core.autocrlfcaveat +.gitattributesguidance)git diff --stat/--numstatbefore pushingScope
CONTRIBUTING.md). No product source changes, so no changeset required.Closes #1197