-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
72 lines (59 loc) · 2.72 KB
/
ruff.toml
File metadata and controls
72 lines (59 loc) · 2.72 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
[lint]
# Targeted rule selection to match TypeScript/Rust strictness
select = [
# Core logic and imports
"F", # Pyflakes - catches real bugs
"E", # Pycodestyle errors - PEP 8 compliance
# Bug prevention
"B", # flake8-bugbear - common bug patterns
"S", # flake8-bandit - security issues
# Code quality
"C90", # mccabe complexity
"N", # pep8-naming - consistent naming
"UP", # pyupgrade - modern Python patterns
"RUF", # Ruff-specific rules
# Best practices
"PERF", # Performance improvements
"TRY", # Exception handling best practices
"SIM", # Code simplification
# Selected documentation (not all D rules)
"D101","D102", "D103", # Require docstrings for public classes/methods/functions
# Selected Pylint rules
"PLW", # pylint warnings
"PLE", # pylint errors
# Unused arguments
"ARG", # flake8-unused-arguments - flags unused function arguments
# Type annotations - replaces mypy strictness recovered from ty migration:
# ANN001/002/003/201/204/205/206 = disallow_untyped_defs + disallow_incomplete_defs
# ANN401 = disallow_any_explicit
"ANN",
]
ignore = [
# Security: Allow asserts in tests
"S101",
# Exception handling: Too strict for practical use
"TRY003", # Long exception messages
# Magic values: Leave to coding review agent
"PLR2004", # Magic value comparisons
# Error Messages
"E501", # Its fine if they are long
# Type annotations: Prefer Optional over X | None
"UP045", # Use X | None for type annotations
]
[lint.pylint]
max-args = 5
max-statements = 30
[lint.per-file-ignores]
# Lambda source files: ship to AWS Lambda runtime where boto3 is preinstalled
# and psycopg2 is in a Layer. urllib calls hit AWS-signed CFN URLs (S310).
# `context` arg required by Lambda signature even when unused (ARG001).
"src/cfn/persistence/lambda_code/*.py" = ["S310", "ARG001", "TRY002", "TRY301", "BLE001", "D103", "ANN401"]
# Init container scripts: ship to bare python:3.13-alpine images. urllib
# calls hit our own arcnode-public S3 (S310). Untyped boto3/neo4j driver
# objects + Any annotations at the AWS / DB driver boundary (ANN001,
# ANN401) — same model as Lambda code.
"src/compose/init-scripts/*.py" = ["S310", "ANN001", "ANN401"]
# Test files: missing docstrings, unused lambda args (mock context managers),
# hardcoded test passwords, urllib mocks all expected.
"**/*_test.py" = ["D101", "D102", "D103", "ANN001", "ANN201", "ANN202", "ARG001", "ARG005", "S105", "S106", "S310", "SIM117"]
"tests/**/*.py" = ["D101", "D102", "D103", "ANN001", "ANN201", "ANN202", "ARG001", "ARG005", "S105", "S106", "S310", "SIM117"]