mirror of https://github.com/astral-sh/ruff
Simplify unused snapshot check (#1525)
This commit is contained in:
parent
4b8e30f350
commit
e3867b172d
|
|
@ -116,18 +116,12 @@ jobs:
|
||||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||||
${{ runner.os }}-build-
|
${{ runner.os }}-build-
|
||||||
${{ runner.os }}-
|
${{ runner.os }}-
|
||||||
|
- run: cargo install cargo-insta
|
||||||
- run: pip install black[d]==22.12.0
|
- run: pip install black[d]==22.12.0
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
export INSTA_SNAPSHOT_REFERENCES_FILE="$(mktemp)"
|
cargo insta test --all --delete-unreferenced-snapshots
|
||||||
cargo test --all
|
git diff --exit-code
|
||||||
USED_SNAPSHOTS=$(cat $INSTA_SNAPSHOT_REFERENCES_FILE | xargs realpath --relative-to $PWD)
|
|
||||||
UNUSED_SNAPSHOTS=$(cat <(git ls-files '*.snap') <(echo "$USED_SNAPSHOTS") | sort | uniq -u)
|
|
||||||
if [ ! -z "$UNUSED_SNAPSHOTS" ]; then
|
|
||||||
echo "Found unused snapshots:"
|
|
||||||
echo "$UNUSED_SNAPSHOTS"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- run: cargo test --package ruff --test black_compatibility_test -- --ignored
|
- run: cargo test --package ruff --test black_compatibility_test -- --ignored
|
||||||
|
|
||||||
# TODO(charlie): Re-enable the `wasm-pack` tests.
|
# TODO(charlie): Re-enable the `wasm-pack` tests.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue