Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ Closes #<!-- issue number -->

## Commands Run

<!-- Paste the commands you ran locally and confirm each passed. -->
<!-- Prefer `make verify` (format, Clippy, workspace tests, release WASM build).
Paste the command output summary, or list the individual checks below. -->

```
cargo fmt --check
cargo clippy --tests -- -D warnings
cargo test --workspace
make verify
```

- [ ] `cargo fmt --check` — passed
- [ ] `cargo clippy --tests -- -D warnings` — passed
- [ ] `cargo test --workspace` — passed
- [ ] `make verify` — passed
- [ ] (or individually) `cargo fmt --check` — passed
- [ ] (or individually) `cargo clippy --tests -- -D warnings` — passed
- [ ] (or individually) `cargo test --workspace` — passed

---

Expand Down
10 changes: 8 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Run all local verification checks in one command:
make verify
```

This runs formatting checks, the full workspace test suite, and builds the optimized contract WASM. Run this command before opening a pull request.
This runs formatting checks, Clippy linting (with warnings denied), the full workspace test suite, and builds the optimized contract WASM. Run this command before opening a pull request. The README documents the same entry point under [Local verification](README.md#local-verification).

Alternatively, run checks individually:

Expand All @@ -73,6 +73,12 @@ Check formatting:
cargo fmt --check
```

Lint with Clippy (same flags as the PR template):

```bash
cargo clippy --tests -- -D warnings
```

Run the full workspace test suite:

```bash
Expand All @@ -99,7 +105,7 @@ Every pull request must fill in the **[PR template](.github/PULL_REQUEST_TEMPLAT
- **Contract functions changed** — a table listing every function added, modified, or removed (write "none" for documentation-only PRs).
- **Tests added or updated** — names and file paths of new or changed tests, with checkboxes confirming happy-path, failure, and boundary coverage.
- **Security considerations** — a plain-language description of security impact plus the per-section security checklist for any PR that touches contract logic (see `docs/security-checklist.md`).
- **Commands run** — confirmation that `cargo fmt --check`, `cargo clippy --tests -- -D warnings`, and `cargo test --workspace` all pass locally.
- **Commands run** — confirmation that `make verify` passes (format, Clippy, workspace tests, and release WASM build), or equivalently that `cargo fmt --check`, `cargo clippy --tests -- -D warnings`, and `cargo test --workspace` all pass locally.
- **CI status** — all CI checks green before requesting review.

Additional guidance:
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ build-release:
wasm-size:
sh scripts/report-wasm-size.sh "$(WASM_PATH)"

verify: ## Run all local verification checks (format, test, build)
# Single local gate aligned with PR / CI expectations:
# format, lint, workspace tests, and release WASM build.
verify:
cargo fmt --check
cargo clippy --tests -- -D warnings
cargo test --workspace
cargo build --release --target $(WASM_TARGET)
36 changes: 26 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,31 @@ All tests run natively (no WASM needed) using the Soroban SDK test utilities.

---

## Local verification

Before opening a pull request, run the single local verification command:

```bash
make verify
```

This runs the same checks contributors are asked to confirm in the PR template:

1. `cargo fmt --check`
2. `cargo clippy --tests -- -D warnings`
3. `cargo test --workspace`
4. `cargo build --release --target wasm32-unknown-unknown`

See [CONTRIBUTING.md](CONTRIBUTING.md#build-format-and-test) for details and for running each step individually.

## Task Runner

Common tasks are available via `make`:

```bash
make test # Run all tests
make build-wasm # Build the contract WASM in release mode
make clean # Clean build artifacts
make verify # Format, lint, test, and release WASM build
make build-release # Optimized WASM build with size report
make wasm-size # Report size of an existing release WASM
```
---

Expand Down Expand Up @@ -246,9 +263,10 @@ Contributions are welcome! This project is intentionally beginner-friendly.

See **[CONTRIBUTING.md](CONTRIBUTING.md)** for the full guide, including:

- How to run local verification (`make verify`)
- How to format code (`cargo fmt`)
- How to lint code (`cargo clippy -- -D warnings`)
- How to run the test suite (`cargo test`)
- How to lint code (`cargo clippy --tests -- -D warnings`)
- How to run the test suite (`cargo test --workspace`)
- PR checklist and commit message conventions

Every pull request must use the **[PR template](.github/PULL_REQUEST_TEMPLATE.md)**, which requires:
Expand All @@ -258,16 +276,14 @@ Every pull request must use the **[PR template](.github/PULL_REQUEST_TEMPLATE.md
- A description of tests added or updated
- A **[traceability table](docs/traceability-table.md)** mapping each acceptance criterion to changed functions, tests, and edge cases
- A security considerations section (with checklist for contract changes)
- Confirmation that `cargo fmt --check`, `cargo clippy --tests -- -D warnings`, and `cargo test --workspace` all pass
- Confirmation that `make verify` passes (or equivalently `cargo fmt --check`, `cargo clippy --tests -- -D warnings`, and `cargo test --workspace`)
- CI green before requesting review

Quick start:

```bash
# Fork & clone, then verify everything is green before making changes
cargo fmt --check
cargo clippy --tests -- -D warnings
cargo test
# Fork & clone, then verify everything is green before opening a PR
make verify
```

---
Expand Down
18 changes: 5 additions & 13 deletions docs/advanced-development-and-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,11 @@ Before working with the test suite or compiling contract binaries, ensure your h

### Using the `Makefile` Task Runner

The repository includes standard Makefile targets to streamline common workflow steps:
The repository includes Makefile targets to streamline common workflow steps:

- **Run all unit & integration tests:**
- **Run all local verification checks** (format, Clippy, tests, release WASM build):
```bash
make test
```

- **Build release WASM binary:**
```bash
make build-wasm
make verify
```

- **Build release WASM and print binary size report:**
Expand All @@ -89,14 +84,11 @@ The repository includes standard Makefile targets to streamline common workflow
make wasm-size
```

