From bf5ef1c5de94fd623025e24b99ceadf18e83d8a5 Mon Sep 17 00:00:00 2001 From: Dmytro Sych Date: Fri, 23 Jul 2021 16:34:11 -0700 Subject: [PATCH] Allowing to turn off java doc formatting `google-java-format-diff.py` is missing a flag to turn off java docs formatting, which is present on the main jar. This pr introduces this flag: `--skip-docs` Fixes #571 COPYBARA_INTEGRATE_REVIEW=https://github.com/google/google-java-format/pull/571 from dsych:missing-docs-switch 9657b75195c1053ae93c022d34bc35b651d412aa PiperOrigin-RevId: 386554591 --- scripts/google-java-format-diff.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/google-java-format-diff.py b/scripts/google-java-format-diff.py index 1abd037d3..63685aac3 100755 --- a/scripts/google-java-format-diff.py +++ b/scripts/google-java-format-diff.py @@ -59,6 +59,11 @@ def main(): help='do not fix the import order') parser.add_argument('--skip-removing-unused-imports', action='store_true', help='do not remove ununsed imports') + parser.add_argument( + '--skip-javadoc-formatting', + action='store_true', + default=False, + help='do not reformat javadoc') parser.add_argument('-b', '--binary', help='path to google-java-format binary') parser.add_argument('--google-java-format-jar', metavar='ABSOLUTE_PATH', default=None, help='use a custom google-java-format jar') @@ -116,6 +121,8 @@ def main(): command.append('--skip-sorting-imports') if args.skip_removing_unused_imports: command.append('--skip-removing-unused-imports') + if args.skip_javadoc_formatting: + command.append('--skip-javadoc-formatting') command.extend(lines) command.append(filename) p = subprocess.Popen(command, stdout=subprocess.PIPE,