Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Prev Previous commit
Next Next commit
check for idom.component instead of just idom
  • Loading branch information
Archmonger authored and rmorshea committed Aug 24, 2022
commit 0d19b5bf8c196c890f9102c942f24ad612659ccf
5 changes: 4 additions & 1 deletion flake8_idom_hooks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ def is_hook_def(node: ast.FunctionDef) -> bool:


def is_component_def(node: ast.FunctionDef) -> bool:
return any(decorator.value.id == "idom" for decorator in node.decorator_list)
return any(
decorator.value.id == "idom" and decorator.attr == "component"
for decorator in node.decorator_list
)


def is_hook_function_name(name: str) -> bool:
Expand Down