google / google/google-java-format

Consider exposing option for longer line lengths

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

Description

While not Google's style, several other companies and projects prefer longer line length than 100 chars. My current team evaluated google-java-format, and the most contention issue was the line length being too short. I feel like the majority of the value of the formatter has been lost over this one point.

For programmers with wider monitors (more and more common these days), the 100 char line limit results in a lot of wasted space. The main benefits of the shorter line length seem to be for people looking at two pages of code side by side. However, this is not a frequent activity, and code is normally viewed one page width at a time.

I don't think the line length that google-java-format uses needs to be general purpose. I propose 120 as a straw-man. Popular projects, such as Spring and Netty use 120 chars. GitHub adds a horizontal scrollbar after 120 too. I think such projects would be much more amenable to using this formatter if there was a `--long-lines` option, similar to the `--aosp` option.

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.