diff --git a/pyproject.toml b/pyproject.toml index 77b722d..82e06b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ diff --git a/responder/routes.py b/responder/routes.py index 7a9a866..b78aeae 100644 --- a/responder/routes.py +++ b/responder/routes.py @@ -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