Skip to content

Commit 6379e82

Browse files
authored
Add CI hook to check code formatting using cargo fmt --check (#18)
1 parent b8b688f commit 6379e82

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/ci.yml

+8
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,11 @@ jobs:
2828
# - uses: actions/checkout@v2
2929
# - name: cargo clippy
3030
# run: cargo clippy -- -D warnings
31+
# uncoment to enable format checking
32+
# fmt:
33+
# runs-on: ubuntu-latest
34+
# name: Format
35+
# steps:
36+
# - uses: actions/checkout@v3
37+
# - name: cargo fmt
38+
# run: cargo fmt --check

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ cargo clippy
148148

149149
Once installed, you can use the [download command](#download-input-for-a-day).
150150

151+
### Check code formatting in CI
152+
153+
Uncomment the `format` job in the `ci.yml` workflow to enable fmt checks in CI.
154+
151155
### Enable clippy lints in CI
152156

153157
Uncomment the `clippy` job in the `ci.yml` workflow to enable clippy checks in CI.

0 commit comments

Comments
 (0)