google / google/google-java-format

Consider exposing option for longer line lengths

オープン
#425 コメント 4 件 リアクション 78 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
6.2k
フォーク
937
平均マージ
6分
マージ済み PR(30日)
3

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。