-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathpyproject.toml
More file actions
189 lines (167 loc) · 6.5 KB
/
Copy pathpyproject.toml
File metadata and controls
189 lines (167 loc) · 6.5 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "plugin.video.jacktook"
version = "1.15.0"
description = "Kodi addon for searching and streaming torrents via debrid services"
requires-python = ">=3.7"
# ──────────────────────────────────────────────
# Ruff — linter + formatter
# ──────────────────────────────────────────────
[tool.ruff]
# Target Python 3.7+ for Kodi compatibility (the addon has a py37 compat checker)
target-version = "py37"
line-length = 100
indent-width = 4
# Files/directories to exclude
exclude = [
".git",
".venv",
".agent",
".agents",
".opencode",
".worktrees",
".mypy_cache",
".pytest_cache",
"docs",
"scripts",
"tests/manual_*.py",
"__pycache__",
"*.pyc",
]
# ── Formatter ─────────────────────────────────
[tool.ruff.format]
# Use Black-compatible formatting
quote-style = "double"
indent-style = "space"
line-ending = "auto"
skip-magic-trailing-comma = false
# ── Linter ────────────────────────────────────
[tool.ruff.lint]
# Start with a pragmatic set of rules — expand as needed
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes (logic errors)
"I", # isort (import ordering)
"N", # pep8-naming
"UP", # pyupgrade (only safe auto-fixes for target version)
"B", # flake8-bugbear (likely bugs)
"SIM", # flake8-simplify (simplifications)
"D", # pydocstyle (docstring conventions)
"YTT", # flake8-2020 (version check idioms)
"RUF", # Ruff-specific rules
]
# Ignore rules that are too noisy for this codebase
ignore = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"D200", # One-line docstring should fit on one line
"D203", # 1 blank line required before class docstring
"D212", # Multi-line docstring summary should start at first line
"D213", # Multi-line docstring summary should start at second line
"D401", # First line should be in imperative mood
"D402", # First line should not be function's signature
"D413", # Blank line after last section
"D414", # Section has no content
"D415", # First line should end with period
"D416", # Section name should end with colon
"D417", # Missing argument descriptions
"N802", # Function name should be lowercase (allow camelCase for Kodi compat)
"N803", # Argument name should be lowercase
"N806", # Variable in function should be lowercase
"N815", # Variable in class scope should not be mixedCase
"SIM108", # Use ternary operator (if-else blocks)
"SIM115", # Use context handler for opening files
"SIM117", # Merge with-statements
"UP007", # Use X | Y for type unions (not compatible with py37)
"UP006", # Use X instead of typing.X
"UP035", # Import from typing deprecated
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
]
# ── isort settings ────────────────────────────
[tool.ruff.lint.isort]
known-first-party = ["lib"]
known-third-party = ["xbmc", "xbmcgui", "xbmcplugin", "xbmcaddon", "xbmcvfs"]
force-single-line = false
order-by-type = true
# ── pydocstyle ────────────────────────────────
[tool.ruff.lint.pydocstyle]
convention = "google"
# ── pycodestyle ───────────────────────────────
[tool.ruff.lint.pycodestyle]
max-doc-length = 100
# ── Per-file-rule overrides ───────────────────
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["D", "N", "SIM", "E402", "E501"]
"scripts/**" = ["D", "N", "SIM", "UP"]
# Vendor code: ignore everything except critical bugs (F, B)
"lib/vendor/**" = ["ALL"]
"lib/api/tmdbv3api/**" = ["ALL"]
"lib/utils/parsers/xmltodict.py" = ["ALL"]
# ──────────────────────────────────────────────
# mypy — static type checker
# ──────────────────────────────────────────────
[tool.mypy]
python_version = "3.13"
strict_optional = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_return_any = true
no_implicit_optional = true
show_error_codes = true
ignore_missing_imports = true
# Exclude test/script/doc directories from initial file discovery
exclude = [
"tests/",
"scripts/",
"docs/",
]
# ──────────────────────────────────────────────
# pytest — test runner
# ──────────────────────────────────────────────
# Per-module overrides: skip vendored third-party code
[[tool.mypy.overrides]]
module = "lib.vendor.*"
follow_imports = "skip"
ignore_errors = true
[[tool.mypy.overrides]]
module = "lib.utils.parsers.xmltodict"
follow_imports = "skip"
ignore_errors = true
[[tool.mypy.overrides]]
module = "lib.api.tmdbv3api.*"
follow_imports = "skip"
ignore_errors = true
[tool.pytest.ini_options]
minversion = "7.0"
addopts = [
"-q",
"--tb=short",
]
testpaths = ["tests"]
python_files = ["test_*.py", "verify_*.py"]
filterwarnings = [
"ignore::DeprecationWarning:lib.db.cached:413",
]
# ──────────────────────────────────────────────
# Coverage — pytest-cov
# ──────────────────────────────────────────────
[tool.coverage.run]
source = ["lib"]
omit = [
"tests/*",
"scripts/*",
"*/__pycache__/*",
]
[tool.coverage.report]
show_missing = true
skip_covered = true
skip_empty = true
fail_under = 0