From 24c2e5aeabe3d5cb418a8e370806c3b46dd1d77a Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Wed, 16 Sep 2026 06:01:10 -0700 Subject: [PATCH] Add --google-style to select Google Style --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 --google-style flag, and allow overriding a previously given style. When both --aosp and --google-style are given, the last one wins. Fixes https://github.com/google/google-java-format/pull/1415 FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/google/google-java-format/pull/1415 from hferreiro:no-aosp 0d1c53e5da3e3690346c31d889f28e21b9b2f8f8 PiperOrigin-RevId: 982467851 --- .../java/com/google/googlejavaformat/java/UsageException.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/main/java/com/google/googlejavaformat/java/UsageException.java b/core/src/main/java/com/google/googlejavaformat/java/UsageException.java index 04652e1b0..194254896 100644 --- a/core/src/main/java/com/google/googlejavaformat/java/UsageException.java +++ b/core/src/main/java/com/google/googlejavaformat/java/UsageException.java @@ -19,8 +19,7 @@ /** Checked exception class for formatter command-line usage errors. */ final class UsageException extends Exception { - private static final String DOCS_LINK = - "https://github.com/google/google-java-format"; + private static final String DOCS_LINK = "https://github.com/google/google-java-format"; private static final String USAGE = """