From 3d9ff51d934a7abaabd749eb2c052d594371c369 Mon Sep 17 00:00:00 2001 From: Ekaterina Broslavskaya Date: Mon, 16 Feb 2026 19:10:15 +0700 Subject: [PATCH] feat(docs): provide pull request template (#377) ## Description Updated PR template ## Testing ## Checklist - [ ] I have run the CI coverage report. Add the `run-coverage` label to this PR to enable it. --- .github/PULL_REQUEST_TEMPLATE.md | 77 ++++++++++++++++++++++++++++++-- 1 file changed, 74 insertions(+), 3 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a4f2447..db8e6f7 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,12 +1,83 @@ ## 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](../CONTRIBUTING.md) for full details): + +### Commits + +- Follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) (`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()`, or `panic!()` + in production paths inside `rln/src/` or `utils/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 -- --check` to 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` / `ZeroizeOnDrop` to any struct holding secret material. + +### Linting (mirrors CI) + +CI runs clippy across multiple crate/feature combinations. Run the relevant checks locally before pushing: + +```bash +# 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 -- [ ] I have run the CI coverage report. Add the `run-coverage` label to this PR to enable it. +- [ ] My PR title follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format +- [ ] I have linked the related issue(s) +- [ ] `cargo fmt --all -- --check` produces no changes +- [ ] Clippy passes for all affected crate/feature combinations (see [Linting](#linting-mirrors-ci) above) +- [ ] `make test` passes 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-coverage` label to enable it +- [ ] All CI checks pass and the PR is marked **Ready for review**