From 6379e82105aefefb44659bf285bb2ece70a2123c Mon Sep 17 00:00:00 2001 From: Burkhard Mittelbach Date: Sun, 4 Dec 2022 18:28:49 +0100 Subject: [PATCH] Add CI hook to check code formatting using `cargo fmt --check` (#18) --- .github/workflows/ci.yml | 8 ++++++++ README.md | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dadca12..ff9de26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,3 +28,11 @@ jobs: # - uses: actions/checkout@v2 # - name: cargo clippy # run: cargo clippy -- -D warnings + # uncoment to enable format checking + # fmt: + # runs-on: ubuntu-latest + # name: Format + # steps: + # - uses: actions/checkout@v3 + # - name: cargo fmt + # run: cargo fmt --check diff --git a/README.md b/README.md index a4a7ce4..cf1b392 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,10 @@ cargo clippy Once installed, you can use the [download command](#download-input-for-a-day). +### Check code formatting in CI + +Uncomment the `format` job in the `ci.yml` workflow to enable fmt checks in CI. + ### Enable clippy lints in CI Uncomment the `clippy` job in the `ci.yml` workflow to enable clippy checks in CI.