google / google/google-java-format

String splitting / wrapping can increase line length

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

Descrizione

### Version
1.18.1, all-deps JAR

### Description
In some cases Google Java Format wraps / splits long string literals which exceed the maximum line length in a way which makes the string literal exceed the maximum line length even further.

In those cases maybe it would be better if the string had not been split / wrapped.

### Example
```java
class Test {
void test() {
System.out.println(
"\nSee https://example.com/some-really-long-path-which-exceeds-the-maximum-line-length-of-the-formatter");
}
}
```

The formatted result is:
```java
class Test {
void test() {
System.out.println(
"\n"
+ "See https://example.com/some-really-long-path-which-exceeds-the-maximum-line-length-of-the-formatter");
}
}
```

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.