Skip to content

Commit a7c47f9

Browse files
waywardmonkeysmgeisler
authored andcommitted
chore(ci): Check formatting
Uses the same check / action as in `smawk`.
1 parent 09cb1dc commit a7c47f9

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,21 @@ jobs:
270270
- name: Deploy textwrap-wasm-demo-app
271271
if: steps.git-add.outputs.has-changes == 'true'
272272
run: git push origin
273+
274+
format:
275+
name: Format
276+
runs-on: ubuntu-latest
277+
steps:
278+
- name: Checkout repository
279+
uses: actions/checkout@v4
280+
281+
# We use an unstable rustfmt feature and we thus need the
282+
# nightly channel to enforce the formatting.
283+
- name: Setup Rust nightly
284+
run: rustup default nightly
285+
286+
- name: Install rustfmt
287+
run: rustup component add rustfmt
288+
289+
- name: Check Formatting
290+
uses: dprint/check@v2.2

dprint.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"markdown": {
3+
"textWrap": "always"
4+
},
5+
"exec": {
6+
"commands": [{
7+
"command": "rustfmt",
8+
"exts": ["rs"]
9+
}]
10+
},
11+
"excludes": ["target/"],
12+
"plugins": [
13+
"https://plugins.dprint.dev/json-0.17.4.wasm",
14+
"https://plugins.dprint.dev/markdown-0.16.1.wasm",
15+
"https://plugins.dprint.dev/toml-0.5.4.wasm",
16+
"https://plugins.dprint.dev/exec-0.4.3.json@42343548b8022c99b1d750be6b894fe6b6c7ee25f72ae9f9082226dd2e515072",
17+
"https://plugins.dprint.dev/prettier-0.27.0.json@3557a62b4507c55a47d8cde0683195b14d13c41dda66d0f0b0e111aed107e2fe"
18+
]
19+
}

0 commit comments

Comments
 (0)