diff options
| author | Mike Frysinger <vapier@google.com> | 2023-09-01 13:58:46 -0400 |
|---|---|---|
| committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-09-01 18:08:58 +0000 |
| commit | b861511db919b93483b69136fd0f2c6ddab6b4ea (patch) | |
| tree | f8f584f5a6a18e54e4d95844de5ac1fa6f18b8c4 /run_tests | |
| parent | e914ec293a414dc6cf092c1323c1c059943e706f (diff) | |
| download | git-repo-b861511db919b93483b69136fd0f2c6ddab6b4ea.tar.gz | |
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>
Diffstat (limited to 'run_tests')
| -rwxr-xr-x | run_tests | 10 |
1 files changed, 9 insertions, 1 deletions
| @@ -27,8 +27,16 @@ ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) | |||
| 27 | 27 | ||
| 28 | def run_black(): | 28 | def run_black(): |
| 29 | """Returns the exit code from black.""" | 29 | """Returns the exit code from black.""" |
| 30 | # Black by default only matches .py files. We have to list standalone | ||
| 31 | # scripts manually. | ||
| 32 | extra_programs = [ | ||
| 33 | "repo", | ||
| 34 | "run_tests", | ||
| 35 | "release/update-manpages", | ||
| 36 | ] | ||
| 30 | return subprocess.run( | 37 | return subprocess.run( |
| 31 | [sys.executable, "-m", "black", "--check", ROOT_DIR], check=False | 38 | [sys.executable, "-m", "black", "--check", ROOT_DIR] + extra_programs, |
| 39 | check=False, | ||
| 32 | ).returncode | 40 | ).returncode |
| 33 | 41 | ||
| 34 | 42 | ||
