Skip to content

Commit

Permalink
Allowing to turn off java doc formatting
Browse files Browse the repository at this point in the history
`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=#571 from dsych:missing-docs-switch 9657b75
PiperOrigin-RevId: 386554591
  • Loading branch information
dsych authored and google-java-format Team committed Jul 23, 2021
1 parent 165c106 commit bf5ef1c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/google-java-format-diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit bf5ef1c

Please sign in to comment.