Skip to content

Commit c23d421

Browse files
committed
fix formatting
1 parent 69186d5 commit c23d421

File tree

2 files changed

+45
-9
lines changed

2 files changed

+45
-9
lines changed

.github/copilot-instructions.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ Tests validate discovered environments using 4 verification methods:
127127
3. `crates/pet-core/src/lib.rs` - Essential traits and types
128128
4. `crates/pet/tests/ci_test.rs` - Comprehensive testing patterns
129129

130-
131130
## Scripts
131+
132132
- Use `cargo fetch` to download all dependencies
133133
- Use `rustup component add clippy` to install Clippy linter
134134
- Use `cargo fmt --all` to format code in all packages
@@ -137,3 +137,17 @@ Tests validate discovered environments using 4 verification methods:
137137
- Use `cargo test [TESTNAME]` to test a specific test
138138
- Use `cargo test -p [SPEC]` to test a specific package
139139
- Use `cargo test --all` to test all packages
140+
141+
## Required Before Committing
142+
143+
**ALWAYS run these commands before committing any Rust code changes:**
144+
145+
```bash
146+
# Format all code (required)
147+
cargo fmt --all
148+
149+
# Run clippy with warnings as errors (required)
150+
cargo clippy --all -- -D warnings
151+
```
152+
153+
If clippy reports warnings, fix them before committing. Do not use `#[allow(...)]` attributes to suppress warnings unless absolutely necessary and justified.

crates/pet/tests/e2e_performance.rs

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,10 @@ fn test_server_startup_performance() {
518518
let cache_dir = get_test_cache_dir();
519519
let workspace_dir = get_workspace_dir();
520520

521-
println!("=== Server Startup Performance ({} iterations) ===", STAT_ITERATIONS);
521+
println!(
522+
"=== Server Startup Performance ({} iterations) ===",
523+
STAT_ITERATIONS
524+
);
522525

523526
for i in 0..STAT_ITERATIONS {
524527
let start = Instant::now();
@@ -586,7 +589,10 @@ fn test_full_refresh_performance() {
586589
let cache_dir = get_test_cache_dir();
587590
let workspace_dir = get_workspace_dir();
588591

589-
println!("=== Full Refresh Performance ({} iterations) ===", STAT_ITERATIONS);
592+
println!(
593+
"=== Full Refresh Performance ({} iterations) ===",
594+
STAT_ITERATIONS
595+
);
590596

591597
for i in 0..STAT_ITERATIONS {
592598
// Fresh server each iteration for consistent cold-start measurement
@@ -671,7 +677,10 @@ fn test_workspace_scoped_refresh_performance() {
671677
let cache_dir = get_test_cache_dir();
672678
let workspace_dir = get_workspace_dir();
673679

674-
println!("=== Workspace-Scoped Refresh Performance ({} iterations) ===", STAT_ITERATIONS);
680+
println!(
681+
"=== Workspace-Scoped Refresh Performance ({} iterations) ===",
682+
STAT_ITERATIONS
683+
);
675684

676685
for i in 0..STAT_ITERATIONS {
677686
let mut client = PetClient::spawn().expect("Failed to spawn server");
@@ -727,7 +736,10 @@ fn test_kind_specific_refresh_performance() {
727736
// Test different environment kinds
728737
let kinds = ["Conda", "Venv", "VirtualEnv", "Pyenv"];
729738

730-
println!("=== Kind-Specific Refresh Performance ({} iterations per kind) ===", STAT_ITERATIONS);
739+
println!(
740+
"=== Kind-Specific Refresh Performance ({} iterations per kind) ===",
741+
STAT_ITERATIONS
742+
);
731743

732744
let mut all_kind_stats: HashMap<String, Value> = HashMap::new();
733745

@@ -789,7 +801,10 @@ fn test_resolve_performance() {
789801
let cache_dir = get_test_cache_dir();
790802
let workspace_dir = get_workspace_dir();
791803

792-
println!("=== Resolve Performance ({} iterations) ===", STAT_ITERATIONS);
804+
println!(
805+
"=== Resolve Performance ({} iterations) ===",
806+
STAT_ITERATIONS
807+
);
793808

794809
// First, find an executable to test with (use a single server)
795810
let exe_to_test: String;
@@ -829,7 +844,9 @@ fn test_resolve_performance() {
829844
});
830845
client.configure(config).expect("Failed to configure");
831846

832-
let (_, cold_time) = client.resolve(&exe_to_test).expect("Failed to resolve (cold)");
847+
let (_, cold_time) = client
848+
.resolve(&exe_to_test)
849+
.expect("Failed to resolve (cold)");
833850
cold_resolve_stats.add(cold_time.as_millis());
834851
println!(" Iteration {}: {}ms", i + 1, cold_time.as_millis());
835852
}
@@ -848,7 +865,9 @@ fn test_resolve_performance() {
848865
client.resolve(&exe_to_test).expect("Failed to prime cache");
849866

850867
for i in 0..STAT_ITERATIONS {
851-
let (_, warm_time) = client.resolve(&exe_to_test).expect("Failed to resolve (warm)");
868+
let (_, warm_time) = client
869+
.resolve(&exe_to_test)
870+
.expect("Failed to resolve (warm)");
852871
warm_resolve_stats.add(warm_time.as_millis());
853872
println!(" Iteration {}: {}ms", i + 1, warm_time.as_millis());
854873
}
@@ -861,7 +880,10 @@ fn test_resolve_performance() {
861880
// Calculate speedup
862881
if let (Some(cold_p50), Some(warm_p50)) = (cold_resolve_stats.p50(), warm_resolve_stats.p50()) {
863882
if warm_p50 > 0 {
864-
println!("Cache speedup (P50): {:.2}x", cold_p50 as f64 / warm_p50 as f64);
883+
println!(
884+
"Cache speedup (P50): {:.2}x",
885+
cold_p50 as f64 / warm_p50 as f64
886+
);
865887
}
866888
}
867889

0 commit comments

Comments
 (0)