mirror of
https://github.com/vacp2p/zerokit.git
synced 2026-04-04 03:00:25 -04:00
## Description Updated PR template ## Testing <!-- Describe the testing done for this PR --> ## Checklist - [ ] I have run the CI coverage report. Add the `run-coverage` label to this PR to enable it.
3.1 KiB
3.1 KiB
Description
Changes
Testing
PR Lifecycle
Important
Draft PRs signal that work is still in progress and will not trigger CI. Only mark your PR as Ready for review when you believe it is complete. All CI checks must pass before requesting a review.
Code Guidelines
Please keep the following in mind (see CONTRIBUTING.md for full details):
Commits
- Follow Conventional Commits (
feat(rln):,fix(utils):,chore:, etc.) - Use the appropriate scope:
rln,rln-cli,rln-wasm,utils,ci - GPG-sign your commits
Error Handling
- No panics in library code. Do not use
unwrap(),expect(), orpanic!()in production paths insiderln/src/orutils/src/. The only acceptable exception is an internal invariant that is statically guaranteed — and even then, prefer returning an error. - Use the project's
thiserror-based error types (RLNError,ProtocolError,UtilsError, etc.) and propagate errors with?. - Provide context in error variants (e.g.,
InsufficientData { expected, actual }). unwrap()is fine in tests.
Code Style
- Run
cargo fmt --all -- --checkto verify formatting (CI enforces this on stable). - Group imports: std first, then external crates, then local modules (see
rustfmt.toml). - Use
pub(crate)for items that should not be part of the public API. - Apply
Zeroize/ZeroizeOnDropto any struct holding secret material.
Linting (mirrors CI)
CI runs clippy across multiple crate/feature combinations. Run the relevant checks locally before pushing:
# Default features — workspace root (rln + utils)
cargo clippy --all-targets --tests --release -- -D warnings
# Stateless feature — from rln/
cd rln && cargo clippy --all-targets --tests --release \
--features=stateless --no-default-features -- -D warnings
# WASM target — from rln-wasm/
cd rln-wasm && cargo clippy --target wasm32-unknown-unknown \
--tests --release -- -D warnings
At minimum, run the default-features check. If your changes touch stateless or rln-wasm, run those checks as well.
Checklist
- My PR title follows Conventional Commits format
- I have linked the related issue(s)
cargo fmt --all -- --checkproduces no changes- Clippy passes for all affected crate/feature combinations (see Linting above)
make testpasses locally- No new
unwrap()/expect()/panic!()in library code - New code includes appropriate tests (unit / integration / WASM where applicable)
- I have run the CI coverage report — add the
run-coveragelabel to enable it - All CI checks pass and the PR is marked Ready for review