From b861511db919b93483b69136fd0f2c6ddab6b4ea Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 1 Sep 2023 13:58:46 -0400 Subject: 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 Reviewed-by: Gavin Mak Commit-Queue: Mike Frysinger --- run_tests | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'run_tests') diff --git a/run_tests b/run_tests index d61308f6..7307f827 100755 --- a/run_tests +++ b/run_tests @@ -27,8 +27,16 @@ ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) def run_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( - [sys.executable, "-m", "black", "--check", ROOT_DIR], check=False + [sys.executable, "-m", "black", "--check", ROOT_DIR] + extra_programs, + check=False, ).returncode -- cgit v1.2.3-54-g00ecf