docs(batch): drop restatement comments in tests and sources#4599
Merged
Conversation
Strip pure restatement and decorative section labels from the `batch` crate tests and a handful of source files (`reader/delta.rs`, `script.rs`). All upstream rsync citations (`batch.c`, `io.c`, `uidlist.c`, `flist.c`, `token.c`, `compat.c`, `main.c`, `receiver.c`), batch shell-script generation WHYs, and load-bearing notes (`do_compression` flag semantics, NDX state preservation, CPRES_ZLIB dictionary sync invariants, INC_RECURSE segment layout) are preserved verbatim. No semantic changes; no new allows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Per-crate comment cleanup pass on the
batchcrate, following the precedent set by PRs #4587 (matching), #4591 (protocol), #4590 (transfer), #4589 (fast_io), #4584 (filters), #4582 (logging), #4583 (platform), #4575 (compress).The crate already enforces
#![deny(missing_docs)]at the root, so every public item already carries///. This follow-up strips pure restatement and decorative section labels from the test bodies and a handful of source files, while preserving every upstream rsync citation, batch-shell-script generation WHY note, and load-bearing protocol invariant.Scope
Walked
crates/batch/src/end to end. Files touched: 7.src/tests.rs- integration tests: drop// Write a batch file,// Read the batch file back,// Verify file entries round-trip correctly,// EOF,// Should fail on corrupt data,// File 1 entry/// File 2 entry, per-section// Directory entry/// File entry/// End of flistlabels,// File checksum (16 zero bytes)decorators, and// Replay the ... batchmarkers above the obvious replay call.src/reader/tests.rs- drop// Try to read more data than available,// Write phase/// Read phasedecorative dividers,// Don't read header, and a cluster of// Initial segment,// Read the sub-list segment,// Now we have all 3 entries,// NDX codec is available for ...,// Sub-list entries have parent directory prependedlabels in the INC_RECURSE test builder.src/format/tests.rs- drop value-restating comments aboveassert_eq!(&buf[N..M], ...)byte-layout checks; rewrite the multi-byte varint length breakdown as a single concise line.src/replay/tests.rs- drop// Basis has "ABCDE"and// sqrt(1_000_000) = 1000type restatements; convert the two CPRES_ZLIB / zstdcpres_zlib_*tests' explanatory bodies into///rustdoc on the test functions themselves (where they actually belong).src/reader/delta.rs- tighten thesimple_recv_tokenmatch-arm comments (block_index formula stays, redundant "Literal data: n bytes follow" trailing the same-line literal_len reads).src/script.rs- drop// Original filter args should be stripped,// The batch name should not appear as a passthrough argument, and the redundant// Read and verify script content -- upstream has no shebang(kept as the WHY noteupstream batch shell scripts have no shebang).src/writer.rs- drop// Verify file exists and has contentand// write_data before write_header must faildecorators above the correspondingassert!.What was kept
// upstream: batch.c:NNN,io.c:NNN,compat.c:NNN,flist.c:NNN,token.c:NNN,uidlist.c:NNN,main.c:NNN,receiver.c:NNN,rsync.c:NNNcitations.do_compressionflag semantics, batch body being a raw protocol-stream tee, NDX codec state preservation across flist sub-lists, INC_RECURSEndx_startsegment layout, CPRES_ZLIB dictionary sync viasee_token()after block matches, zstd codec auto-detection, MD4/MD5/XXH3 default 16-byte digest length rationale,iflags: ITEM_TRANSFER (0x8000)annotation above the raw u16 byte writes (the literal does not document itself)./// Verifies that ...) including the upstream-bug reproductions fortoken.c:608 inflate -3.Stats
///rustdoc on the test fn.#[allow(...)]attributes. No public-API rustdoc additions were needed (the crate enforcesmissing_docs).Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings