Skip to content

lint: upgrade perfectionist #145

lint: upgrade perfectionist

lint: upgrade perfectionist #145

Workflow file for this run

name: Dylint
on:
- push
- pull_request
jobs:
dylint_check:
name: Dylint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Cache
id: cache
uses: actions/cache@v5
timeout-minutes: 2
continue-on-error: true
with:
path: |
~/.cargo
~/.dylint_drivers
target
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}-${{ hashFiles('dylint.toml') }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ github.job }}-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}-${{ hashFiles('dylint.toml') }}-${{ hashFiles('**/Cargo.lock') }}
${{ github.job }}-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}-${{ hashFiles('dylint.toml') }}-
${{ github.job }}-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}-
- name: Install Rust
shell: bash
run: |
installer=$(mktemp -d)/install-rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > $installer
bash $installer --default-toolchain $(cat rust-toolchain) -y
- name: Install dylint tooling
shell: bash
run: cargo install --locked cargo-dylint dylint-link
# When the primary cache key did not match exactly, the cache was either
# missed entirely or restored from one of the looser `restore-keys`
# entries. The third entry ignores `dylint.toml`, so the restored
# `target/dylint/libraries/libperfectionist.so` may have been built from
# a different `dylint.toml`. `cargo dylint` does not always detect a
# changed `git` `rev`/`tag` and reuses the cached `.so` as-is. Remove
# the dylint build directory in this case so the library rebuilds from
# the in-tree `dylint.toml`. On an exact cache hit the `.so` matches
# the current `dylint.toml` and the rebuild is skipped.
- name: Invalidate stale dylint build artifacts
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: rm -rf target/dylint
- name: Run dylint
shell: bash
env:
FMT: 'false'
LINT: 'false'
DOC: 'false'
BUILD: 'false'
TEST: 'false'
DYLINT: 'true'
run: ./test.sh
- name: Clean workspace artifacts before cache
if: always()
continue-on-error: true
shell: bash
run: cargo clean --workspace