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[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "docstring-adder"
version = "0.1.0"
authors = [{ name = "Alex Waygood", email = "alex.waygood@gmail.com" }]
description = "Tool to add docstrings to stubs."
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.9"
dependencies = [
"libcst>=1.8.2",
"rich-argparse>=1.7.0",
"termcolor>=3.1.0",
"tomli>=2.2.1",
"typeshed-client @ git+https://github.com/JelleZijlstra/typeshed_client@9d4b258bbad66421ee2d9ea8cf02768ffb782a1a",
# So that we can add docs for `typing_extensions` APIs:
"typing_extensions",
# for dynamically installing typeshed packages
"uv",
]
keywords = ["typing", "stubs"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development",
]
[project.urls]
"Homepage" = "https://github.com/AlexWaygood/docstring-adder"
"Bug Tracker" = "https://github.com/AlexWaygood/docstring-adder/issues"
[project.scripts]
add-docstrings = "add_docstrings:_main"
[tool.hatch.build.targets.wheel]
include = ["add_docstrings.py"]
[tool.hatch.metadata]
allow-direct-references = true
[dependency-groups]
dev = ["mypy==1.19.1", "ty==0.0.12"]
[tool.mypy]
files = ['*.py']
show_traceback = true
pretty = true
strict = true
enable_error_code = 'ignore-without-code,redundant-expr,possibly-undefined'
warn_unreachable = true
local_partial_types = true
allow_redefinition = true
python_version = "3.9"
[tool.ty.rules]
possibly-unresolved-reference = "error"
division-by-zero = "error"
unused-ignore-comment = "error"
[tool.ty.analysis]
respect-type-ignore-comments = false
[tool.ruff]
fix = true
preview = true
line-length = 88
[tool.ruff.format]
docstring-code-format = true
skip-magic-trailing-comma = true
[tool.ruff.lint]
select = [
"ARG",
"B",
"B9",
"D",
"E",
"EXE",
"F",
"I",
"ISC",
"PGH",
"PYI",
"PT",
"RUF",
"SIM",
"UP",
"PLW0127",
"FURB101",
"FURB103",
"PLW1510",
]
ignore = [
# Unnecessarily strict/pedantic
"D107",
"D202",
# These are all enforced by, or incompatible with, the ruff formatter:
"E203",
"E501",
"W291",
"W293",
# It's often necessary to compare types instead of using isinstance()
"E721",
"RUF005",
# Let mypy/pyright complain about blanket type ignores or implicit optional
"PGH003",
"RUF013",
]
unfixable = [
"F841", # unused variable. ruff keeps the call, but mostly we want to get rid of it all
"F601", # automatic fix might obscure issue
"F602", # automatic fix might obscure issue
"B018", # automatic fix might obscure issue
"PLW1510", # automatic fix might obscure issue
"RUF017", # Ruff's fix is faster, but I prefer using itertools.chain_from_iterable
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.isort]
combine-as-imports = true
split-on-trailing-comma = false