fix(format): reformat api_naming_conventions_steps.py with ruff

This commit is contained in:
2026-06-04 19:51:04 -04:00
committed by Forgejo
parent 1a485045cc
commit fb8fdcd5a2
+8 -24
View File
@@ -15,9 +15,7 @@ def step_project_service_available(context):
# Verify the service module exists and has the expected methods
import importlib.util
spec = importlib.util.find_spec(
"cleveragents.application.services.project_service"
)
spec = importlib.util.find_spec("cleveragents.application.services.project_service")
assert spec is not None, "ProjectService module not found"
context.project_service_available = True
context.project_service_module = "cleveragents.application.services.project_service"
@@ -28,9 +26,7 @@ def step_plan_service_available(context):
"""Make plan service available."""
import importlib.util
spec = importlib.util.find_spec(
"cleveragents.application.services.plan_service"
)
spec = importlib.util.find_spec("cleveragents.application.services.plan_service")
assert spec is not None, "PlanService module not found"
context.plan_service_available = True
context.plan_service_module = "cleveragents.application.services.plan_service"
@@ -47,9 +43,7 @@ def step_create_project(context):
with open(spec.origin) as f:
tree = ast.parse(f.read())
method_names = [
node.name
for node in ast.walk(tree)
if isinstance(node, ast.FunctionDef)
node.name for node in ast.walk(tree) if isinstance(node, ast.FunctionDef)
]
assert "create_project" in method_names, (
"ProjectService should have create_project method"
@@ -105,9 +99,7 @@ def step_retrieve_plan_by_name(context):
with open(spec.origin) as f:
tree = ast.parse(f.read())
method_names = [
node.name
for node in ast.walk(tree)
if isinstance(node, ast.FunctionDef)
node.name for node in ast.walk(tree) if isinstance(node, ast.FunctionDef)
]
assert "get_plan_by_name" in method_names or "switch_to_plan" in method_names, (
"PlanService should have get_plan_by_name or switch_to_plan method"
@@ -150,9 +142,7 @@ def step_list_projects(context):
with open(spec.origin) as f:
tree = ast.parse(f.read())
method_names = [
node.name
for node in ast.walk(tree)
if isinstance(node, ast.FunctionDef)
node.name for node in ast.walk(tree) if isinstance(node, ast.FunctionDef)
]
assert "list_projects" in method_names, (
"ProjectService should have list_projects method"
@@ -171,9 +161,7 @@ def step_list_plans(context):
with open(spec.origin) as f:
tree = ast.parse(f.read())
method_names = [
node.name
for node in ast.walk(tree)
if isinstance(node, ast.FunctionDef)
node.name for node in ast.walk(tree) if isinstance(node, ast.FunctionDef)
]
assert "list_plans" in method_names, "PlanService should have list_plans method"
context.list_plans_exists = True
@@ -204,9 +192,7 @@ def step_get_current_project(context):
with open(spec.origin) as f:
tree = ast.parse(f.read())
method_names = [
node.name
for node in ast.walk(tree)
if isinstance(node, ast.FunctionDef)
node.name for node in ast.walk(tree) if isinstance(node, ast.FunctionDef)
]
assert "get_current_project" in method_names, (
"ProjectService should have get_current_project method"
@@ -225,9 +211,7 @@ def step_get_current_plan(context):
with open(spec.origin) as f:
tree = ast.parse(f.read())
method_names = [
node.name
for node in ast.walk(tree)
if isinstance(node, ast.FunctionDef)
node.name for node in ast.walk(tree) if isinstance(node, ast.FunctionDef)
]
assert "get_current_plan" in method_names, (
"PlanService should have get_current_plan method"