-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
197 lines (180 loc) · 4.29 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
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
190
191
192
193
194
195
196
197
# Copyright 2022-2024 David Corbett
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
[tool.coverage.run]
branch = true
parallel = true
relative_files = true
[tool.coverage.report]
exclude_also = [
"#[\t ]*type:[\t ]*ignore[\t\\v\f ]*\\[([^]#]*,)?\\s*unreachable\\s*(,[^]#]*)?\\]\\s*(#.*)?$",
"^[\t\f ]*(case _:(\r\n?|\n)[\t\f ]*((#.*)?(\r\n?|\n)[\t\f ]*)*)?assert_never\\(\\b",
"^[\t\f ]*(case _:(\r\n?|\n)[\t\f ]*((#.*)?(\r\n?|\n)[\t\f ]*)*)?raise ValueError\\b",
"^[\t\f ]*@overload$",
"^[\t\f ]*assert False(,|$)",
"^[\t\f ]*def __repr__\\(",
"^[\t\f ]*if TYPE_CHECKING:",
"^[\t\f ]*raise NotImplementedError\\b",
]
fail_under = 91
[tool.mypy]
enable_error_code = [
"explicit-override",
"ignore-without-code",
"redundant-expr",
"redundant-self",
"truthy-bool",
"truthy-iterable",
"unimported-reveal",
"unused-awaitable",
]
disallow_any_explicit = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
no_implicit_reexport = true
strict_equality = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
module = [
"cffsubr.*",
"fontTools.*",
"fontforge.*",
"gfsubsets.*",
"uharfbuzz.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"fontforge.*",
]
follow_imports = "skip"
[[tool.mypy.overrides]]
module = [
"otf2ttf",
]
disallow_untyped_calls = false
disallow_untyped_defs = false
[tool.ruff]
src = [".", "sources"]
target-version = "py312"
[tool.ruff.lint]
allowed-confusables = [
# https://github.com/astral-sh/ruff/issues/3977
"’",
]
exclude = [
"sources/otf2ttf.py",
]
ignore = [
# Not appropriate for this project
"B011",
"D200",
"DOC502",
"EM",
"FIX001",
"FIX002",
"FIX004",
"FURB154",
"PLR2004",
"PLR5501",
"PT015",
"RET505",
"RUF021",
"S101",
"S404",
"S603",
"S607",
"SIM105",
"SIM108",
"SIM300",
"TD001",
"TD002",
"TD003",
"TRY003",
# Too many false positives
"ARG001",
"ARG002",
"D205",
"PLW2901", # https://github.com/astral-sh/ruff/issues/7273
"SLF001", # https://github.com/astral-sh/ruff/issues/9022
# Too many true positives
"C901",
"D1",
"FBT",
"PLR09",
"PLR1702",
]
preview = true
select = ["ALL"]
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = [
"exit",
"input",
]
[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
multiline-quotes = "single"
[tool.ruff.lint.flake8-type-checking]
quote-annotations = true
strict = true
[tool.ruff.lint.isort]
case-sensitive = true
force-single-line = true
force-sort-within-sections = true
known-third-party = ["fontforge"]
lines-after-imports = 2
no-lines-before = ["first-party"]
order-by-type = false
section-order = ["future", "standard-library", "third-party", "local-folder", "first-party"]
[tool.ruff.lint.pep8-naming]
extend-ignore-names = [
# `fontforge.glyph` methods
"addAnchorPoint",
"boundingBox",
"glyphPen",
"removeOverlap",
# `fontforge.glyphPen` methods
"curveTo",
"endPath",
"lineTo",
"moveTo",
]
[tool.ruff.lint.per-file-ignores]
"sources/charsets/data.py" = [
# Shape definitions are more maintainable one per line.
"E501",
]
"sources/shapes.py" = [
# Shape classes are designed for inheritance. Even if a certain
# method doesn’t use `self`, an override of it might.
"PLR6301",
]
"tests/run-tests.py" = [
# Test results must be output.
"T20",
]
[tool.ruff.lint.pycodestyle]
max-line-length = 170
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.uv.pip]
universal = true
upgrade = true