Skip to content

Commit 53551d2

Browse files
added clean.sh script for removing artifacts
1 parent a0281ce commit 53551d2

File tree

2 files changed

+45
-4
lines changed

2 files changed

+45
-4
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
> - Updated the coverage output paths for clarity
66
> - Added a `run-cov.sh` script that also explains some detail on coverage data generation
77
> - Added a `nix` devshell for easy setup
8+
> - Added a `clean.sh` script to clean up generated artificats
89
910
> [!NOTE]
10-
> `cargo-llvm-cov` will generatte this warning when used with [nightly toolchains](https://github.com/taiki-e/cargo-llvm-cov/issues/329)
11-
> `warning: N functions have mismatched data`
12-
> This can be reproduced by checking out the `cargo-llvm-cov-nightly` branch
13-
11+
> Try running `clean.sh` if you encounter any "weird" errors.
12+
> If the error persists, blow out the `.venv` and `~/.cargo/bin` directories and try again.
1413
1514
-------
1615
-------

clean.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env bash
2+
3+
# Function to remove a directory and print the action
4+
remove_dir() {
5+
if [ -d "$1" ]; then
6+
echo "Removing directory: $1"
7+
rm -rf "$1"
8+
fi
9+
}
10+
11+
# Function to remove a file and print the action
12+
remove_file() {
13+
if [ -f "$1" ]; then
14+
echo "Removing file: $1"
15+
rm -f "$1"
16+
fi
17+
}
18+
19+
# Remove .pytest_cache directory
20+
remove_dir .pytest_cache/
21+
22+
# Remove target directory
23+
remove_dir target/
24+
25+
# Remove any __pycache__ directories
26+
find python/ -type d -name "__pycache__" -print | while read -r dir; do
27+
remove_dir "$dir"
28+
done
29+
30+
# Remove pytest-coverage.lcov file
31+
remove_file .coverage
32+
remove_file pytest-coverage.lcov
33+
34+
# Remove rust-coverage.lcov file
35+
remove_file rust-coverage.lcov
36+
37+
# Remove pyo3 files
38+
find python/ -type f -name '_internal.*.so' -print | while read -r file; do
39+
remove_file "$file"
40+
done
41+
42+
echo "Cleanup complete."

0 commit comments

Comments
 (0)