Format entire codebase with ruff and add type hints across all modules: - Apply ruff formatting to all Python files (121 files, 17K insertions) - Add type hints to function signatures throughout lightrag core and API - Update test suite with improved type annotations and docstrings - Add pyrightconfig.json for static type checking configuration - Create prompt_optimized.py and test_extraction_prompt_ab.py test files - Update ruff.toml and .gitignore for improved linting configuration - Standardize code style across examples, reproduce scripts, and utilities
38 lines
943 B
TOML
38 lines
943 B
TOML
# Ruff configuration for local lint runs
|
|
|
|
line-length = 120
|
|
target-version = "py310"
|
|
extend-exclude = [
|
|
"lightrag_webui", # frontend (TS/JS)
|
|
"node_modules",
|
|
".venv",
|
|
"build",
|
|
"dist",
|
|
]
|
|
|
|
[lint]
|
|
# Start with core errors + imports, then add a small set of safety/style checks.
|
|
select = [
|
|
"E", # pycodestyle errors
|
|
"F", # pyflakes
|
|
"I", # import sorting
|
|
"B", # bugbear
|
|
"UP", # pyupgrade
|
|
"C4", # comprehensions
|
|
"SIM",# simplify
|
|
"TID",# tidy imports
|
|
"RUF" # ruff-specific
|
|
]
|
|
ignore = [
|
|
"E402", # allow imports after other statements (mirrors pre-commit hook)
|
|
"E501", # ignore line too long
|
|
"RUF001", # ignore ambiguous characters (intentional for text processing)
|
|
"RUF002", # ignore ambiguous characters (intentional for text processing)
|
|
"RUF003", # ignore ambiguous characters (intentional for text processing)
|
|
]
|
|
fixable = ["ALL"]
|
|
|
|
[format]
|
|
quote-style = "single"
|
|
indent-style = "space"
|
|
line-ending = "lf"
|