Format codebase with black and check formatting in CQ

Apply rules set by https://gerrit-review.googlesource.com/c/git-repo/+/362954/ across the codebase and fix any lingering errors caught
by flake8. Also check black formatting in run_tests (and CQ).

Bug: b/267675342
Change-Id: I972d77649dac351150dcfeb1cd1ad0ea2efc1956
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/363474
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
This commit is contained in:
Gavin Mak
2023-03-11 06:46:20 +00:00
committed by LUCI
parent 1604cf255f
commit ea2e330e43
79 changed files with 19698 additions and 16679 deletions

18
repo
View File

@ -506,10 +506,10 @@ def gitc_parse_clientdir(gitc_fs_path):
"""Parse a path in the GITC FS and return its client name.
Args:
gitc_fs_path: A subdirectory path within the GITC_FS_ROOT_DIR.
gitc_fs_path: A subdirectory path within the GITC_FS_ROOT_DIR.
Returns:
The GITC client name.
The GITC client name.
"""
if gitc_fs_path == GITC_FS_ROOT_DIR:
return None
@ -942,14 +942,14 @@ def resolve_repo_rev(cwd, committish):
* xxx: Branch or tag or commit.
Args:
cwd: The git checkout to run in.
committish: The REPO_REV argument to resolve.
cwd: The git checkout to run in.
committish: The REPO_REV argument to resolve.
Returns:
A tuple of (remote ref, commit) as makes sense for the committish.
For branches, this will look like ('refs/heads/stable', <revision>).
For tags, this will look like ('refs/tags/v1.0', <revision>).
For commits, this will be (<revision>, <revision>).
A tuple of (remote ref, commit) as makes sense for the committish.
For branches, this will look like ('refs/heads/stable', <revision>).
For tags, this will look like ('refs/tags/v1.0', <revision>).
For commits, this will be (<revision>, <revision>).
"""
def resolve(committish):
ret = run_git('rev-parse', '--verify', '%s^{commit}' % (committish,),
@ -1104,7 +1104,7 @@ class Requirements(object):
"""Initialize.
Args:
requirements: A dictionary of settings.
requirements: A dictionary of settings.
"""
self.requirements = requirements