Skip to content

Commit 1e4f14f

Browse files
taesu82google-java-format Team
authored andcommitted
Support --skip-removing-unused-imports in google-java-format-diff.py
Fixes #495 COPYBARA_INTEGRATE_REVIEW=#495 from taesu82:patch-1 91e32d4 PiperOrigin-RevId: 315560436
1 parent 5202af9 commit 1e4f14f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/google-java-format-diff.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ def main():
5757
help='use AOSP style instead of Google Style (4-space indentation)')
5858
parser.add_argument('--skip-sorting-imports', action='store_true',
5959
help='do not fix the import order')
60+
parser.add_argument('--skip-removing-unused-imports', action='store_true',
61+
help='do not remove ununsed imports')
6062
parser.add_argument('-b', '--binary', help='path to google-java-format binary')
6163
parser.add_argument('--google-java-format-jar', metavar='ABSOLUTE_PATH', default=None,
6264
help='use a custom google-java-format jar')
@@ -112,6 +114,8 @@ def main():
112114
command.append('--aosp')
113115
if args.skip_sorting_imports:
114116
command.append('--skip-sorting-imports')
117+
if args.skip_removing_unused_imports:
118+
command.append('--skip-removing-unused-imports')
115119
command.extend(lines)
116120
command.append(filename)
117121
p = subprocess.Popen(command, stdout=subprocess.PIPE,

0 commit comments

Comments
 (0)