mirror of
https://github.com/kennethreitz/responder.git
synced 2026-06-05 23:00:17 +00:00
Chore: Format code using most recent ruff and pyproject-fmt
This commit is contained in:
committed by
Andreas Motl
parent
6f9c11645a
commit
5730be4b31
+16
-14
@@ -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`.
|
||||
@@ -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 = [
|
||||
@@ -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 = [
|
||||
|
||||
+6
-6
@@ -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()]
|
||||
@@ -241,9 +241,9 @@ class Router:
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user