-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
106 lines (98 loc) · 2.49 KB
/
pyproject.toml
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
[project]
name = "Beira"
version = "2024.07.22"
description = "An personal Discord bot made in Python."
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.11"
authors = [
{ name = "Sachaa-Thanasius", email = "111999343+Sachaa-Thanasius@users.noreply.github.com" },
]
[project.urls]
Homepage = "https://github.com/Sachaa-Thanasius/Beira"
[tool.ruff]
include = ["src/**/*.py", "misc/**/*.py"]
line-length = 120
target-version = "py312"
[tool.ruff.lint]
select = [
"F",
"E",
"I",
"UP",
"YTT",
"ANN",
"S",
"BLE",
"B",
"A",
"COM",
"C4",
"DTZ",
"EM",
"ISC",
"G",
"INP",
"PIE",
"T20",
"PYI",
"PT",
"RSE",
"RET",
"SIM",
"TID",
"PTH",
"ERA",
"PL",
"TRY",
"RUF",
]
ignore = [
"S101", # Allow use of assert for typing reasons.
"PLR2004", # Magic value comparison.
"SIM105", # Suppressable exception. contextlib.suppress is a stylistic choice with overhead.
"ANN101", # Type of Self for self is usually implicit.
"ANN102", # Type of type[Self] for cls is usually implicit.
"ANN204", # Return types for magic methods are usually inferred or known.
"ANN401", # Any is necessary sometimes.
"PT001", # pytest recommends against empty parentheses on pytest.fixture.
"UP038", # isinstance performs better with tuples than unions.
"RUF001", # Allow ambiguous characters.
# == Recommended ignores by ruff when using ruff format.
"E111",
"E114",
"E117",
"D206",
"D300",
"COM812",
"COM819",
# "E501",
"ISC001",
"ISC002",
# == Project-specific ignores.
"PLR0912", # Allow more branches
"PLR0913", # Allow more parameters
"S311", # No need for cryptographically secure number generation in this use case; it's just dice rolls.
]
unfixable = [
"ERA", # Don't want erroneous deletion of comments.
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F403", "PLC0414"] # Star import usually throws these.
"misc/**" = [
"T201", # Leave prints alone.
"ERA001", # Leave commented code alone.
]
[tool.ruff.lint.isort]
lines-after-imports = 2
combine-as-imports = true
[tool.pyright]
include = ["src"]
pythonVersion = "3.12"
typeCheckingMode = "strict"
reportCallInDefaultInitializer = "warning"
reportImportCycles = "warning"
reportPropertyTypeMismatch = "warning"
reportShadowedImports = "error"
# reportUninitializedInstanceVariable = "warning"
reportUnnecessaryTypeIgnoreComment = "warning"