Skip to content
Snippets Groups Projects
Commit 73eee4e3 authored by Antoine Lambert's avatar Antoine Lambert
Browse files

python: Reformat code with black 22.3.0

Related to T3922
parent 3dba5d83
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,10 @@ from swh.core.cli import swh as swh_cli_group
"--config-file",
"-C",
default=None,
type=click.Path(exists=True, dir_okay=False,),
type=click.Path(
exists=True,
dir_okay=False,
),
help="Configuration file.",
)
@click.pass_context
......@@ -83,8 +86,7 @@ def scrubber_cli_group(ctx, config_file: Optional[str]) -> None:
@scrubber_cli_group.group(name="check")
@click.pass_context
def scrubber_check_cli_group(ctx):
"""group of commands which read from data stores and report errors.
"""
"""group of commands which read from data stores and report errors."""
pass
......@@ -140,7 +142,10 @@ def scrubber_check_journal(ctx) -> None:
from .journal_checker import JournalChecker
checker = JournalChecker(db=ctx.obj["db"], journal_client=conf["journal_client"],)
checker = JournalChecker(
db=ctx.obj["db"],
journal_client=conf["journal_client"],
)
checker.run()
......
......@@ -64,7 +64,10 @@ class ScrubberDb(BaseDb):
return id_
def corrupt_object_add(
self, id: CoreSWHID, datastore: Datastore, serialized_object: bytes,
self,
id: CoreSWHID,
datastore: Datastore,
serialized_object: bytes,
) -> None:
datastore_id = self.datastore_get_or_add(datastore)
cur = self.cursor()
......@@ -121,7 +124,10 @@ class ScrubberDb(BaseDb):
return results
def corrupt_object_get(
self, start_id: CoreSWHID, end_id: CoreSWHID, limit: int = 100,
self,
start_id: CoreSWHID,
end_id: CoreSWHID,
limit: int = 100,
) -> List[CorruptObject]:
"""Yields a page of records in the 'corrupt_object' table, ordered by id.
......@@ -182,7 +188,11 @@ class ScrubberDb(BaseDb):
LIMIT %(limit)s
FOR UPDATE SKIP LOCKED
""",
dict(start_id=str(start_id), end_id=str(end_id), limit=limit,),
dict(
start_id=str(start_id),
end_id=str(end_id),
limit=limit,
),
)
return self._corrupt_object_list_from_cursor(cur)
......
......@@ -55,7 +55,9 @@ class StorageChecker:
if isinstance(self.storage, PostgresqlStorage):
with storage_db(self.storage) as db:
self._datastore = Datastore(
package="storage", cls="postgresql", instance=db.conn.dsn,
package="storage",
cls="postgresql",
instance=db.conn.dsn,
)
else:
raise NotImplementedError(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment