Skip to content

line wrap at 90 chars, instead of 120 #427

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

Closed
RZXQ opened this issue Nov 5, 2024 · 8 comments
Closed

line wrap at 90 chars, instead of 120 #427

RZXQ opened this issue Nov 5, 2024 · 8 comments

Comments

@RZXQ
Copy link

RZXQ commented Nov 5, 2024

The source formatter uses 120 chars for wrapping. This aims to strike a balance between making use of available horizontal space in your IDE and avoiding unwanted additional wrapping when viewing code on GitHub and the like.

but it seems in both intellij and vscode, the line breaks at 90 chars

@wilkinsona
Copy link
Contributor

It was a conscious decision to move from 90 chars to 120 and it's unlikely that we'll drop back to 90 again.

but it seems in both intellij and vscode, the line breaks at 90 chars

When configured to use this formatter, both IntelliJ and vscode should honor its 120 char line width. Is that not what you're seeing?

@RZXQ
Copy link
Author

RZXQ commented Nov 8, 2024

I'm afraid not, the line indeed breaks at col 90, I'm using IntelliJ along with the formatter for a Java project, not using Maven or Gradle

@wilkinsona
Copy link
Contributor

wilkinsona commented Nov 8, 2024

Given that you're not using Maven or Gradle, do you have the .springjavaformatconfig file that is required to activate the formatter? The status bar should indicate if the formatter's active.

If you believe that the required file's in place but the formatter's not active, or the formatter's active but it's not formatting the code as expected, please share a minimal IntelliJ project that reproduces the problem and we can take a look.

@RZXQ
Copy link
Author

RZXQ commented Nov 9, 2024

CleanShot 2024-11-10 at 00 20 05@2x
CleanShot 2024-11-10 at 00 17 12@2x

@philwebb
Copy link
Contributor

philwebb commented Nov 9, 2024

We still wrap javadoc and comments at 90 chars (see this part of the config). This was an intentional choice since we thought it would be useful to still have readable javadoc on smaller screens. I'm not totally sure that we should change it at this point, although it is a little inconsistent with the code wrapping.

@RZXQ
Copy link
Author

RZXQ commented Nov 10, 2024

Thanks

@RZXQ RZXQ closed this as completed Nov 10, 2024
@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2024
@andreasevers
Copy link

andreasevers commented May 6, 2025

We still wrap javadoc and comments at 90 chars (see this part of the config). This was an intentional choice since we thought it would be useful to still have readable javadoc on smaller screens. I'm not totally sure that we should change it at this point, although it is a little inconsistent with the code wrapping.

@philwebb is it possible to overwrite this setting in IntelliJ to align with the 120 chars?

@philwebb
Copy link
Contributor

philwebb commented May 6, 2025

@andreasevers, only by forking the project I'm afraid. We're intentionally trying to limit the configuration options we support. From the README:

Since the aim of this project is to provide consistency, each plugin is not generally configurable. You need to change your code to match the required conventions. You can’t configure the plugin conventions to match your style!

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

4 participants