- **Clean build artifacts:**
```bash
make clean
```

The compiled release WebAssembly artifact is created at:
`target/wasm32-unknown-unknown/release/savings_vault.wasm`

See also the README [Local verification](../README.md#local-verification) section and [CONTRIBUTING.md](../CONTRIBUTING.md#build-format-and-test).

---

## 3. Test Suite Architecture and Organization
Expand Down
1 change: 1 addition & 0 deletions docs/contribution-quality-gate.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Every PR must satisfy the following checklist. If any item is missing or incompl
- [ ] **Formatting**: Code is formatted via `cargo fmt`.
- [ ] **Lints**: `cargo clippy --tests` passes with no warnings.
- [ ] **Build**: `make build-release` succeeds and the WASM size remains within acceptable limits.
- [ ] **Local verification**: `make verify` passes (format, Clippy, tests, and release WASM build).

---

Expand Down
3 changes: 3 additions & 0 deletions docs/deployment-environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ No RPC URL, network passphrase, or funded account is needed for local developmen
### Commands

```bash
# Single local verification gate (format, lint, test, release WASM build)
make verify

# Build
cargo build --target wasm32-unknown-unknown
cargo build --target wasm32-unknown-unknown --release
Expand Down
10 changes: 10 additions & 0 deletions docs/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ The compiled `.wasm` file will be at:
target/wasm32-unknown-unknown/release/savings_vault.wasm
```

## Local verification

Before opening a pull request, run the single local verification command from the repository root:

```bash
make verify
```

This checks formatting, Clippy, the workspace test suite, and the release WASM build. See [CONTRIBUTING.md](../CONTRIBUTING.md#build-format-and-test) and the README [Local verification](../README.md#local-verification) section.

## Run Unit Tests

The project includes a comprehensive unit test suite that runs natively without needing a network:
Expand Down