Documentation: comprehensive mdbook rewrite, rustdoc fixes, and test stability#33
Conversation
Rewrite all major mdbook chapters to accurately reflect the implemented API, CLI, and architecture. Fix rustdoc link warnings in parser/loader.rs. Updated chapters: - library-api.md: Full API reference (MagicDatabase, EvaluationConfig, EvaluationResult, error handling, MIME mapping) - cli-usage.md: Complete CLI reference (flags, output formats, exit codes, magic file discovery, stdin, timeout, strict mode) - configuration.md: EvaluationConfig presets, validation rules, usage - output.md: Text/JSON/JSON Lines output, tag enrichment, conversion - performance.md: Memory-mapped I/O, evaluation pipeline, benchmarking - introduction.md: Updated project status and feature list - getting-started.md: Updated quick start, project structure, Rust 1.91+ - migration.md: C-to-Rust API mapping table, updated examples Rustdoc fixes: - Fix 3 unresolved links in parser/loader.rs (use super:: prefix)
The test-only rand module used SystemTime nanoseconds for temp file names. Under parallel test execution (especially with cargo-llvm-cov), concurrent tests generated identical timestamps, causing filename collisions and test_file_buffer_binary_content failures. Replace with a monotonic AtomicU64 counter + process ID for guaranteed uniqueness. Remove the now-unused rand module.
|
Caution Review failedFailed to post review comments Summary by CodeRabbitRelease Notes
WalkthroughComprehensive documentation update covering Phase 1 MVP, including rewritten mdbook chapters (CLI usage, library API, configuration, output formatters, performance), updated introduction and migration guide, plus minor code changes to temp file naming and documentation references. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
Closes #23
src/parser/loader.rs(unresolvedparse_text_magic_filereferences)test_file_buffer_binary_contentcaused by temp file name collisions under parallel coverage execution (replaced timestamp-based rand with atomic counter)Test plan
cargo doc-- 0 warningscargo test --doc-- 118 passed, 0 failedcargo test-- 940+ tests passcargo clippy -- -D warnings-- cleanmdbook build docs/-- successfuljust ci-check-- fully green (including coverage)Generated with Claude Code