Repository navigation
blackd-format: label stdin diffs like black, split Result.output, clarify -t - #5778
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the blackd-format diff-label and output-field refinements.
No open issues 🎉
What changed in this PR
This follow-up to #5690 refines the standard-library blackd-format client. The only intended behavior change is matching Black’s stdin diff labels.
Changes:
- Label stdin diffs
STDINandSTDOUT, with regression coverage for diff labels and silent stdout in check mode. - Split
Result.outputinto typeddiffandstdoutfields. - Clarify the
-tversion format and update the existing changelog entry.
| File | Description |
|---|---|
tests/test_blackd_format.py |
Adds stdin diff-label and check-mode stdout tests. |
src/blackd_format/__init__.py |
Updates diff labels, separates result outputs, and clarifies -t help. |
CHANGES.md |
Adds this PR to the existing blackd-format entry. |
Review effort: Balanced
cooperlees
approved these changes
Dec 1, 2026
cooperlees
left a comment
Collaborator
There was a problem hiding this comment.
I agree with copilot - Thanks for the follow up. Appreciate it.
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.
Description
Follow-up to #5690, covering the three nits @cooperlees left as follow-ups there:
STDINlabel in diffs.blackd-format --diff -now labels the two sidesSTDINandSTDOUT, the wayblack --diff -does, instead of-and-.Result.outputsplit in two. It held either a diff (str) or the formatted stdin bytes, and the caller told them apart withisinstance. It is nowdiff: strandstdout: bytes, so each has one type and one use.-thelp text. It now says the version is written black's way,py312, not3.12.No behaviour changes beyond the stdin diff label. Two new tests:
--diff -labels the sidesSTDIN/STDOUT, and--check -writes nothing to stdout (the case the oldisinstancebranch guarded).Checklist - did you ...
--previewstyle, following the stability policy? (no style changes)CHANGES.mdif necessary? (this PR's number added to the existingblackd-formatline, since it isn't released yet)I use Claude Code when working on patches; I reviewed and tested everything here before opening the PR.
🤖 Generated with Claude Code