fix(macros): strip @return/@examples/@export from impl-block docs (#65)#195
Open
fix(macros): strip @return/@examples/@export from impl-block docs (#65)#195
Conversation
…return/@examples/@export (#65) `strip_param_tags` only removed `@param` from impl-block roxygen. Other method-specific tags were left in place and leaked into the class-level Rd file: - `@return` / `@returns` — impl blocks have no return value - `@examples` — belong on the demonstrated method - `@export` — redundant; ClassDocBuilder handles class export These now trigger the same deprecation warning as `@param` did. Tag-name matching is now exact (first whitespace-delimited token after `@`), so `@exportClass`, `@exportMethod`, and `@exportPattern` — which ARE valid on S4 class-level docs — stay put. Renamed the function and updated all three call sites in `miniextendr_impl.rs`, `miniextendr_impl_trait.rs`, and `miniextendr_impl_trait/vtable.rs`. Added three unit tests in `roxygen/tests.rs` covering the strip list, export-variant preservation, and prose pass-through. Also carries the devtools-document / vendor regeneration. Some rustfmt drift from the last `just fmt` run is included; the `#[allow(clippy::boxed_local)]` on `match_arg_multi_mode_boxed` matches #194 to keep clippy_default green. Closes #65. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
18a03fa to
dd98ab4
Compare
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.
Closes #65.
Summary
Rename `strip_param_tags` to `strip_method_tags` and extend the filter to the full method-only set: `@param`, `@return`, `@returns`, `@examples`, `@export`. Tag-name matching is now exact (first whitespace-delimited token after `@`) so S4 `@exportClass` / `@exportMethod` / `@exportPattern` still pass through.
Each stripped tag emits the same deprecated-const compile warning pattern `@param` already did, so users get a diagnostic at build time pointing them at the offending impl block.
Test plan
Notes
No change to generated R wrappers for existing rpkg fixtures — no impl block uses the newly-stripped tags today. The wrapper / NAMESPACE / Rd diff in this PR is pre-existing drift (line numbers and one missing `match_arg_return_modes` entry) that `just devtools-document` catches up automatically.
`#[allow(clippy::boxed_local)]` on `match_arg_multi_mode_boxed` and the rustfmt drift in a few rpkg files are the same as #194 — those merge-conflict-free if #194 lands first (identical content).
Generated with Claude Code