fix:re-export XpFile#103
Conversation
📝 WalkthroughWalkthroughThe PR integrates the ChangesRexPaint Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Suggested reviewers
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)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/lib.rs`:
- Line 13: Add a colocated tests module file (e.g., src/tests.rs) that verifies
the new public re-exports compile by importing crate::prelude::{XpCell, XpFile,
XpLayer} and crate::rexpaint::XpColor and adding two minimal tests: one that
calls core::mem::size_of::<XpCell|XpLayer|XpFile>() to ensure those types
resolve, and another that references XpColor::BLACK to ensure the rexpaint
module exposes its prelude; place these tests alongside the module so CI will
compile-time verify the new exports.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 433901f8-f2f3-4a25-8dce-1c0ce8ce54cf
📒 Files selected for processing (2)
Cargo.tomlsrc/lib.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Format all Rust code usingcargo fmt --all
Fix allcargo clippywarnings — the CI enforces-D warnings
Add tests for new functionality in the relevant module; for split domains, prefer colocatedtests.rs
Files:
src/lib.rs
🔇 Additional comments (1)
Cargo.toml (1)
46-46: LGTM!
| pub use bracket_noise::prelude::*; | ||
| pub use bracket_pathfinding::prelude::*; | ||
| pub use bracket_random::prelude::*; | ||
| pub use bracket_rex::prelude::{XpCell, XpFile, XpLayer}; |
There was a problem hiding this comment.
Add API-surface tests for the new rexpaint exports.
This introduces new public entry points (prelude::{XpCell, XpFile, XpLayer} and rexpaint::*) but no tests validate those exports compile and resolve correctly.
Proposed minimal test wiring
--- a/src/lib.rs
+++ b/src/lib.rs
@@
pub mod rexpaint {
pub use bracket_rex::prelude::*;
}
+
+#[cfg(test)]
+mod tests;// src/tests.rs
use crate::prelude::{XpCell, XpFile, XpLayer};
use crate::rexpaint::XpColor;
#[test]
fn prelude_reexports_rex_core_types() {
let _ = core::mem::size_of::<XpCell>();
let _ = core::mem::size_of::<XpLayer>();
let _ = core::mem::size_of::<XpFile>();
}
#[test]
fn rexpaint_module_exposes_full_prelude() {
let _ = XpColor::BLACK;
}As per coding guidelines, "Add tests for new functionality in the relevant module; for split domains, prefer colocated tests.rs."
Also applies to: 58-62
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/lib.rs` at line 13, Add a colocated tests module file (e.g.,
src/tests.rs) that verifies the new public re-exports compile by importing
crate::prelude::{XpCell, XpFile, XpLayer} and crate::rexpaint::XpColor and
adding two minimal tests: one that calls
core::mem::size_of::<XpCell|XpLayer|XpFile>() to ensure those types resolve, and
another that references XpColor::BLACK to ensure the rexpaint module exposes its
prelude; place these tests alongside the module so CI will compile-time verify
the new exports.
fb94a77 to
fe7bf77
Compare
What
Re-exports
XpFile,XpLayer, andXpCellfrom thebracket-libprelude and adds arexpaintmodule for fullbracket-rexaccess.Why
Common RexPaint workflows currently require importing these types from
bracket-rexdirectly. This change makes the commonly used types available through the mainbracket-libfacade while avoiding a broadbracket-rexprelude re-export, which could introduce conflicts such asXpColor.No related issue.
Checklist
Required
cargo check --allpassescargo fmt --all -- --checkpassescargo clippy --workspace --all-targets -- -D warnings -A clippy::multiple-crate-versionspassescargo test --allpassesCloses #123)Functional Validation
Configuration & Docs
README.md,ARCHITECTURE.md, or relevant manual pages, if applicable)If Applicable
cargo auditlocally if needed)Summary by CodeRabbit