1
0
mirror of https://github.com/nukesor/pueue synced 2024-06-29 06:04:21 +00:00

fix: Streamline linting logic

This commit is contained in:
Arne Beer 2024-05-20 14:36:34 +02:00
parent 4805fc7418
commit cf0df55709
No known key found for this signature in database
GPG Key ID: CC9408F679023B65
2 changed files with 16 additions and 3 deletions

View File

@ -72,8 +72,20 @@ jobs:
lint-${{ runner.os }}-cargo-${{ matrix.target }}-
${{ runner.os }}-cargo-${{ matrix.target }}-
- name: Install cargo-sort
run: cargo install cargo-sort || exit 0
if: matrix.target != 'x86_64-pc-windows-msvc'
# ----- Actual linting logic ------
# These lines should mirror the `just lint` command.
- name: cargo fmt
run : cargo fmt --all -- --check
run: cargo fmt --all -- --check
- name: cargo sort
run: cargo sort --workspace --check
# Don't run cargo-sort on windows, as the formatting behavior seems to be slightly different:
# https://github.com/DevinR528/cargo-sort/issues/56
if: matrix.target != 'x86_64-pc-windows-msvc'
- name: cargo clippy
run: cargo clippy --tests --workspace -- -D warnings

View File

@ -10,11 +10,12 @@ nextest:
just ensure_installed nextest
cargo nextest run --workspace
# If you change anything in here, make sure to also adjust the lint CI job!
lint:
just ensure_installed sort
cargo fmt --check
cargo fmt --all -- --check
cargo sort --workspace --check
cargo clippy --all --tests
cargo clippy --tests --workspace -- -D warnings
format:
just ensure_installed sort