chore: add ty + pre-commit hook and repeal even more ruff rules (#9504)
* auto fixes * auto fix pt2 and transitive deps and undefined var checking locals() * manual fixes (ignored or letta-code fixed) * fix circular import * remove all ignores, add FastAPI rules and Ruff rules * add ty and precommit * ruff stuff * ty check fixes * ty check fixes pt 2 * error on invalid
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
import itertools
|
||||
from datetime import datetime, timezone
|
||||
from typing import Tuple
|
||||
from unittest.mock import AsyncMock, patch
|
||||
@@ -769,7 +770,7 @@ def _assert_descending_order(messages):
|
||||
if len(messages) <= 1:
|
||||
return True
|
||||
|
||||
for prev, next in zip(messages[:-1], messages[1:]):
|
||||
for prev, next in itertools.pairwise(messages):
|
||||
assert prev.created_at >= next.created_at, (
|
||||
f"Order violation: {prev.id} ({prev.created_at}) followed by {next.id} ({next.created_at})"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user