openrewrite / openrewrite/rewrite
Support maximum line length / column limits formatting
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 570
- Avg merge
- 13h 12m
- Merged PRs (30d)
- 261
Description
What problem are you trying to solve?
Many style guides such as Google's impost maximum column limits (https://google.github.io/styleguide/javaguide.html#s4.4-column-limit). There is tooling such as Checkstyle that enforces these limits. https://checkstyle.sourceforge.io/checks/sizes/linelength.html . Automated refactoring will fail often due to changes made that trigger checkstyle and other formatting checks.
Describe the solution you'd like
Update formatters to reformat lines to conform to the line length limit.
Examples for strings as here
https://github.com/google/google-java-format/blob/098431221007a0fce1b0d213ded10948087332a4/core/src/main/java/com/google/googlejavaformat/java/StringWrapper.java#L123
Have you considered any alternatives or workarounds?
Additional context
Are you interested in contributing this feature to OpenRewrite?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the linked google-java-format StringWrapper.java example, then locate the formatter implementations and their tests in this repository; the issue names no specific paths. Establish which formatters and line-length behavior are in scope, and verify that formatted output conforms to the requested maximum without breaking existing formatting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100