Revert "pass -sort-includes to clang-format-diff.py by default"

This reverts commit 764c8c0616.

Reason for revert: Please find https://g-issues.chromium.org/issues/402201301#comment10

Original change's description:
> pass -sort-includes to clang-format-diff.py by default
>
> clang-format-diff takes a diff output as input, and formats
> the input file, but the changed lines only.
>
> In crbug.com/402201301, it was found that it sometimes breaks
> includes grouping because it tries to format the changed include
> lines only.
>
> This CL is to pass "-sort-includes" to clang-format-diff.py so that
> it always formats the include blocks, even if they are not part of
> the changes included.
> https://source.chromium.org/chromium/chromium/src/+/main:third_party/clang-format/script/clang-format-diff.py;l=70-75;drc=d2bee6477349e500ed274b15a9da8e062a0fcf27
>
> Bug: 402201301
> Change-Id: I214ae15202469dd5c7d55c2eb43c4cce39ad731b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6343956
> Commit-Queue: Scott Lee <ddoman@chromium.org>
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>

Bug: 402201301
Change-Id: Ibfc70b68a9153d242bc011dfe17a73d671760842
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6355303
Commit-Queue: Scott Lee <ddoman@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
changes/03/6355303/2
Scott Lee 3 months ago committed by LUCI CQ
parent ab918ca0bc
commit 330c155fd0

@ -6694,7 +6694,7 @@ def _RunClangFormatDiff(opts, clang_diff_files, top_dir, upstream_commit):
except clang_format.NotFoundError as e:
DieWithError(e)
cmd = ['vpython3', script, '-sort-includes', '-p0']
cmd = ['vpython3', script, '-p0']
if not opts.dry_run and not opts.diff:
cmd.append('-i')

Loading…
Cancel
Save