refactor(types): auto -> None sweep across entire codebase
Applied 236 return type annotations to functions with no return values across 100+ files (core modules, tests, scripts, simulations). Added Phase 4 to python_style_refactor track for remaining 597 items (untyped params, vars, and functions with return values). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import pytest
|
||||
from models import Ticket
|
||||
from dag_engine import TrackDAG
|
||||
|
||||
def test_get_ready_tasks_linear():
|
||||
def test_get_ready_tasks_linear() -> None:
|
||||
t1 = Ticket(id="T1", description="Task 1", status="completed", assigned_to="worker")
|
||||
t2 = Ticket(id="T2", description="Task 2", status="todo", assigned_to="worker", depends_on=["T1"])
|
||||
t3 = Ticket(id="T3", description="Task 3", status="todo", assigned_to="worker", depends_on=["T2"])
|
||||
@@ -11,7 +11,7 @@ def test_get_ready_tasks_linear():
|
||||
assert len(ready) == 1
|
||||
assert ready[0].id == "T2"
|
||||
|
||||
def test_get_ready_tasks_branching():
|
||||
def test_get_ready_tasks_branching() -> None:
|
||||
t1 = Ticket(id="T1", description="Task 1", status="completed", assigned_to="worker")
|
||||
t2 = Ticket(id="T2", description="Task 2", status="todo", assigned_to="worker", depends_on=["T1"])
|
||||
t3 = Ticket(id="T3", description="Task 3", status="todo", assigned_to="worker", depends_on=["T1"])
|
||||
@@ -21,19 +21,19 @@ def test_get_ready_tasks_branching():
|
||||
ready_ids = {t.id for t in ready}
|
||||
assert ready_ids == {"T2", "T3"}
|
||||
|
||||
def test_has_cycle_no_cycle():
|
||||
def test_has_cycle_no_cycle() -> None:
|
||||
t1 = Ticket(id="T1", description="Task 1", status="todo", assigned_to="worker")
|
||||
t2 = Ticket(id="T2", description="Task 2", status="todo", assigned_to="worker", depends_on=["T1"])
|
||||
dag = TrackDAG([t1, t2])
|
||||
assert not dag.has_cycle()
|
||||
|
||||
def test_has_cycle_direct_cycle():
|
||||
def test_has_cycle_direct_cycle() -> None:
|
||||
t1 = Ticket(id="T1", description="Task 1", status="todo", assigned_to="worker", depends_on=["T2"])
|
||||
t2 = Ticket(id="T2", description="Task 2", status="todo", assigned_to="worker", depends_on=["T1"])
|
||||
dag = TrackDAG([t1, t2])
|
||||
assert dag.has_cycle()
|
||||
|
||||
def test_has_cycle_indirect_cycle():
|
||||
def test_has_cycle_indirect_cycle() -> None:
|
||||
t1 = Ticket(id="T1", description="Task 1", status="todo", assigned_to="worker", depends_on=["T2"])
|
||||
t2 = Ticket(id="T2", description="Task 2", status="todo", assigned_to="worker", depends_on=["T3"])
|
||||
t3 = Ticket(id="T3", description="Task 3", status="todo", assigned_to="worker", depends_on=["T1"])
|
||||
@@ -49,7 +49,7 @@ def test_has_cycle_complex_no_cycle():
|
||||
dag = TrackDAG([t1, t2, t3, t4])
|
||||
assert not dag.has_cycle()
|
||||
|
||||
def test_get_ready_tasks_multiple_deps():
|
||||
def test_get_ready_tasks_multiple_deps() -> None:
|
||||
t1 = Ticket(id="T1", description="T1", status="completed", assigned_to="worker")
|
||||
t2 = Ticket(id="T2", description="T2", status="completed", assigned_to="worker")
|
||||
t3 = Ticket(id="T3", description="T3", status="todo", assigned_to="worker", depends_on=["T1", "T2"])
|
||||
@@ -58,7 +58,7 @@ def test_get_ready_tasks_multiple_deps():
|
||||
t2.status = "todo"
|
||||
assert [t.id for t in dag.get_ready_tasks()] == ["T2"]
|
||||
|
||||
def test_topological_sort():
|
||||
def test_topological_sort() -> None:
|
||||
t1 = Ticket(id="T1", description="T1", status="todo", assigned_to="worker")
|
||||
t2 = Ticket(id="T2", description="T2", status="todo", assigned_to="worker", depends_on=["T1"])
|
||||
t3 = Ticket(id="T3", description="T3", status="todo", assigned_to="worker", depends_on=["T2"])
|
||||
@@ -66,7 +66,7 @@ def test_topological_sort():
|
||||
sort = dag.topological_sort()
|
||||
assert sort == ["T1", "T2", "T3"]
|
||||
|
||||
def test_topological_sort_cycle():
|
||||
def test_topological_sort_cycle() -> None:
|
||||
t1 = Ticket(id="T1", description="T1", status="todo", assigned_to="worker", depends_on=["T2"])
|
||||
t2 = Ticket(id="T2", description="T2", status="todo", assigned_to="worker", depends_on=["T1"])
|
||||
dag = TrackDAG([t1, t2])
|
||||
|
||||
Reference in New Issue
Block a user