diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6189bc8..aa1762e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,14 +13,19 @@ Thanks for your interest in contributing. ## Local Validation -The CI runs three mandatory checks. Run **all of them locally** before pushing: +The CI runs four mandatory checks. Run **all of them locally** before pushing or opening a PR: ```bash -cargo fmt --check # style: must pass without diff -cargo clippy -- -D warnings # lints: zero warnings allowed -cargo test # tests: all must pass +./ci-check.sh ``` +This executes: + +- `cargo fmt --all -- --check` — style: must pass without diff +- `cargo clippy --all-targets --all-features -- -D warnings` — lints: zero warnings allowed +- `cargo test --all-targets --all-features` — tests: all must pass +- `cargo audit` — dependency vulnerability scan + To auto-fix formatting issues: ```bash diff --git a/ci-check.sh b/ci-check.sh index a78891e..1fc12af 100755 --- a/ci-check.sh +++ b/ci-check.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash set -euo pipefail -echo "=== cargo fmt --check ===" -cargo fmt --check +echo "=== cargo fmt --all -- --check ===" +cargo fmt --all -- --check echo "" -echo "=== cargo clippy -- -D warnings ===" -cargo clippy -- -D warnings +echo "=== cargo clippy --all-targets --all-features -- -D warnings ===" +cargo clippy --all-targets --all-features -- -D warnings echo "" -echo "=== cargo test ===" -cargo test +echo "=== cargo test --all-targets --all-features ===" +cargo test --all-targets --all-features + +echo "" +echo "=== cargo audit ===" +cargo audit --ignore RUSTSEC-2023-0071 echo "" echo "All CI checks passed." diff --git a/src/app/theme.rs b/src/app/theme.rs index 1f3a032..b7bb2cd 100644 --- a/src/app/theme.rs +++ b/src/app/theme.rs @@ -224,7 +224,7 @@ mod tests { let embedded = EMBEDDED_THEMES.iter().find(|(n, _)| *n == "Berlin"); assert!(embedded.is_some(), "Berlin not in EMBEDDED_THEMES"); if let Some((_, content)) = embedded { - assert!(content.len() > 0, "Berlin embed content is empty"); + assert!(!content.is_empty(), "Berlin embed content is empty"); eprintln!("Berlin embed content: {content}"); } // Verify load_theme_by_name returns Berlin