Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#118)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.1 → v0.4.4](astral-sh/ruff-pre-commit@v0.4.1...v0.4.4)
- [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](pre-commit/mirrors-mypy@v1.9.0...v1.10.0)

* Fixed pre-commit errors

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Grönholm <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and agronholm authored May 14, 2024
1 parent bc07b41 commit 10f81bd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
rev: v0.4.4
hooks:
- id: ruff
args: [--fix, --show-fixes]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.10.0
hooks:
- id: mypy
additional_dependencies: ["pytest"]
3 changes: 1 addition & 2 deletions src/asphalt/core/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ def run_complete(f: Future[int | None]) -> None:
sys.exit(1)
elif retval is not None:
warn(
"run() must return an integer or None, not %s"
% qualified_name(retval.__class__)
f"run() must return an integer or None, not {qualified_name(retval.__class__)}"
)
sys.exit(1)
else:
Expand Down
4 changes: 2 additions & 2 deletions src/asphalt/core/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ def generate_value(self, ctx: Context) -> Any:
def __repr__(self) -> str:
typenames = ", ".join(qualified_name(cls) for cls in self.types)
value_repr = (
"factory=%s" % callable_name(self.value_or_factory)
f"factory={callable_name(self.value_or_factory)}"
if self.is_factory
else "value=%r" % self.value_or_factory
else f"value={self.value_or_factory!r}"
)
return (
f"{self.__class__.__name__}({value_repr}, types=[{typenames}], name={self.name!r}, "
Expand Down
8 changes: 4 additions & 4 deletions tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,8 @@ def runs_in_default_worker() -> None:
await runs_in_default_worker()

exc.match(
r"the first positional argument to %s\(\) has to be a Context instance"
% callable_name(runs_in_default_worker)
rf"the first positional argument to "
rf"{callable_name(runs_in_default_worker)}\(\) has to be a Context instance"
)


Expand Down Expand Up @@ -640,8 +640,8 @@ async def start(ctx: Context) -> None:
await start(None)

exc.match(
r"the first positional argument to %s\(\) has to be a Context instance"
% callable_name(start)
rf"the first positional argument to {callable_name(start)}\(\) has to be a "
rf"Context instance"
)

@pytest.mark.asyncio
Expand Down

0 comments on commit 10f81bd

Please sign in to comment.