Formatting changes from feature/test-cleanup #432
Closed
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.
Various Black formatting changes. Black takes a philosophical stance against range formatting, so formatting just my section of code is harder.
The diff on
feature/test-cleanup
was cluttered with unrelated formatting changes that were mixed in with other commits. For reference, my painful, roundabout process for "moving" those changes out wholesale was:git diff origin/develop HEAD > changes.patch
to get a patch file of all changes made sincegit apply -R changes.patch
, where-R
applies the patch file as a "reset" (or "reverse"), to create a set of unstaged changes that would negate the diff of the PR if committed. This commit wouldn't actually "undo" the changes because history is preserved, but the result is the same. If we use the equality1 + 2 + 3 + -6 = 0
as an analogy, these changes are the 6.git add --patch
to selectively stage formatting removal changesgit diff --staged -R > formatting.patch
to get an inverted patch file that adds formatting changes.git diff --staged
shows us all of the formatting changes we staged to remove, sogit diff --staged -R
reverses that.git checkout HEAD .
to get rid of remaining unstaged changes onfeature/test-cleanup
git checkout -b test-cleanup-formatting
to create a new branch off offeature/test-cleanup
git apply formatting.patch
to apply formatting changes + stage + commitIf you see something that could have been done more simply (besides making more specific commits in the first place), let me know in a comment.