cli: Ruff autofixes (#31863)

Auto-fixes from ruff with rule ALL
This commit is contained in:
Christophe Bornet
2025-07-07 16:06:34 +02:00
committed by GitHub
parent 451c90fefa
commit a46a2b8bda
17 changed files with 157 additions and 196 deletions

View File

@@ -1,12 +1,11 @@
def split_package(package: str) -> tuple[str, str]:
"""Split a package name into the containing package and the final name"""
"""Split a package name into the containing package and the final name."""
parts = package.split(".")
return ".".join(parts[:-1]), parts[-1]
def dump_migrations_as_grit(name: str, migration_pairs: list[tuple[str, str]]):
def dump_migrations_as_grit(name: str, migration_pairs: list[tuple[str, str]]) -> str:
"""Dump the migration pairs as a Grit file."""
output = "language python"
remapped = ",\n".join(
[
f"""
@@ -21,7 +20,7 @@ def dump_migrations_as_grit(name: str, migration_pairs: list[tuple[str, str]]):
]
)
pattern_name = f"langchain_migrate_{name}"
output = f"""
return f"""
language python
// This migration is generated automatically - do not manually edit this file
@@ -34,4 +33,3 @@ pattern {pattern_name}() {{
// Add this for invoking directly
{pattern_name}()
"""
return output