google / google/google-java-format

Consider exposing option for longer line lengths

Aperta
#425 4 commenti 78 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
6.2k
Fork
937
Merge medio
6m
PR unite (30g)
3

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.