From 8ab6bdb8c621a852e1f01bf9c0471be7a638b538 Mon Sep 17 00:00:00 2001 From: Leynos Date: Wed, 18 Jun 2025 21:58:47 +0100 Subject: [PATCH] Add Makefile and reference it in guidelines --- AGENTS.md | 5 +++-- Makefile | 17 +++++++++++++++++ tests/lifecycle.rs | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 Makefile diff --git a/AGENTS.md b/AGENTS.md index eda1a211..394b057a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -94,8 +94,9 @@ This repository is written in Rust and uses Cargo for building and dependency management. Contributors should follow these best practices when working on the project: -- Run cargo fmt, cargo clippy -- -D warnings, and RUSTFLAGS="-D warnings" cargo - test before committing. +- Run `make fmt`, `make lint`, and `make test` before committing. These targets + wrap `cargo fmt`, `cargo clippy`, and `cargo test` with the appropriate + flags. - Clippy warnings MUST be disallowed. - Fix any warnings emitted during tests in the code itself rather than silencing them. diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..8c6b9709 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +.PHONY: lint test fmt + +# Run Clippy lints across all targets and features, failing on warnings +lint: + cargo clippy --all-targets --all-features -- -D warnings + +# Execute tests with warnings treated as errors +# --quiet ensures less verbose output on success +# Use RUSTFLAGS to deny warnings at compile time +# so new warnings cause failures + +test: + RUSTFLAGS="-D warnings" cargo test --quiet + +# Format the entire workspace +fmt: + cargo fmt --all diff --git a/tests/lifecycle.rs b/tests/lifecycle.rs index bcfc41b8..b02a552d 100644 --- a/tests/lifecycle.rs +++ b/tests/lifecycle.rs @@ -67,7 +67,7 @@ async fn teardown_without_setup_does_not_run() { let app = WireframeApp::new() .unwrap() - .on_connection_teardown(move |_| { + .on_connection_teardown(move |()| { let teardown_clone = teardown_clone.clone(); async move { teardown_clone.fetch_add(1, Ordering::SeqCst);