mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Enable more SIM ruff rules (#113015)
* SIM101 SIM103 * SIM107 SIM109 * SIM110 * SIM112 SIM113 * SIM115 * SIM116 * Fix * Fix * Fix
This commit is contained in:
committed by
GitHub
parent
e96ef4613c
commit
cddce0ce0d
@ -33,10 +33,7 @@ def _has_function(
|
||||
module: ast.Module, _type: ast.AsyncFunctionDef | ast.FunctionDef, name: str
|
||||
) -> bool:
|
||||
"""Test if the module defines a function."""
|
||||
for item in module.body:
|
||||
if type(item) == _type and item.name == name:
|
||||
return True
|
||||
return False
|
||||
return any(type(item) == _type and item.name == name for item in module.body)
|
||||
|
||||
|
||||
def _has_import(module: ast.Module, name: str) -> bool:
|
||||
|
Reference in New Issue
Block a user