Skip to content

Commit

Permalink
Support --skip-removing-unused-imports in google-java-format-diff.py
Browse files Browse the repository at this point in the history
  • Loading branch information
taesu82 authored Jun 8, 2020
1 parent 5202af9 commit 91e32d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/google-java-format-diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def main():
help='use AOSP style instead of Google Style (4-space indentation)')
parser.add_argument('--skip-sorting-imports', action='store_true',
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('-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 @@ -112,6 +114,8 @@ def main():
command.append('--aosp')
if args.skip_sorting_imports:
command.append('--skip-sorting-imports')
if args.skip_removing_unused_imports:
command.append('--skip-removing-unused-imports')
command.extend(lines)
command.append(filename)
p = subprocess.Popen(command, stdout=subprocess.PIPE,
Expand Down

0 comments on commit 91e32d4

Please sign in to comment.