-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
139 lines (120 loc) · 3.36 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
[project]
name = "fonk"
version = "0.1.2"
description = "fonk: pyproject.toml based task runner"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"rich>=13.9.4",
"tomli>=2.2.1",
]
authors = [
{name = "Thijs Miedema", email = "[email protected]"},
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
]
[dependency-groups]
dev = [
"mypy>=1.14.1",
"pytest>=8.3.4",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project.scripts]
fonk = "fonk.cli:app"
[tool.uv]
package = true
[tool.ruff]
line-length = 120
target-version = "py311"
[tool.ruff.lint]
select = ["A", "C", "E", "F", "UP", "RUF", "I", "PL", "PTH", "TID252", "SIM"]
ignore = ["E402", "PLR2004", "PLR0913", "RUF001"]
fixable = ["C", "E", "F", "UP", "I", "PL", "RUF", "PTH", "PLC", "TID252", "SIM"]
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.mypy]
python_version = "3.11"
warn_unused_configs = true
warn_unused_ignores = true
show_error_codes = true
check_untyped_defs = true
show_column_numbers = true
no_implicit_optional = true
ignore_missing_imports = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
disallow_untyped_calls = true
[tool.fonk]
flags = [
{name = "fix", description = "Autofix issues where possible"},
{name = "debug", description = "Enable debugging in test suite"},
]
[tool.fonk.default]
description = "Most commonly used: run all checks in fix mode"
command = "all"
flags = ["fix"]
[tool.fonk.alias.all]
description = "Run all checks"
commands = ["uv-lock", "ruff-check", "ruff-format", "mypy", "pytest"]
[tool.fonk.alias.format]
description = "Check and/or fix code formatting/styling"
commands = ["ruff-check", "ruff-format"]
flags = ["fix"]
[tool.fonk.alias.typecheck]
description = "Run the type checker"
commands = ["mypy"]
[tool.fonk.alias.test]
description = "Run the test suite"
commands = ["pytest"]
[tool.fonk.command.uv-lock]
type = "shell"
description = "Check if the lock file is up to date"
arguments = ["uv", "lock", "--check"]
flags = [
{on = "verbose", add = "--verbose"},
{on = "quiet", add = "--quiet"},
{on = "fix", remove = "--check"},
]
[tool.fonk.command.ruff-check]
type = "uvx"
description = "Check and/or fix the code style"
arguments = ["ruff", "check", "src"]
flags = [
{on = "verbose", add = "--verbose"},
{on = "quiet", add = "--quiet"},
{on = "fix", add = "--fix"},
]
[tool.fonk.command.ruff-format]
type = "uvx"
description = "Check and/or fix code formatting"
arguments = ["ruff", "format", "--check", "src"]
flags = [
{on = "verbose", add = "--verbose"},
{on = "quiet", add = "--quiet"},
{on = "fix", remove = "--check"},
]
[tool.fonk.command.mypy]
type = "uv"
description = "Perform static type checking"
arguments = ["mypy", "src"]
flags = [
{on = "verbose", add = "--verbose"},
{on = "quiet", add = "--no-error-summary"}
]
[tool.fonk.command.pytest]
type = "uv"
description = "Run the test suite with pytest"
arguments = ["pytest", "tests", "--verbose"]
flags = [
{on = "verbose", add = "-vvv", remove = "--verbose"},
{on = "quiet", add = ["-q", "--no-summary"], remove = "--verbose"},
{on = "fail-quick", add = "-x"},
{on = "debug", add = "--pdb"}
]