-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
75 lines (69 loc) · 3.23 KB
/
Copy pathpyproject.toml
File metadata and controls
75 lines (69 loc) · 3.23 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
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["scripts"]
addopts = "-v --tb=short"
filterwarnings = [
"ignore::DeprecationWarning",
]
# --------------------------------------------------------------------------- #
# vulture: dead code detection
# 実行: ~/.venv_aarch64/bin/vulture
# 90% 以上の検出は CI で fail させる候補。60-89% は手動レビュー。
# --------------------------------------------------------------------------- #
[tool.vulture]
# scripts/ 配下全体を対象に。pm_mcp_server.py 等の参照を vulture に見せるため
# サブディレクトリ単位ではなく scripts 全体を渡す。
paths = ["scripts"]
# python-pptx の属性 setter パターン (paragraph.alignment = ... 等) が
# vulture では使われない attribute として大量に誤検知されるため除外
exclude = [
"scripts/archive/",
"scripts/utils/pptx_theme.py",
"**/__pycache__/",
]
min_confidence = 70
sort_by_size = true
# Slack Bolt のハンドラ・signal ハンドラ等、動的に呼ばれる関数を黙らせる
ignore_decorators = [
"@app.command", "@app.event", "@app.action", "@app.message",
"@app.shortcut", "@app.view", "@app.options",
]
ignore_names = [
"signum", "frame", # signal.signal ハンドラの引数
"row_factory", # sqlite3 conn.row_factory への代入
]
# --------------------------------------------------------------------------- #
# mypy: 静的型チェック
# 実行: ~/.venv_aarch64/bin/mypy scripts/argus
# 方針: scripts/ 直下の symlink 30 本が重複モジュール検出を引き起こすため、
# argus/ サブディレクトリのみチェックする。新規コードで型エラーゼロを保つ。
# --------------------------------------------------------------------------- #
[tool.mypy]
python_version = "3.12"
mypy_path = "scripts"
ignore_missing_imports = true
follow_imports = "silent"
disable_error_code = ["annotation-unchecked"]
# --------------------------------------------------------------------------- #
# ruff: 一般的 lint (PEP 8 / 未使用 import / バグ検出 / モダン化)
# 実行: ~/.venv_aarch64/bin/ruff check scripts
# 自動修正: ~/.venv_aarch64/bin/ruff check --fix scripts
# --------------------------------------------------------------------------- #
[tool.ruff]
target-version = "py312"
[tool.ruff.lint]
# E,F = pycodestyle/pyflakes、I = isort、B = bugbear、UP = pyupgrade
select = ["E", "F", "I", "B", "UP"]
ignore = [
"E501", # line-too-long: プロジェクトでは長行を許容
"E402", # module-import-not-at-top: sys.path.insert() 後の import が定型
]
[tool.ruff.lint.per-file-ignores]
# pptx_theme.py は python-pptx の連続属性設定を ; 区切りで圧縮する意図的な
# コンパクト記法を多用する (vulture でも同様の理由で除外している)。
# B008 は python-pptx の RGBColor(...) を引数デフォルトに使う定型パターン。
# 実ファイル + 旧パスへの symlink 両方を ignore。
"**/pptx_theme.py" = ["E702", "B008"]
# FastAPI の Query(...) / File(...) を引数デフォルトに置く DI パターンが
# B008 の false positive を生む (ライブラリ仕様上の標準形)。
"**/pm_api.py" = ["B008"]