-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
75 lines (69 loc) · 3.4 KB
/
ruff.toml
File metadata and controls
75 lines (69 loc) · 3.4 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
# ═══════════════════════════════════════════════════════════════════════════════
# Ruff configuration — Python linter for pipeline & scripts
# ═══════════════════════════════════════════════════════════════════════════════
# Scope: pipeline/, scripts/, root-level *.py files
# Docs: https://docs.astral.sh/ruff/configuration/
# ═══════════════════════════════════════════════════════════════════════════════
target-version = "py312"
line-length = 120
# Only lint Python source directories (excludes __pycache__, .venv, etc.)
include = ["pipeline/**/*.py", "scripts/**/*.py", "*.py"]
[lint]
# Start strict but pragmatic — expand over time
# See https://docs.astral.sh/ruff/rules/ for full rule catalog
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort (import ordering)
"UP", # pyupgrade (modern Python idioms)
"B", # flake8-bugbear (common bugs)
"SIM", # flake8-simplify
"S", # flake8-bandit (security)
"N", # pep8-naming conventions
"C4", # flake8-comprehensions (list/dict/set comprehension style)
"RET", # flake8-return (explicit return patterns)
"PIE", # flake8-pie (misc lints: no-unnecessary-pass, etc.)
"PT", # flake8-pytest-style (pytest idioms)
"RUF", # Ruff-specific rules
"T20", # flake8-print (catch forgotten print() statements)
"ERA", # eradicate (commented-out code detector)
]
ignore = [
"S603", # subprocess-without-shell-check — false positives on controlled invocations
"S607", # start-process-with-partial-path — acceptable for pipeline scripts
"S608", # hardcoded-sql-expression — expected: this project generates SQL
"RET504", # unnecessary-assign before return — sometimes clarifies debugging
"ERA001", # commented-out-code — too aggressive for migration comments
"N803", # argument-name-mixed-case — SQL-origin names (p_category etc.)
"N806", # variable-in-function-mixed-case — same reason as N803
]
[lint.isort]
combine-as-imports = true
force-wrap-aliases = true
known-first-party = ["pipeline"]
[lint.per-file-ignores]
# Test files: assert statements + broader exception handling
"**/test_*.py" = ["S101", "T20", "PT"]
"pipeline/test_validator.py" = ["S101"]
# Pipeline fetch/utility scripts: print() calls are intentional progress indicators
"pipeline/run.py" = ["T20"]
"pipeline/orchestrate.py" = ["T20"]
"pipeline/csv_import.py" = ["T20"]
"pipeline/scrape.py" = ["T20"]
"pipeline/image_importer.py" = ["T20"]
"fetch_off_category.py" = ["T20"]
"enrich_ingredients.py" = ["T20", "E501"]
"validate_eans.py" = ["T20"]
"run_data_audit.py" = ["T20"]
"check_pipeline_structure.py" = ["T20"]
"check_enrichment_identity.py" = ["T20"]
# Setup scripts
"scripts/*.py" = ["T20", "S603", "S607"]
# SQL generator constructs long SQL strings by design
"pipeline/sql_generator.py" = ["E501"]
[format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "lf"