Skip to content

Commit 2e9ca5b

Browse files
committed
🚀 add dprint
1 parent 97635c6 commit 2e9ca5b

File tree

6 files changed

+48
-3
lines changed

6 files changed

+48
-3
lines changed

‎.github/workflows/ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ jobs:
5252
uv run --no-sync ruff check --output-format=github
5353
uv run --no-sync ruff format --check
5454
55+
- name: dprint
56+
run: uv run --no-sync dprint check
57+
5558
- name: pytest
5659
run: uv run --no-sync pytest
5760

‎.vscode/extensions.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"ms-python.python",
88
"redhat.vscode-yaml",
99
"seatonjiang.gitmoji-vscode",
10-
"tamasfe.even-better-toml"
10+
"tamasfe.even-better-toml",
11+
"dprint.dprint"
1112
],
1213
"unwantedRecommendations": ["ms-pyright.pyright", "ms-python.vscode-pylance"]
1314
}

‎dprint.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"excludes": [
3+
"**/*-lock.json",
4+
"**/node_modules"
5+
],
6+
"plugins": [
7+
"https://plugins.dprint.dev/json-0.20.0.wasm",
8+
"https://plugins.dprint.dev/markdown-0.18.0.wasm",
9+
"https://plugins.dprint.dev/toml-0.7.0.wasm",
10+
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm"
11+
]
12+
}

‎lefthook.yml

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ pre-commit:
99
glob: "*.{py,pyi}"
1010
run: uv run --no-sync ruff format {staged_files}
1111
stage_fixed: true
12+
dprint-format:
13+
glob: "*.{md,json,yml,yaml,toml}"
14+
run: uv run --no-sync dprint fmt {staged_files}
15+
stage_fixed: true
1216
ignore-format:
1317
glob: "*.{py,pyi}"
1418
run: uv run --no-sync tool/format_ignores.py {staged_files}

‎pyproject.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ dependencies = []
5050

5151
[dependency-groups]
5252
numpy = ["numtype[numpy]"]
53-
lint = ["ruff>=0.11.3"]
53+
lint = [
54+
"dprint-py>=0.49.1.2",
55+
"ruff>=0.11.3",
56+
]
5457
pytest = [
5558
{include-group = "numpy"},
5659
"pytest>=8.3.5",

‎uv.lock

+23-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)