Skip to content

Commit

Permalink
docs: Coverage check sectio in DEVELOPMENT.md
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Nov 7, 2023
1 parent b7ebb0d commit 799c81a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ proptest-regressions/
devenv.local.nix

# managed by devenv
.pre-commit-config.yaml
.pre-commit-config.yaml

# Coverage report
lcov.info
14 changes: 14 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@ We also check for clippy warnings, which are a set of linting rules for rust. To
cargo clippy --all-targets
```

## 📈 Code Coverage

We run coverage checks on the CI. Once you submit a PR, you can review the
line-by-line coverage report on
[codecov](https://app.codecov.io/gh/CQCL/hugr/commits?branch=All%20branches).

To run the coverage checks locally, install `cargo-llvm-cov`, generate the report with:
```bash
cargo llvm-cov --lcov > lcov.info
```

and open it with your favourite coverage viewer. In VSCode, you can use
[`coverage-gutters`](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters).

## 🌐 Contributing to HUGR

We welcome contributions to HUGR! Please open [an issue](https://github.com/CQCL/hugr/issues/new) or [pull request](https://github.com/CQCL/hugr/compare) if you have any questions or suggestions.
Expand Down
22 changes: 20 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# List the available commands
help:
@just --list --justfile {{justfile()}}

# Run all the rust tests
test:
cargo test
cargo test --all-features

# Auto-fix all clippy warnings
fix:
cargo clippy --fix --allow-staged
cargo clippy --all-targets --all-features --workspace --fix --allow-staged

# Run the pre-commit checks
check:
./.github/pre-commit

# Format the code
format:
cargo fmt

# Generate a test coverage report
coverage:
cargo llvm-cov --lcov > lcov.info

0 comments on commit 799c81a

Please sign in to comment.