scripts: reformat files tripping docstring-section-indent
This is done with a patch to the "pyformat" tool, which also
improves some handling of long string literals in a way that
is compatible with Black.
BUG=b:233893248
TEST=cros lint + CQ
Change-Id: Iafd4a27f4843927f2881f48002c29401e37a6790
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4564454
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Tested-by: Trent Apted <tapted@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
diff --git a/scripts/gerrit.py b/scripts/gerrit.py
index 1a37ef8..92eb948 100644
--- a/scripts/gerrit.py
+++ b/scripts/gerrit.py
@@ -206,11 +206,11 @@
"""Auto pick the right gerrit instance based on the |cl|
Args:
- opts: The general options object.
- cl: A CL taking one of the forms: 1234 *1234 chromium:1234
+ opts: The general options object.
+ cl: A CL taking one of the forms: 1234 *1234 chromium:1234
Returns:
- A tuple of a gerrit object and a sanitized CL #.
+ A tuple of a gerrit object and a sanitized CL #.
"""
gob = opts.gob
if cl is not None:
@@ -386,8 +386,7 @@
parser.add_argument(
"--sort",
default="number",
- help='Key to sort on (number, project); use "unsorted" '
- "to disable",
+ help='Key to sort on (number, project); use "unsorted" to disable',
)
parser.add_argument(
"-b", "--branch", help="Limit output to the specific branch"
@@ -461,14 +460,15 @@
"""Runs breadth first search starting from the nodes in |to_visit|
Args:
- to_visit: the starting nodes
- children: a function which takes a node and returns the adjacent nodes
- visited_key: a function for deduplicating node visits. Defaults to the
- identity function (lambda x: x)
+ to_visit: the starting nodes
+ children: a function which takes a node and returns the adjacent nodes
+ visited_key: a function for deduplicating node visits. Defaults to the
+ identity function (lambda x: x)
Returns:
- A list of nodes which are reachable from any node in |to_visit| by calling
- |children| any number of times.
+ A list of nodes which are reachable from any node in |to_visit| by
+ calling
+ |children| any number of times.
"""
to_visit = list(to_visit)
seen = set(visited_key(x) for x in to_visit)
@@ -1297,8 +1297,8 @@
"""Get all the possible actions we support.
Returns:
- An ordered dictionary mapping the user subcommand (e.g. "foo") to the
- function that implements that command (e.g. UserActFoo).
+ An ordered dictionary mapping the user subcommand (e.g. "foo") to the
+ function that implements that command (e.g. UserActFoo).
"""
VALID_NAME = re.compile(r"^[a-z][a-z-]*[a-z]$")
@@ -1417,7 +1417,7 @@
"-g",
"--gob",
default=site_params.EXTERNAL_GOB_INSTANCE,
- help=("Gerrit (on borg) instance to query " "(default: %(default)s)"),
+ help="Gerrit (on borg) instance to query (default: %(default)s)",
)
group = parser.add_argument_group("CL options")