-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
87 lines (79 loc) · 3.09 KB
/
ruff.toml
File metadata and controls
87 lines (79 loc) · 3.09 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Ruff configuration file
# See: https://docs.astral.sh/ruff/configuration/
target-version = "py39"
line-length = 100
[lint]
# Enable specific rule sets
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"PIE", # flake8-pie
"PL", # Pylint
"TRY", # tryceratops
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # Line too long (handled by formatter)
"B008", # Do not perform function calls in argument defaults
"PLR0913", # Too many arguments
"PLR2004", # Magic value used in comparison
"TRY003", # Avoid specifying long messages outside the exception class
"ARG002", # Unused method argument
"ARG001", # Unused function argument
"TRY400", # Use logging.exception - we use structured logging with error context
"PLR0911", # Too many return statements (acceptable for complex processing logic)
"PLR0912", # Too many branches (acceptable for complex processing logic)
"PLR0915", # Too many statements (acceptable for complex processing logic)
"B904", # Raise from - we preserve original exceptions where needed (includes TRY200)
"TRY300", # Consider else block - sometimes try/except/else is less readable
]
# Allow autofix for all enabled rules
fixable = ["ALL"]
unfixable = []
[lint.per-file-ignores]
"tests/**/*.py" = [
"ARG", # Allow unused arguments in tests
"PLR2004", # Allow magic values in tests
"S101", # Allow assert in tests
"PLC0415", # Allow imports inside functions in tests (sometimes needed for test isolation)
"SIM105", # Allow try-except-pass in tests (common pattern for cleanup)
"SIM117", # Allow nested with statements in tests (sometimes more readable)
"F841", # Allow unused variables in tests (sometimes needed for test setup)
"TRY002", # Allow generic Exception in tests (acceptable for mocking)
"B017", # Allow asserting generic Exception in tests
"E741", # Allow ambiguous variable names in tests (like 'l' for line)
"RUF015", # Allow list slicing in tests (sometimes clearer than next(iter()))
"E402", # Allow module level imports not at top (common in tests with sys.path manipulation)
]
"email_processor/logging/setup.py" = [
"PLC0415", # Import in function to avoid circular import
]
"email_processor/smtp/sender.py" = [
"PLC0415", # Import in function to avoid circular dependency
]
"email_processor/security/fingerprint.py" = [
"PLC0415", # Import win32security inside try block (optional dependency)
]
"email_processor/security/encryption.py" = [
"PLC0415", # Import cryptography inside function (lazy import for optional dependency)
]
"email_processor/cli/commands/imap.py" = [
"PLC0415", # Import rich.table inside function (lazy import for optional dependency)
]
[lint.isort]
known-first-party = ["email_processor"]
[lint.mccabe]
max-complexity = 15
[lint.pylint]
max-args = 10
max-branches = 15
max-returns = 8
max-statements = 50