Skip to content

Commit 4ee3f5d

Browse files
authored
docs: Coverage check section in DEVELOPMENT.md (#117)
drive-by: Copy justfile from hugr
1 parent 906c4e2 commit 4ee3f5d

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
Cargo.lock
2-
target/
2+
target/
3+
4+
# Coverage reports
5+
lcov.info

DEVELOPMENT.md

+14
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ We also check for clippy warnings, which are a set of linting rules for rust. To
5858
cargo clippy --all-targets
5959
```
6060

61+
## 📈 Code Coverage
62+
63+
We run coverage checks on the CI. Once you submit a PR, you can review the
64+
line-by-line coverage report on
65+
[codecov](https://app.codecov.io/gh/CQCL/portgraph/commits?branch=All%20branches).
66+
67+
To run the coverage checks locally, install `cargo-llvm-cov`, generate the report with:
68+
```bash
69+
cargo llvm-cov --lcov > lcov.info
70+
```
71+
72+
and open it with your favourite coverage viewer. In VSCode, you can use
73+
[`coverage-gutters`](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters).
74+
6175
## 🌐 Contributing to portgraph
6276

6377
We welcome contributions to portgraph! Please open [an issue](https://github.com/CQCL/portgraph/issues/new) or [pull request](https://github.com/CQCL/portgraph/compare) if you have any questions or suggestions.

justfile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# List the available commands
2+
help:
3+
@just --list --justfile {{justfile()}}
4+
5+
# Run all the rust tests
6+
test:
7+
cargo test --all-features
8+
9+
# Auto-fix all clippy warnings
10+
fix:
11+
cargo clippy --all-targets --all-features --workspace --fix --allow-staged
12+
13+
# Run the pre-commit checks
14+
check:
15+
./.github/pre-commit
16+
17+
# Format the code
18+
format:
19+
cargo fmt
20+
21+
# Generate a test coverage report
22+
coverage:
23+
cargo llvm-cov --lcov > lcov.info

0 commit comments

Comments
 (0)