From 91e32d443cf8159a72f05a38146dd9b5d4bf550c Mon Sep 17 00:00:00 2001
From: "taesu82.lee" <66580975+taesu82@users.noreply.github.com>
Date: Mon, 8 Jun 2020 11:46:30 +0900
Subject: [PATCH] Support --skip-removing-unused-imports in
 google-java-format-diff.py

---
 scripts/google-java-format-diff.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/google-java-format-diff.py b/scripts/google-java-format-diff.py
index 4c6724b90..1abd037d3 100755
--- a/scripts/google-java-format-diff.py
+++ b/scripts/google-java-format-diff.py
@@ -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')
@@ -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,