Skip to content

Commit

Permalink
Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
smk4664 committed Jan 2, 2025
1 parent 5a97a30 commit 0537d48
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pylint_nautobot/q_search_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ def __init__(self, *args, **kwargs):

def visit_classdef(self, node: ClassDef):
"""Visit class definitions."""
if all(
ancestor.qname() not in self.meta_classes
for ancestor in node.ancestors()
):
if all(ancestor.qname() not in self.meta_classes for ancestor in node.ancestors()):
return

for child_node in node.get_children():
if isinstance(child_node, Assign) and any(isinstance(target, AssignName) and target.name == "q" for target in child_node.targets):
if isinstance(child_node, Assign) and any(
isinstance(target, AssignName) and target.name == "q" for target in child_node.targets
):
child_node_name = child_node.value.func.as_string().split(".")[-1]
if child_node_name != "SearchFilter":
self.add_message("nb-use-search-filter", node=child_node)

0 comments on commit 0537d48

Please sign in to comment.