Skip to content

Add --style to select the formatting style - #1415

Open
hferreiro wants to merge 1 commit into
google:masterfrom
hferreiro:no-aosp
Open

Add --style to select the formatting style#1415
hferreiro wants to merge 1 commit into
google:masterfrom
hferreiro:no-aosp

Conversation

@hferreiro

@hferreiro hferreiro commented Jul 13, 2026

Copy link
Copy Markdown

--aosp was the only style switch, with no way to select Google Style once it had been passed. Wrapper scripts such as Chromium's google-java-format launcher append --aosp unconditionally, leaving projects that format through them no way to opt back into Google Style.

Add a --style=<google|aosp> flag, and allow overriding a previously given style. --aosp is kept as an alias for --style=aosp.

@cushon

cushon commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Thanks, this looks fine.

One minor question: WDYT about --google-style or something like that instead of --no-aosp? I don't think we're expecting to add more styles here, and the behaviour would be the same, I just wonder if it's slightly clearer.

--aosp was the only style switch, with no way to select Google Style once it had
been passed. Wrapper scripts such as Chromium's google-java-format launcher
append --aosp unconditionally, leaving projects that format through them no way
to opt back into Google Style.

Add a --style=<google|aosp> flag, and allow overriding a previously given style.
--aosp is kept as an alias for --style=aosp.
@hferreiro hferreiro changed the title Add --no-aosp flag to select Google Style Add --style to select the formatting style Sep 2, 2026
@hferreiro

Copy link
Copy Markdown
Author

Hey @cushon, what do you think about the latest update? I followed clang-format and added a --style= flag instead, while keeping --aosp for backwards compatibility.

I'll go with --google-style if that's preferred.

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.

2 participants