Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: don't inline level prefix if breaks occurred inside #85

Merged
merged 3 commits into from
Nov 27, 2019

Conversation

dansanduleac
Copy link
Contributor

@dansanduleac dansanduleac commented Nov 27, 2019

Before this PR

A level managed to get itself "inlined" as far as the formatter was concerned, even though a break was snuck in inside one of its inner levels.

After this PR

==COMMIT_MSG==
When inlining a level's leading docs, check that no breaks were introduced more robustly.

We already did some validation that the leading docs
(1) don't contain forced breaks, and
(2) can fit onto the current line
However with the new logic added in #71, inner levels might decide to break even when the above two conditions are satisfied.

We guard against this by checking whether the state after the inlining of leading docs has recorded new lines, which would be caused by an inner break being taken.
==COMMIT_MSG==

Possible downsides?

@bulldozer-bot bulldozer-bot bot merged commit f64dd35 into develop Nov 27, 2019
@bulldozer-bot bulldozer-bot bot deleted the ds/fix-cjr-1285-1-bug branch November 27, 2019 16:57
@svc-autorelease
Copy link
Collaborator

Released 0.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants