mirror of
https://github.com/nukesor/pueue
synced 2024-09-30 04:53:37 +00:00
fix: Streamline linting logic
This commit is contained in:
parent
4805fc7418
commit
cf0df55709
14
.github/workflows/lint.yml
vendored
14
.github/workflows/lint.yml
vendored
|
@ -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
|
||||
|
|
5
Justfile
5
Justfile
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue