Skip to content

Commit

Permalink
Merge pull request #532 from Nukesor/streamline-lints
Browse files Browse the repository at this point in the history
fix: Streamline linting logic
  • Loading branch information
Nukesor authored May 24, 2024
2 parents 5d5ccdd + cf0df55 commit 4b03972
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 3 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4b03972

Please sign in to comment.