Skip to content

Fix WrappedJoin leading blank line for oversized items Copy title - #720

Open
MateehUllah wants to merge 2 commits into
google:masterfrom
MateehUllah:fix-705-wrappedjoin-leading-blank
Open

MateehUllah wants to merge 2 commits into
google:masterfrom
MateehUllah:fix-705-wrappedjoin-leading-blank

Conversation

@MateehUllah

Copy link
Copy Markdown

Summary

Fixes #705.

This PR fixes an issue in WrappedJoin where an unnecessary empty line is added when the first item exceeds the specified width.

Changes

  • Updated WrappedJoin to avoid appending an empty line when current_line is empty.
  • Added regression tests for a single oversized item and multiple items where the first exceeds the width.
  • Preserved the existing behavior for normal wrapping and empty input.

Testing

  • Added regression tests in fire/formatting_test.py.
  • Verified the expected behavior for oversized items through isolated checks.
  • The full project test suite has not been run.

Files Changed

  • fire/formatting.py
  • fire/formatting_test.py

@google-cla

google-cla Bot commented Oct 25, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WrappedJoin adds an empty line before an oversized first item

1 participant