Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String splitting / wrapping can increase line length #989

Open
Marcono1234 opened this issue Nov 14, 2023 · 0 comments
Open

String splitting / wrapping can increase line length #989

Marcono1234 opened this issue Nov 14, 2023 · 0 comments

Comments

@Marcono1234
Copy link

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

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:

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");
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant