Draft
Conversation
|
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. |
41a3569 to
8e76277
Compare
8e76277 to
4befa03
Compare
Member
|
Thanks for working on this! I like the direction you're going here. :-) |
Author
|
still working through all the internal hoops to get added to Sony's group that is approved to submit code to Google, but getting closer! Hopefully in next week or so we'll be able to progress on this for real |
This comes from the issue google#844 where logical operators are bin-packed if the line is too long instead of wrapping nicely one to each line
4befa03 to
7ae8aaa
Compare
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.
First time submitting so there's probably a bunch of stuff I'm doing wrong and we'll have to work out the licensing stuff.
This is a PR to handle the issues in #844 where when there is a line that contains logical operators and we split on an operator, we want to split on all operators in that logical line.
I added a new knob to allow this feature to be toggled on. It is off by default for all styles to preserve the existing functioning of the styles.
I haven't pushed up any tests with this, so that will have to happen before this is merged obviously. However as part of my local testing I ran into some edge cases where you had to be able to set
SPLIT_PENALTY_LOGICAL_OPERATORand have it be respected. But the code as it previously existed would ignore penalties if the initial parse set any penalty value even if the desired penalty was higher than what the parse decided on. This prevented the line wrapping from being correct in some extreme edge cases. To get around that, I updated logical line to use the higherSPLIT_PENALTY_LOGICAL_OPERATORbut only in the case where the new knob was turned on. I was hesitant to change the normal (existing) behavior of that method, though I do believe that it probably should be considered at some point because higher penalties should probably propagate.