refactor: add impl_documentation_noop! macro for empty DocumentationModule#1082
refactor: add impl_documentation_noop! macro for empty DocumentationModule#1082tmchow wants to merge 2 commits intoamber-lang:stagingfrom
Conversation
…odule Replace boilerplate empty DocumentationModule implementations across 72 modules with a macro call. Reduces repetitive code by ~290 lines while preserving behavior. Modules with real documentation content are unchanged. Fixes amber-lang#973
📝 WalkthroughWalkthroughAdded a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes This is a straightforward, homogeneous refactoring with 73 files following the identical pattern: removing 5 lines of boilerplate and adding 1 line of macro invocation. The macro definition is straightforward, and consistency can be verified efficiently through pattern recognition across all files. Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
|
cool because we discussed that for the next minor :-D |
|
Thanks for the approval. @Mte90 glad this aligns with what you had in mind for the next minor. |
|
There are some conflicts to fix before we can merge it |
Summary
I added
impl_documentation_noop!macro to replace boilerplate emptyDocumentationModuleimplementations across 72 modules.Net reduction of about 290 lines!Changes
src/docs/module.rs: Newimpl_documentation_noop!macro using$crate::paths for proper macro hygieneimpl DocumentationModule for X { fn document(...) { "".to_string() } }blocks withcrate::impl_documentation_noop!(X);use crate::docs::module::DocumentationModule;imports from files that no longer reference the trait directlyModules with real documentation content (
declaration.rs,stmt.rs,block.rs,comment.rs,comment_doc.rs) are untouched.Testing
cargo test: 652 passed, 0 failedcargo clippy: no warningscargo fmt --check: cleanFixes #973
This contribution was developed with AI assistance (Codex).
Summary by CodeRabbit
Refactor