-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
196 lines (175 loc) · 5.57 KB
/
Copy pathpyproject.toml
File metadata and controls
196 lines (175 loc) · 5.57 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
190
191
192
193
194
195
196
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[dependency-groups]
dev = [
"tox-uv>=1.35.2",
{include-group = "docs"},
{include-group = "lint"},
{include-group = "test"},
{include-group = "type"}
]
docs = [
"furo>=2024.8.6",
"sphinx>=8.1.3",
"sphinx-autodoc-typehints>=2.5.0"
]
lint = [
"pre-commit>=4.6.0"
]
test = [
"coverage>=7.14.1",
"pytest>=9.0.3"
]
type = [
"pyright>=1.1.410",
{include-group = "test"}
]
[project]
authors = [{email = "lilspazjoekp@gmail.com", name = "Joel Payne"}]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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",
"Topic :: Software Development :: Code Generators",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Utilities",
"Typing :: Typed"
]
dependencies = [
"libcst>=1.8.6,<2.0.0",
"pathspec>=1.1.1",
"ruff>=0.1.2"
]
description = "A Python codemod that sorts and organizes code in your files."
dynamic = ["version"]
keywords = ["codemod", "codesorter", "libcst", "sort"]
license = {file = "LICENSE.txt"}
maintainers = [
{email = "lilspazjoekp@gmail.com", name = "Joel Payne"},
{email = "bbzbryce@gmail.com", name = "Bryce Boe"}
]
name = "codesorter"
readme = "README.rst"
requires-python = ">=3.10"
[project.scripts]
codesorter = "codesorter:main"
[project.urls]
"Change Log" = "https://codesorter.readthedocs.io/en/latest/package_info/change_log.html"
"Documentation" = "https://codesorter.readthedocs.io/"
"Issue Tracker" = "https://github.com/praw-dev/CodeSorter/issues"
"Source Code" = "https://github.com/praw-dev/CodeSorter"
[tool.coverage.report]
exclude_lines = [
"@abstract",
"@overload",
"if TYPE_CHECKING:",
"pragma: no cover"
]
[tool.hatch.version]
path = "codesorter/const.py"
[tool.pyright]
include = ["codesorter"]
pythonVersion = "3.10"
typeCheckingMode = "strict"
[tool.pytest.ini_options]
filterwarnings = "ignore::DeprecationWarning"
testpaths = ["tests"]
[tool.ruff]
exclude = ["examples", "tests/test_files"]
include = ["*.py"]
line-length = 120
preview = true
[tool.ruff.lint]
ignore = [
"COM812", # trailing comma missing (conflicts with the formatter)
"CPY001", # missing copyright notice
"D203", # incorrect-blank-line-before-class (conflicts with D211)
"D213", # multi-line-summary-second-line (conflicts with D212)
"DOC201", # `return` not documented in docstring
"E501", # line too long (handled by the formatter)
"ISC001" # single-line implicit string concatenation (conflicts with the formatter)
]
select = ["ALL"]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
suppress-dummy-args = true
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = ["id"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.per-file-ignores]
"codesorter/sort_code.py" = [
"ARG002", # libcst visitor methods must accept original_node/updated_node
"N802", # libcst visitor methods must use visit_CamelCase / leave_CamelCase
"PLR0912", # libcst pattern matching produces unavoidable branching
"PLR1702", # libcst pattern matching produces unavoidable nesting
"PLW0717" # libcst extractall blocks are necessarily long try clauses
]
"docs/conf.py" = [
"A001", # `copyright` is a Sphinx config global that shadows a builtin
"D100", # the Sphinx config module needs no docstring
"DTZ002", # the copyright year does not need a timezone
"INP001" # docs/ is not an importable package
]
"tests/*.py" = [
"ANN001", # pytest fixture params don't need annotations
"ANN201", # test functions don't need return annotations
"ARG002", # pytest passes fixtures (e.g. capsys) that may be unused
"D103", # test functions don't need docstrings
"PLC0415", # tests import the CLI lazily inside functions
"PLC1901", # comparison-to-empty-string idiom is fine in tests
"PLR0904", # a test class naturally accumulates many test methods
"PLR6301", # pytest test methods on a class cannot be static
"S101" # pytest tests use assert
]
[tool.tomlsort]
sort_inline_tables = true
sort_table_keys = true
[tool.tox]
envlist = ["py310", "py311", "py312", "py313", "py314", "docs", "pre-commit", "type"]
minversion = "4.22"
[tool.tox.env.docs]
base_python = ["py314"]
commands = [
["sphinx-build", "-W", "--keep-going", "-n", "docs/", "{env_tmp_dir}/html"]
]
dependency_groups = ["docs"]
description = "build docs with sphinx"
runner = "uv-venv-lock-runner"
[tool.tox.env.linkcheck]
base_python = ["py314"]
commands = [
["sphinx-build", "--keep-going", "-b", "linkcheck", "docs/", "{env_tmp_dir}/linkcheck"]
]
dependency_groups = ["docs"]
description = "check documentation for broken external links"
runner = "uv-venv-lock-runner"
[tool.tox.env.pre-commit]
commands = [["pre-commit", "run", "--all-files"]]
dependency_groups = ["lint"]
description = "run pre-commit on code base"
pass_env = ["SKIP"]
runner = "uv-venv-lock-runner"
[tool.tox.env.type]
commands = [["pyright"]]
dependency_groups = ["type"]
description = "run type check on code base"
runner = "uv-venv-lock-runner"
[tool.tox.env_run_base]
commands = [
["coverage", "run", "--source", "codesorter", "--module", "pytest", "{posargs}"],
["coverage", "report", "-m"]
]
dependency_groups = ["test"]
description = "Run test under {base_python}"
runner = "uv-venv-lock-runner"