Skip to content

Commit

Permalink
Reformat the code base with black 24.2
Browse files Browse the repository at this point in the history
And adjust flake8 configuration accordingly.
  • Loading branch information
dlax committed Feb 21, 2024
1 parent 283203b commit 2d45475
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
14 changes: 6 additions & 8 deletions pgtoolkit/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,21 @@ def __exit__(self, *a: Any) -> None:


@overload
def open_or_return(fo_or_path: None, mode: str = "r") -> NoReturn:
...
def open_or_return(fo_or_path: None, mode: str = "r") -> NoReturn: ...


@overload
def open_or_return(fo_or_path: str, mode: str = "r") -> IO[str]:
...
def open_or_return(fo_or_path: str, mode: str = "r") -> IO[str]: ...


@overload
def open_or_return(fo_or_path: Path, mode: str = "r") -> IO[str]:
...
def open_or_return(fo_or_path: Path, mode: str = "r") -> IO[str]: ...


@overload
def open_or_return(fo_or_path: IO[str], mode: str = "r") -> PassthroughManager[IO[str]]:
...
def open_or_return(
fo_or_path: IO[str], mode: str = "r"
) -> PassthroughManager[IO[str]]: ...


def open_or_return(
Expand Down
2 changes: 1 addition & 1 deletion pgtoolkit/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"""


import contextlib
import copy
import enum
Expand Down Expand Up @@ -462,6 +461,7 @@ class Configuration:
.. automethod:: save
""" # noqa

lines: list[str]
entries: dict[str, Entry]
path: Optional[str]
Expand Down
6 changes: 2 additions & 4 deletions pgtoolkit/ctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def __call__(
capture_output: bool = False,
check: bool = False,
**kwargs: Any,
) -> CompletedProcess:
...
) -> CompletedProcess: ...


class AsyncCommandRunner(Protocol):
Expand All @@ -71,8 +70,7 @@ async def __call__(
capture_output: bool = False,
check: bool = False,
**kwargs: Any,
) -> CompletedProcess:
...
) -> CompletedProcess: ...


def run_command(
Expand Down
1 change: 0 additions & 1 deletion pgtoolkit/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"""


import os
import sys
from collections.abc import Iterable, MutableMapping
Expand Down
2 changes: 1 addition & 1 deletion requirements-ci.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black>=23.1.0
black>=24.2.0
check-manifest
codecov
docutils
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ ignore =
E501,
# missing whitespace around arithmetic operator
E226,
# multiple statements on one line (def)
E704,
# line break before binary operator
W503,

Expand Down

0 comments on commit 2d45475

Please sign in to comment.