Skip to content

Commit e3548c5

Browse files
authored
Use taplo for formatting (#150)
1 parent 892f15a commit e3548c5

File tree

3 files changed

+303
-306
lines changed

3 files changed

+303
-306
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,25 @@ repos:
1111
hooks:
1212
- id: uv-lock
1313
args: [--upgrade]
14+
- repo: https://github.com/compwa/taplo-pre-commit
15+
rev: v0.9.3
16+
hooks:
17+
- id: taplo-format
18+
args:
19+
[
20+
--option,
21+
indent_tables=true,
22+
--option,
23+
indent_entries=true,
24+
--option,
25+
reorder_keys=true,
26+
]
1427
- repo: https://github.com/dycw/pre-commit-hooks
1528
rev: 0.13.10
1629
hooks:
1730
- id: format-requirements
1831
- id: replace-sequence-str
1932
# - id: run-bump-my-version
20-
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
21-
rev: v2.15.0
22-
hooks:
23-
- id: pretty-format-toml
24-
args: [--autofix, --trailing-commas]
2533
- repo: https://github.com/scop/pre-commit-shfmt
2634
rev: v3.12.0-2
2735
hooks:

pyproject.toml

Lines changed: 167 additions & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -2,176 +2,176 @@
22

33
# build-system
44
[build-system]
5-
build-backend = "uv_build"
6-
requires = ["uv_build"]
5+
build-backend = "uv_build"
6+
requires = ["uv_build"]
77

88
# dependency groups
99
[dependency-groups]
10-
dev = [
11-
"dycw-utilities[test]",
12-
"pyright[nodejs]",
13-
"rich",
14-
]
10+
dev = ["dycw-utilities[test]", "pyright[nodejs]", "rich"]
1511

1612
# project
1713
[project]
18-
authors = [{name = "Derek Wan", email = "d.wan@icloud.com"}]
19-
dependencies = []
20-
name = "dycw-template"
21-
readme = "README.md"
22-
requires-python = ">= 3.14"
23-
version = "0.1.1"
24-
25-
# bump-my-version
26-
[tool.bumpversion]
27-
allow_dirty = true
28-
current_version = "0.1.1"
29-
30-
[[tool.bumpversion.files]]
31-
filename = "src/dycw_template/__init__.py"
32-
replace = "__version__ = \"{new_version}\""
33-
search = "__version__ = \"{current_version}\""
34-
35-
# coverage
36-
[tool.coverage]
37-
38-
[tool.coverage.html]
39-
directory = ".coverage/html"
40-
41-
[tool.coverage.report]
42-
exclude_also = ["@overload", "if TYPE_CHECKING:"]
43-
fail_under = 100.0
44-
skip_covered = true
45-
skip_empty = true
46-
47-
[tool.coverage.run]
48-
branch = true
49-
data_file = ".coverage/data"
50-
parallel = true
51-
52-
# nitpick
53-
[tool.nitpick]
54-
style = [
55-
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/3.14.toml",
56-
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/common.toml",
57-
]
58-
59-
# pyright
60-
[tool.pyright]
61-
deprecateTypingAliases = true
62-
enableReachabilityAnalysis = false
63-
ignore = ["**/_typeshed/**"]
64-
pythonVersion = "3.14"
65-
reportAny = false
66-
reportCallInDefaultInitializer = true
67-
reportImplicitOverride = true
68-
reportImplicitStringConcatenation = true
69-
reportImportCycles = true
70-
reportMissingSuperCall = true
71-
reportMissingTypeArgument = false
72-
reportMissingTypeStubs = false
73-
reportPrivateUsage = false
74-
reportPropertyTypeMismatch = true
75-
reportShadowedImports = true
76-
reportUninitializedInstanceVariable = true
77-
reportUnknownArgumentType = false
78-
reportUnknownMemberType = false
79-
reportUnknownParameterType = false
80-
reportUnknownVariableType = false
81-
reportUnnecessaryComparison = false
82-
reportUnnecessaryTypeIgnoreComment = true
83-
reportUnusedCallResult = true
84-
reportUnusedImport = false
85-
reportUnusedVariable = false
86-
typeCheckingMode = "strict"
87-
88-
# pytest
89-
[tool.pytest]
90-
91-
[tool.pytest.ini_options]
92-
addopts = [
93-
"-ra",
94-
"-vv",
95-
"--color=auto",
96-
"--cov=dycw_template",
97-
"--cov-config=pyproject.toml",
98-
"--cov-report=html",
99-
"--strict-markers",
100-
]
101-
asyncio_default_fixture_loop_scope = "function"
102-
asyncio_mode = "auto"
103-
collect_imported_tests = false
104-
filterwarnings = ["error"]
105-
minversion = "8.0"
106-
testpaths = ["src/tests"]
107-
xfail_strict = true
108-
109-
# ruff
110-
[tool.ruff]
111-
src = ["src"]
112-
target-version = "py314"
113-
unsafe-fixes = true
114-
115-
[tool.ruff.format]
116-
preview = true
117-
skip-magic-trailing-comma = true
118-
119-
[tool.ruff.lint]
120-
explicit-preview-rules = true
121-
fixable = ["ALL"]
122-
ignore = [
123-
"ANN401", # any-type
124-
"ASYNC109", # async-function-with-timeout
125-
"C901", # complex-structure
126-
"CPY", # flake8-copyright
127-
"D", # pydocstyle
128-
"DOC", # pydoclint
129-
"E501", # line-too-long
130-
"PD", # pandas-vet
131-
"PERF203", # try-except-in-loop
132-
"PLC0415", # import-outside-top-level
133-
"PLR0904", # too-many-public-methods
134-
"PLR0911", # too-many-return-statements
135-
"PLR0912", # too-many-branches
136-
"PLR0913", # too-many-arguments
137-
"PLR0915", # too-many-statements
138-
"PLR2004", # magic-value-comparison
139-
"PT012", # pytest-raises-with-multiple-statements
140-
"PT013", # pytest-incorrect-pytest-import
141-
"S202", # tarfile-unsafe-members
142-
"S310", # suspicious-url-open-usage
143-
"S311", # suspicious-non-cryptographic-random-usage
144-
"S602", # subprocess-popen-with-shell-equals-true
145-
"S603", # subprocess-without-shell-equals-true
146-
"S607", # start-process-with-partial-path
147-
# preview
148-
"S101", # assert
149-
# formatter
150-
"W191", # tab-indentation
151-
"E111", # indentation-with-invalid-multiple
152-
"E114", # indentation-with-invalid-multiple-comment
153-
"E117", # over-indented
154-
"COM812", # missing-trailing-comma
155-
"COM819", # prohibited-trailing-comma
156-
"ISC001", # single-line-implicit-string-concatenation
157-
"ISC002", # multi-line-implicit-string-concatenation
158-
]
159-
preview = true
160-
select = [
161-
"ALL",
162-
# preview
163-
"RUF022", # unsorted-dunder-all
164-
"RUF029", # unused-async
165-
]
166-
167-
[tool.ruff.lint.extend-per-file-ignores]
168-
"src/tests/**/*.py" = [
169-
"S101", # assert-used
170-
]
171-
172-
[tool.ruff.lint.flake8-tidy-imports]
173-
ban-relative-imports = "all"
174-
175-
[tool.ruff.lint.isort]
176-
required-imports = ["from __future__ import annotations"]
177-
split-on-trailing-comma = false
14+
authors = [{ email = "d.wan@icloud.com", name = "Derek Wan" }]
15+
dependencies = []
16+
name = "dycw-template"
17+
readme = "README.md"
18+
requires-python = ">= 3.14"
19+
version = "0.1.1"
20+
21+
22+
# tool
23+
[tool]
24+
25+
# bump-my-version
26+
[tool.bumpversion]
27+
allow_dirty = true
28+
current_version = "0.1.1"
29+
30+
[[tool.bumpversion.files]]
31+
filename = "src/dycw_template/__init__.py"
32+
replace = "__version__ = \"{new_version}\""
33+
search = "__version__ = \"{current_version}\""
34+
35+
# coverage
36+
[tool.coverage]
37+
38+
[tool.coverage.html]
39+
directory = ".coverage/html"
40+
41+
[tool.coverage.report]
42+
exclude_also = ["@overload", "if TYPE_CHECKING:"]
43+
fail_under = 100.0
44+
skip_covered = true
45+
skip_empty = true
46+
47+
[tool.coverage.run]
48+
branch = true
49+
data_file = ".coverage/data"
50+
parallel = true
51+
52+
# nitpick
53+
[tool.nitpick]
54+
style = [
55+
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/3.14.toml",
56+
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/common.toml",
57+
]
58+
59+
# pyright
60+
[tool.pyright]
61+
deprecateTypingAliases = true
62+
enableReachabilityAnalysis = false
63+
ignore = ["**/_typeshed/**"]
64+
pythonVersion = "3.14"
65+
reportAny = false
66+
reportCallInDefaultInitializer = true
67+
reportImplicitOverride = true
68+
reportImplicitStringConcatenation = true
69+
reportImportCycles = true
70+
reportMissingSuperCall = true
71+
reportMissingTypeArgument = false
72+
reportMissingTypeStubs = false
73+
reportPrivateUsage = false
74+
reportPropertyTypeMismatch = true
75+
reportShadowedImports = true
76+
reportUninitializedInstanceVariable = true
77+
reportUnknownArgumentType = false
78+
reportUnknownMemberType = false
79+
reportUnknownParameterType = false
80+
reportUnknownVariableType = false
81+
reportUnnecessaryComparison = false
82+
reportUnnecessaryTypeIgnoreComment = true
83+
reportUnusedCallResult = true
84+
reportUnusedImport = false
85+
reportUnusedVariable = false
86+
typeCheckingMode = "strict"
87+
88+
# pytest
89+
[tool.pytest]
90+
91+
[tool.pytest.ini_options]
92+
addopts = [
93+
"-ra",
94+
"-vv",
95+
"--color=auto",
96+
"--cov=dycw_template",
97+
"--cov-config=pyproject.toml",
98+
"--cov-report=html",
99+
"--strict-markers",
100+
]
101+
asyncio_default_fixture_loop_scope = "function"
102+
asyncio_mode = "auto"
103+
collect_imported_tests = false
104+
filterwarnings = ["error"]
105+
minversion = "8.0"
106+
testpaths = ["src/tests"]
107+
xfail_strict = true
108+
109+
# ruff
110+
[tool.ruff]
111+
src = ["src"]
112+
target-version = "py314"
113+
unsafe-fixes = true
114+
115+
[tool.ruff.format]
116+
preview = true
117+
skip-magic-trailing-comma = true
118+
119+
[tool.ruff.lint]
120+
explicit-preview-rules = true
121+
fixable = ["ALL"]
122+
ignore = [
123+
"ANN401", # any-type
124+
"ASYNC109", # async-function-with-timeout
125+
"C901", # complex-structure
126+
"CPY", # flake8-copyright
127+
"D", # pydocstyle
128+
"DOC", # pydoclint
129+
"E501", # line-too-long
130+
"PD", # pandas-vet
131+
"PERF203", # try-except-in-loop
132+
"PLC0415", # import-outside-top-level
133+
"PLR0904", # too-many-public-methods
134+
"PLR0911", # too-many-return-statements
135+
"PLR0912", # too-many-branches
136+
"PLR0913", # too-many-arguments
137+
"PLR0915", # too-many-statements
138+
"PLR2004", # magic-value-comparison
139+
"PT012", # pytest-raises-with-multiple-statements
140+
"PT013", # pytest-incorrect-pytest-import
141+
"S202", # tarfile-unsafe-members
142+
"S310", # suspicious-url-open-usage
143+
"S311", # suspicious-non-cryptographic-random-usage
144+
"S602", # subprocess-popen-with-shell-equals-true
145+
"S603", # subprocess-without-shell-equals-true
146+
"S607", # start-process-with-partial-path
147+
# preview
148+
"S101", # assert
149+
# formatter
150+
"W191", # tab-indentation
151+
"E111", # indentation-with-invalid-multiple
152+
"E114", # indentation-with-invalid-multiple-comment
153+
"E117", # over-indented
154+
"COM812", # missing-trailing-comma
155+
"COM819", # prohibited-trailing-comma
156+
"ISC001", # single-line-implicit-string-concatenation
157+
"ISC002", # multi-line-implicit-string-concatenation
158+
]
159+
preview = true
160+
select = [
161+
"ALL",
162+
# preview
163+
"RUF022", # unsorted-dunder-all
164+
"RUF029", # unused-async
165+
]
166+
167+
[tool.ruff.lint.extend-per-file-ignores]
168+
"src/tests/**/*.py" = [
169+
"S101", # assert-used
170+
]
171+
172+
[tool.ruff.lint.flake8-tidy-imports]
173+
ban-relative-imports = "all"
174+
175+
[tool.ruff.lint.isort]
176+
required-imports = ["from __future__ import annotations"]
177+
split-on-trailing-comma = false

0 commit comments

Comments
 (0)