docs(comments): rewrite comments across all crates to the guidelines
Sweep every first-party crate source (1956 .rs files) to the project comment guidelines: delete redundant restatements, decorative banners, change narration, and end-of-line comments; keep and tighten the crucial ones (invariants, bug rationale, SAFETY blocks, ported-source attribution). No functional code changed. Every edit is proven comment-only against the prior tree by a comment-stripping lexer (string/char/raw-string aware) plus a separate doctest-fence check. Where removing a comment made rustfmt or clippy want to re-lay-out adjacent code, the minimal triggering comment is restored so code tokens stay byte-identical. Gates green: cargo fmt --all --check (0 diffs), cargo check and cargo clippy --workspace --all-targets (0 warnings). Adds scripts/check_codegen_comment_guidelines.py — the enforcement gate for these guidelines (flags banners, end-of-line comments, change narration, and commented-out code).
This commit is contained in:
1 parent
ff0fb56c67
commit
a02b555e66
1458 files changed
+10729
-21750
No files matched your search
@@ -613,7 +613,8 @@ mod tests {
|
||||
})
|
||||
.collect();
|
||||
|
||||
// Gate-open point; then concurrent producer emits live updates.
|
||||
// Phase 2: a concurrent producer emits live updates while the
|
||||
// replay completions are still draining.
|
||||
let live_sender = sender.clone();
|
||||
let producer = tokio::task::spawn_local(async move {
|
||||
for i in 0..LIVE {
|
||||
@@ -624,15 +625,14 @@ mod tests {
|
||||
}
|
||||
});
|
||||
|
||||
// Drain replay completions while producer runs.
|
||||
for rx in completions {
|
||||
let _ = rx.await;
|
||||
}
|
||||
|
||||
// Mark response boundary.
|
||||
log.borrow_mut().push("RESPONSE".into());
|
||||
|
||||
// Let producer and gateway finish remaining live updates.
|
||||
// Give the producer and the gateway loop room to flush the
|
||||
// remaining live updates before inspecting the log.
|
||||
let _ = producer.await;
|
||||
for _ in 0..LIVE + 5 {
|
||||
tokio::task::yield_now().await;
|
||||
@@ -644,7 +644,6 @@ mod tests {
|
||||
.position(|s| s == "RESPONSE")
|
||||
.expect("RESPONSE marker must be in the log");
|
||||
|
||||
// (1) Delta notifications are all present and before RESPONSE.
|
||||
for i in 0..DELTA {
|
||||
let tag = format!("delta-{i}");
|
||||
let pos = log
|
||||
@@ -657,7 +656,6 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
// (2) Delta notifications preserve enqueue order.
|
||||
let delta_positions: Vec<usize> = (0..DELTA)
|
||||
.map(|i| log.iter().position(|s| s == &format!("delta-{i}")).unwrap())
|
||||
.collect();
|
||||
@@ -670,7 +668,6 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
// (3) No live updates are lost.
|
||||
for i in 0..LIVE {
|
||||
let tag = format!("live-{i}");
|
||||
assert!(
|
||||
@@ -679,7 +676,6 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
// (4) Live updates do not precede replay delta.
|
||||
let last_delta = *delta_positions.last().unwrap();
|
||||
for i in 0..LIVE {
|
||||
let tag = format!("live-{i}");
|
||||
|
||||
Reference in new issue
Block a user