Avoid excessive newlines for short variable names with --aosp
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by locating the formatter logic that handles variable assignments and line wrapping under --aosp. Then find the relevant formatting tests, add a case matching the short-name assignment shown here, and confirm the output keeps the assignment expression together as requested.
Written by the indexing model from the issue text.
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
- Dominant language
- Java
- Stars
- 6.2k
- Forks
- 936
- Avg merge
- 6m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/google-java-format
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google/google-java-format#1094 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
google/google-java-format#1450 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
google/google-java-format#1439 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
google/google-java-format#1436 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
google/google-java-format#1428 · 4 comments ·
All issues in google/google-java-format
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
HL7/fhir-ig-publisher#1375 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Flaky: a relaunched catch-up replay can still report catching up right after its marker is written Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
johanhaleby/occurrent#1134 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
objectionary/jeo-maven-plugin#1811 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100