chore: migrate to ruff (#4305)

* base requirements

* autofix

* Configure ruff for Python linting and formatting

- Set up minimal ruff configuration with basic checks (E, W, F, I)
- Add temporary ignores for common issues during migration
- Configure pre-commit hooks to use ruff with pass_filenames
- This enables gradual migration from black to ruff

* Delete sdj

* autofixed only

* migrate lint action

* more autofixed

* more fixes

* change precommit

* try changing the hook

* try this stuff
This commit is contained in:
Kian Jones
2025-08-29 11:11:19 -07:00
committed by GitHub
parent e6c2c2121e
commit fecf6decfb
121 changed files with 627 additions and 666 deletions

View File

@@ -67,6 +67,7 @@ dependencies = [
"certifi>=2025.6.15",
"markitdown[docx,pdf,pptx]>=0.1.2",
"orjson>=3.11.1",
"ruff[dev]>=0.12.10",
]
[project.scripts]
@@ -108,11 +109,8 @@ dev = [
"pytest-mock>=3.14.0",
"pytest-json-report>=1.5.0",
"pexpect>=4.9.0",
"black[jupyter]>=24.4.2",
"pre-commit>=3.5.0",
"pyright>=1.1.347",
"autoflake>=2.3.0",
"isort>=5.13.2",
"ipykernel>=6.29.5",
"ipdb>=0.13.13",
]
@@ -149,18 +147,46 @@ build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["letta"]
[tool.black]
line-length = 140
target-version = ['py310', 'py311', 'py312', 'py313']
extend-exclude = "examples/*"
[tool.isort]
profile = "black"
line_length = 140
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
[tool.ruff]
line-length = 140
target-version = "py312"
extend-exclude = [
"examples/*",
"tests/data/*",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
]
ignore = [
"E501", # line too long (handled by formatter)
"E402", # module import not at top of file
"E711", # none-comparison
"E712", # true-false-comparison
"E722", # bare except
"E721", # type comparison
"F401", # unused import
"F821", # undefined name
"F811", # redefined while unused
"F841", # local variable assigned but never used
"W293", # blank line contains whitespace
]
[tool.ruff.lint.isort]
force-single-line = false
combine-as-imports = true
split-on-trailing-comma = true
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.pytest.ini_options]
asyncio_mode = "auto"