[ruff] Enable SIM rules and fix code simplification violations (#9872)

This commit is contained in:
J. Nick Koston authored and GitHub committed 2025-07-25 18:26:08 +12:00
1 parent cb87f156d0
commit ffebd30033
72 files changed
+400 -432

No files matched your search

+1 -4
View File
@@ -1037,10 +1037,7 @@ class MockObjClass(MockObj):
def inherits_from(self, other: "MockObjClass") -> bool:
if str(self) == str(other):
return True
for parent in self._parents:
if str(parent) == str(other):
return True
return False
return any(str(parent) == str(other) for parent in self._parents)
def template(self, *args: SafeExpType) -> "MockObjClass":
if len(args) != 1 or not isinstance(args[0], TemplateArguments):