File size: 1,549 Bytes
29ed661
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Ruff configuration file
# Fast, Python linter and formatter written in Rust

# Line length (Black-compatible default)
line-length = 88

# Target Python version
target-version = "py310"

# Exclude patterns
exclude = [
    "__pycache__",
    "*.pyc",
    ".git",
    ".venv",
    "venv",
    "htmlcov",
    ".pytest_cache",
    "dist",
    "build",
]

# Linter configuration
[lint]
# Enable rule sets
select = [
    "E",   # pycodestyle errors
    "W",   # pycodestyle warnings
    "F",   # pyflakes
    "I",   # isort (import sorting)
    "UP",  # pyupgrade
    "B",   # flake8-bugbear
    "C4",  # flake8-comprehensions
    "SIM", # flake8-simplify
]

# Ignore specific rules
ignore = [
    "E501",  # Line too long (handled by formatter)
    "B008",  # Do not perform function calls in argument defaults (common in FastAPI)
    "C901",  # Too complex (may be too strict for this project)
    "B904",  # Allow raising exceptions without 'from' in error handlers (FastAPI pattern)
]

# Per-file ignores
[lint.per-file-ignores]
"tests/*" = ["S101"]  # Use of assert in tests is fine
"app/services/structured_summarizer.py" = ["E402", "E722"]  # Intentional imports after patch, bare except for JSON parsing
"app/services/summarizer.py" = ["SIM117"]  # Nested async with necessary (client.stream depends on client context)

# Import sorting configuration (isort-compatible)
[lint.isort]
known-first-party = ["app"]

# Format configuration
[format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"