Skip to content

Commit cfd66b2

Browse files
jpd236cushon
authored andcommitted
Add --skip-sorting-imports support to the diff helper.
1 parent b6d5a12 commit cfd66b2

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
@@ -53,6 +53,8 @@ def main():
5353
help='be more verbose, ineffective without -i')
5454
parser.add_argument('-a', '--aosp', action='store_true',
5555
help='use AOSP style instead of Google Style (4-space indentation)')
56+
parser.add_argument('--skip-sorting-imports', action='store_true',
57+
help='do not fix the import order')
5658
args = parser.parse_args()
5759

5860
# Extract changed lines for each file.
@@ -94,6 +96,8 @@ def main():
9496
command.append('-i')
9597
if args.aosp:
9698
command.append('--aosp')
99+
if args.skip_sorting_imports:
100+
command.append('--skip-sorting-imports')
97101
command.extend(lines)
98102
command.append(filename)
99103
p = subprocess.Popen(command, stdout=subprocess.PIPE,

0 commit comments

Comments
 (0)