Enable the RET503 lint in Ruff

This commit is contained in:
Adam Turner committed 2025-01-02 23:49:44 +00:00
1 parent 2aad3a87f4
commit 43bf986891
3 files changed
+4 -3

No files matched your search

+1 -1
View File
@@ -222,7 +222,7 @@ select = [
# flake8-return ('RET')
"RET501", # Do not explicitly `return None` in function if it is the only possible return value
"RET502", # Do not implicitly `return None` in function able to return non-`None` value
# "RET503", # Missing explicit `return` at the end of function able to return non-`None` value
"RET503", # Missing explicit `return` at the end of function able to return non-`None` value
# "RET504", # Unnecessary assignment to `{name}` before `return` statement
# "RET505", # Unnecessary `{branch}` after `return` statement
# "RET506", # Unnecessary `{branch}` after `raise` statement
+1 -1
View File
@@ -1909,7 +1909,7 @@ class DefinitionParser(BaseParser):
self.skip_ws()
if not self.skip_string('<'):
self.fail("Expected '<' after 'template'")
while 1:
while True:
pos = self.pos
err = None
try:
+2 -1
View File
@@ -500,7 +500,7 @@ def custom_handler(
def authenticated(
method: Callable[[CustomHandler], None],
) -> Callable[[CustomHandler], None]:
def method_if_authenticated(self):
def method_if_authenticated(self: CustomHandler) -> None:
if expected_token is None:
return method(self)
elif not self.headers['Authorization']:
@@ -512,6 +512,7 @@ def custom_handler(
self.send_response(403, 'Forbidden')
self.send_header('Content-Length', '0')
self.end_headers()
return None
return method_if_authenticated