From bd2cc623386aa4235c5758b01f7fd4d259246969 Mon Sep 17 00:00:00 2001 From: John Nunley Date: Tue, 12 Mar 2024 19:47:07 -0700 Subject: [PATCH] ci: Add spellcheck to CI This commit adds a spellchecker to the CI pipeline. This prevents typos from being made in future commits. See also: rust-windowing/winit#3557 Signed-off-by: John Nunley --- .github/workflows/ci.yml | 12 +++++++++++- src/backends/wayland/buffer.rs | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c16bd5c..abd30a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,8 @@ on: branches: [master] jobs: - Check_Formatting: + fmt: + name: Tidy Code runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -16,9 +17,17 @@ jobs: components: rustfmt - name: Check Formatting run: cargo +stable fmt --all -- --check + - uses: taiki-e/install-action@v2 + with: + tool: typos-cli + - name: Check Formatting + run: cargo fmt --all -- --check + - name: Run Typos + run: typos miri-tests: runs-on: ubuntu-latest + needs: fmt steps: - uses: actions/checkout@v4 - uses: hecrj/setup-rust-action@v2 @@ -30,6 +39,7 @@ jobs: tests: name: Tests + needs: fmt strategy: fail-fast: false matrix: diff --git a/src/backends/wayland/buffer.rs b/src/backends/wayland/buffer.rs index 0c8bf86..999d49d 100644 --- a/src/backends/wayland/buffer.rs +++ b/src/backends/wayland/buffer.rs @@ -55,10 +55,10 @@ fn create_memfile() -> File { } } - panic!("Failed to generate non-existant shm name") + panic!("Failed to generate non-existent shm name") } -// Round size to use for pool for given dimentions, rounding up to power of 2 +// Round size to use for pool for given dimensions, rounding up to power of 2 fn get_pool_size(width: i32, height: i32) -> i32 { ((width * height * 4) as u32).next_power_of_two() as i32 }