Skip to content

Add a --cleanup option and an AST cleanup pass with brace insertion. - #1492

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_993144268
Oct 22, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_993144268

Conversation

@copybara-service

Copy link
Copy Markdown

Add a --cleanup option and an AST cleanup pass with brace insertion.

Add the --cleanup[=(true|false)] command-line flag and JavaFormatterOptions.Builder.cleanup(boolean) option (defaulting to true) to gate non-whitespace AST cleanups. Introduce an AST cleanup pass (CleanupScanner) that inserts braces around single-statement control flow bodies (if, else, for, do, while).

Add the `--cleanup[=(true|false)]` command-line flag and `JavaFormatterOptions.Builder.cleanup(boolean)` option (defaulting to true) to gate non-whitespace AST cleanups. Introduce an AST cleanup pass (`CleanupScanner`) that inserts braces around single-statement control flow bodies (`if`, `else`, `for`, `do`, `while`).

PiperOrigin-RevId: 1004545653
@copybara-service
copybara-service Bot merged commit 5eb4f96 into master Oct 22, 2026
3 checks passed
@copybara-service
copybara-service Bot deleted the test_993144268 branch October 22, 2026 07:19
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

Successfully merging this pull request may close these issues.

1 participant