mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
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:
parent
e914ec293a
commit
b861511db9
10
run_tests
10
run_tests
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user