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

Removed the ridiculous chopping down of binary expressions #13

Merged
merged 1 commit into from
Jun 17, 2015

Conversation

rynkowsg
Copy link
Contributor

I propose "Wrap if long", as below:

int x =
        (3 + 4 + 5 + 6) * (7 + 8 + 9
            + 10) * (11 + 12 + 13
            + 14 + 0xFFFFFFFF);

instead of

int x = (3 + 4 + 5 + 6) * (7
        + 8
        + 9
        + 10) * (11
        + 12
        + 13
        + 14
        + 0xFFFFFFFF);

(above examples assume that line has max. 37 characters)

@JakeWharton
Copy link
Collaborator

Man it'd be cool if we could unit test these styles somehow... like open pre-determined files, format, and capture screenshots.

In any case, what is the value for Square.xml? They should probably match.

@rynkowsg
Copy link
Contributor Author

In samples I used code from Idea's Code Style preview. The comparison was my first concept. I have no idea how to unit test styles.

The style at Square.xml doesn't wrap binary expressions at all. I can prepare change that consists also Square.xml.

@JakeWharton
Copy link
Collaborator

Tested this out. It looks good. Thanks.

JakeWharton added a commit that referenced this pull request Jun 17, 2015
Removed the ridiculous chopping down of binary expressions
@JakeWharton JakeWharton merged commit 9cd6675 into square:master Jun 17, 2015
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.

2 participants