diff --git a/.ruff.toml b/.ruff.toml index e9f2d8e9f4..6a36a4c82c 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -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 diff --git a/sphinx/domains/cpp/_parser.py b/sphinx/domains/cpp/_parser.py index ac9c8a0ffc..8478230141 100644 --- a/sphinx/domains/cpp/_parser.py +++ b/sphinx/domains/cpp/_parser.py @@ -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: diff --git a/tests/test_builders/test_build_linkcheck.py b/tests/test_builders/test_build_linkcheck.py index c27ad189f3..d35672025b 100644 --- a/tests/test_builders/test_build_linkcheck.py +++ b/tests/test_builders/test_build_linkcheck.py @@ -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