Skip to content

Commit 67e9d94

Browse files
chtnnhcursoragent
andcommitted
Fix rustfmt drift and add scripts/ci.sh matching GitHub Actions gates.
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7805f33 commit 67e9d94

4 files changed

Lines changed: 30 additions & 20 deletions

File tree

CONTRIBUTING.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,23 @@ Requirements: Rust 1.75+, Git.
88

99
```bash
1010
cargo build
11+
./scripts/ci.sh # fmt + clippy + tests + ≥95% coverage (same gates as GitHub Actions)
12+
```
13+
14+
Or run pieces individually:
15+
16+
```bash
1117
cargo test --workspace
1218
cargo clippy --all-targets -- -D warnings
1319
cargo fmt --check
20+
./scripts/coverage.sh
1421
```
1522

1623
Binary name is `gg` (`cargo run -- <args>`).
1724

1825
### Coverage
1926

20-
Line coverage must stay **≥ 95%** (enforced in CI).
21-
22-
```bash
23-
./scripts/coverage.sh
24-
# or:
25-
cargo llvm-cov --workspace --fail-under-lines 95 \
26-
--ignore-filename-regex '(tests/|/cargo/registry/)'
27-
```
28-
29-
Add or extend tests under `tests/` for every new command or public code path.
27+
Line coverage must stay **≥ 95%** (enforced in CI via `./scripts/ci.sh` / `./scripts/coverage.sh`).
3028

3129
## Guidelines
3230

scripts/ci.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
# Mirror GitHub Actions CI locally before commit/push.
3+
set -euo pipefail
4+
cd "$(dirname "$0")/.."
5+
6+
export RUSTFLAGS="${RUSTFLAGS:--D warnings}"
7+
8+
echo "==> cargo fmt --check"
9+
cargo fmt --check
10+
11+
echo "==> cargo clippy --all-targets -- -D warnings"
12+
cargo clippy --all-targets -- -D warnings
13+
14+
echo "==> cargo test --workspace"
15+
cargo test --workspace
16+
17+
echo "==> coverage (≥95%)"
18+
./scripts/coverage.sh
19+
20+
echo "PASS: local CI gate"

src/filters.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ use crate::repo::{self, Repo};
55
use anyhow::Result;
66
use rayon::prelude::*;
77

8-
pub fn apply_status_filters(
9-
repos: Vec<Repo>,
10-
cli: &Cli,
11-
jobs: Option<usize>,
12-
) -> Result<Vec<Repo>> {
8+
pub fn apply_status_filters(repos: Vec<Repo>, cli: &Cli, jobs: Option<usize>) -> Result<Vec<Repo>> {
139
let jobs = jobs.unwrap_or_else(num_cpus::get).max(1);
1410
let pool = rayon::ThreadPoolBuilder::new().num_threads(jobs).build()?;
1511
let filtered: Vec<Repo> = pool.install(|| {

src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,7 @@ fn command_needs_selection(command: &Option<Commands>) -> bool {
125125
}
126126
}
127127

128-
fn run_without_selection(
129-
cli: &Cli,
130-
cfg: &config::Config,
131-
out: &mut OutputCtx,
132-
) -> Result<()> {
128+
fn run_without_selection(cli: &Cli, cfg: &config::Config, out: &mut OutputCtx) -> Result<()> {
133129
match &cli.command {
134130
Some(Commands::Update) => commands::update::run(cli, cfg, out),
135131
Some(Commands::Config { action }) => commands::config_cmd::run(action, cli, cfg, out),

0 commit comments

Comments
 (0)