Skip to content

Commit

Permalink
Chore: Format code using most recent ruff and pyproject-fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jan 18, 2025
1 parent 8e4fab2 commit 484dddd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
30 changes: 16 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ lint.extend-ignore = [
"S101", # Allow use of `assert`.
]

lint.per-file-ignores."responder/util/cmd.py" = [ "A005" ] # Module shadows a Python standard-library module

lint.per-file-ignores."tests/*" = [
"ERA001", # Found commented-out code.
"S101", # Allow use of `assert`, and `print`.
Expand All @@ -69,20 +71,6 @@ markers = [
]
xfail_strict = true

[tool.mypy]
packages = [
"responder",
]
exclude = [
]
check_untyped_defs = true
explicit_package_bases = true
ignore_missing_imports = true
implicit_optional = true
install_types = true
namespace_packages = true
non_interactive = true

[tool.coverage.run]
branch = false
omit = [
Expand All @@ -98,6 +86,20 @@ exclude_lines = [
"raise NotImplemented",
]

[tool.mypy]
packages = [
"responder",
]
exclude = [
]
check_untyped_defs = true
explicit_package_bases = true
ignore_missing_imports = true
implicit_optional = true
install_types = true
namespace_packages = true
non_interactive = true

[tool.poe.tasks]

check = [
Expand Down
12 changes: 6 additions & 6 deletions responder/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def compile_path(path):
for match in PARAM_RE.finditer(path):
param_name, convertor_type = match.groups(default="str")
convertor_type = convertor_type.lstrip(":")
assert (
convertor_type in _CONVERTORS.keys()
), f"Unknown path convertor '{convertor_type}'"
assert convertor_type in _CONVERTORS.keys(), (
f"Unknown path convertor '{convertor_type}'"
)
convertor, convertor_re = _CONVERTORS[convertor_type]

path_re += path[idx : match.start()]
Expand Down Expand Up @@ -241,9 +241,9 @@ def add_route(
return

if check_existing:
assert not self.routes or route not in (
item.route for item in self.routes
), f"Route '{route}' already exists"
assert not self.routes or route not in (item.route for item in self.routes), (
f"Route '{route}' already exists"
)

if default:
self.default_endpoint = endpoint
Expand Down

0 comments on commit 484dddd

Please sign in to comment.