google / google/google-java-format

Avoid excessive newlines for short variable names with --aosp

Open
#970 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.2k
Forks
937
Avg merge
6m
Merged PRs (30d)
3

Description

I'm trying this out in chromium codebase, and besides the known-issue of excessive lambda whitespace (issue #19), I'm finding the most jarring thing is odd whitespace for variable assignments.

google-java-format does:

```
desc =
getResources()
.getString(R.string.cablev2_error_ble_permission, packageLabel);
```

instead of:
```
desc = getResources()
.getString(R.string.cablev2_error_ble_permission, packageLabel);
```

I'm guessing it might be because with two space indents, the wrapped line appears under the = sign (which looks less weird), but with four space indent, it looks really odd

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.