fix black formatting of standalone programs

Black will only check .py files when given a dir and --check, so list
our few standalone programs explicitly.  This causes the repo launcher
to be reformatted since it was missed in the previous mass reformat.

Bug: b/267675342
Change-Id: Ic90a7f5d84fc02e9fccb05945310fd067e2ed764
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/385034
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Mike Frysinger <vapier@google.com>
This commit is contained in:
Mike Frysinger 2023-09-01 13:58:46 -04:00 committed by LUCI
parent e914ec293a
commit b861511db9
2 changed files with 1136 additions and 908 deletions

992
repo

File diff suppressed because it is too large Load Diff

View File

@ -27,8 +27,16 @@ ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
def run_black(): def run_black():
"""Returns the exit code from black.""" """Returns the exit code from black."""
# Black by default only matches .py files. We have to list standalone
# scripts manually.
extra_programs = [
"repo",
"run_tests",
"release/update-manpages",
]
return subprocess.run( return subprocess.run(
[sys.executable, "-m", "black", "--check", ROOT_DIR], check=False [sys.executable, "-m", "black", "--check", ROOT_DIR] + extra_programs,
check=False,
).returncode ).returncode