[clang-format][NFC] Reformat git-clang-format
NOKEYCHECK=True
GitOrigin-RevId: 72540dbe01d143436be096b44deb89e625f350f7
diff --git a/git-clang-format b/git-clang-format
index f907168..e709803 100755
--- a/git-clang-format
+++ b/git-clang-format
@@ -32,9 +32,7 @@
import subprocess
import sys
-usage = (
- "git clang-format [OPTIONS] [<commit>] [<commit>|--staged] [--] [<file>...]"
-)
+usage = "git clang-format [OPTIONS] [<commit>] [<commit>|--staged] [--] [<file>...]"
desc = """
If zero or one commits are given, run clang-format on all lines that differ
@@ -236,10 +234,7 @@
if not opts.diff:
die("--diff is required when two commits are given")
elif opts.diff_from_common_commit:
- die(
- "--diff_from_common_commit is only allowed when two commits are "
- "given"
- )
+ die("--diff_from_common_commit is only allowed when two commits are given")
if os.path.dirname(opts.binary):
opts.binary = os.path.abspath(opts.binary)
@@ -385,10 +380,7 @@
return False
if object_type in ("commit", "tag"):
return True
- die(
- "`%s` is a %s, but a commit or filename was expected"
- % (value, object_type)
- )
+ die("`%s` is a %s, but a commit or filename was expected" % (value, object_type))
def get_object_type(value):
@@ -463,9 +455,7 @@
line_count = 1
if start_line == 0:
continue
- matches.setdefault(filename, []).append(
- Range(start_line, line_count)
- )
+ matches.setdefault(filename, []).append(Range(start_line, line_count))
return matches
@@ -780,13 +770,10 @@
.split("\0")
)
if not force:
- unstaged_files = run(
- "git", "diff-files", "--name-status", *changed_files
- )
+ unstaged_files = run("git", "diff-files", "--name-status", *changed_files)
if unstaged_files:
print(
- "The following files would be modified but have unstaged "
- "changes:",
+ "The following files would be modified but have unstaged changes:",
file=sys.stderr,
)
print(unstaged_files, file=sys.stderr)
@@ -828,17 +815,13 @@
if p.returncode == 0:
if stderr:
if verbose:
- print(
- "`%s` printed to stderr:" % " ".join(args), file=sys.stderr
- )
+ print("`%s` printed to stderr:" % " ".join(args), file=sys.stderr)
print(stderr.rstrip(), file=sys.stderr)
if strip:
stdout = stdout.rstrip("\r\n")
return stdout
if verbose:
- print(
- "`%s` returned %s" % (" ".join(args), p.returncode), file=sys.stderr
- )
+ print("`%s` returned %s" % (" ".join(args), p.returncode), file=sys.stderr)
if stderr:
print(stderr.rstrip(), file=sys.stderr)
sys.exit(2)