-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
97 lines (88 loc) · 3.68 KB
/
Copy pathpyproject.toml
File metadata and controls
97 lines (88 loc) · 3.68 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
88
89
90
91
92
93
94
95
96
97
# ============================================================
# SFDAP — Proje Konfigürasyonu
# ============================================================
[project]
name = "sfdap"
version = "1.0.0"
description = "Akıllı Tarım Veri Analizi Platformu"
requires-python = ">=3.12"
# ──── pytest konfigürasyonu ────────────────────────────────
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = "-v --tb=short"
# ──── coverage konfigürasyonu ──────────────────────────────
[tool.coverage.run]
source = ["app"]
omit = [
"app/__pycache__/*",
"app/ml/models/*",
]
[tool.coverage.report]
fail_under = 80
show_missing = true
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.",
"pass",
]
# ──── ruff linter konfigürasyonu ───────────────────────────
[tool.ruff]
target-version = "py312"
line-length = 120
[tool.ruff.lint]
select = [
# Mevcut çekirdek
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort (import sıralaması)
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
# Cycle 8 audit'inde aktif edilen ek kümler (low-noise, high-value)
"DTZ", # datetime tz-awareness — naive datetime'ı yakalar
"ERA", # commented-out code
"PT", # pytest style
"RET", # return statement anti-patterns
"C4", # comprehensions
"PIE", # flake8-pie misc
"PERF", # performance hints
"TRY", # try/except patterns
"S", # bandit subset — basic security
]
ignore = [
"E501", # satır uzunluğu (line-length ile yönetiliyor)
"B008", # Depends() function call in argument defaults (FastAPI pattern)
"N805", # first argument of a method should be named 'self' (Pydantic validators)
"TRY003", # raise vanilla args (HTTPException pattern projede standart)
"TRY300", # try-consider-else (mevcut kod stili)
"S105", # hardcoded "bearer" / token_type gibi sabitler false positive
"S106", # dev/test API key argümanları
"S311", # random.* — kriptografik olmayan kullanımlar OK
"PERF203", # try-except in loop (FastAPI per-farm akışları için OK)
]
[tool.ruff.lint.per-file-ignores]
# tests/: assert True/False, hardcoded test verileri, naive datetime OK
"tests/*" = ["B011", "SIM", "S101", "S106", "PT003", "ARG", "DTZ", "PERF"]
# alembic auto-generated migration dosyaları: stil iyileştirmesi gereksiz
"alembic/versions/*" = ["UP", "I", "D"]
# scripts/: standalone CLI script'ler — print + esneklik
"scripts/*" = ["T201", "S101", "S311"]
# docs/testing/: Cycle 6 arşivlenmiş test referansları — modern `app.main:app`
# yerine eski `app import app` API'sini kullanır; çalışmaz, sadece tarihi kayıt.
"docs/testing/*" = ["S101", "F401", "I", "W293", "ERA", "UP", "B", "SIM", "ANN", "D"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.bandit]
# Pre-commit ve CI'da `bandit -r app/` çalıştırılır. False-positive azaltma:
# - B101 (assert_used): runtime sanity-check ve Pydantic validator'larda
# bilinçli kullanım (UserRole↔USER_ROLES sync gibi).
# - B105 (hardcoded_password): OpenAPI schema örnek password'ları + DEV
# fallback sabitleri (üretimde _validate_production fail-fast eder).
# - B311 (random): scheduler jitter / data quality outlier seeding —
# kriptografik kullanım değil. (Üretimde secrets.* kullanılıyor.)
skips = ["B101", "B105", "B311"]