Repository navigation
Usage for replacement S3 methods: generic without <-, value on the right - #43
Merged
Merged
Conversation
`$<-.myclass` was formatted as \method{$<-}{myclass}(x, name, value),
which R CMD check reports as a bad \usage line. The replacement test
looked for a trailing <- on the whole name, which a method's class
suffix hides; it looks at the generic now. Found in glinty.
TroyHernandez
added a commit
to cornball-ai/glinty
that referenced
this pull request
Oct 6, 2026
…usage (#97) * R CMD check clean: ASCII-only code, build-ignore sandbox and PROTOCOL.md, replacement-method usage - The two non-ASCII literals (the feed's jump arrow, the markdown bullet) are spelled with intToUtf8(); R CMD check wants portable packages ASCII-only outside comments. - sandbox/ and PROTOCOL.md are build-ignored: both stay in the repo, neither belongs in the tarball (hidden-file and top-level NOTEs). - The usage lines of $<-.glinty_output and [[<-.glinty_output come out as \method{$}{glinty_output}(x, name) <- value, regenerated with tinyrox 0.4.1.3 (cornball-ai/tinyrox#43), which fixes the formatting of replacement S3 methods at the root. The explicit @Usage lines in R/output.R document the intent; tinyrox skips the tag. - CI sets _R_CHECK_CRAN_INCOMING_=false, as veleta does: glinty is not on CRAN, so the "New submission" NOTE is structural. * Drop the @Usage tags tinyrox does not read tinyrox 0.4.1.3 formats the replacement methods correctly from their formals; the tag only drew an unknown-tag warning on every document().
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.
format_usage()tested for a replacement function withgrepl("<-$", name). A replacement S3 method's name is$<-.myclass: the<-sits on the generic and the class follows, so the test never fired and the usage came out aswhich
R CMD checkreports under "checking Rd \usage sections ... WARNING" as a bad\usageline. Whendetect_s3_method()finds a method, the replacement test now looks at the generic, and the result is what R expects:Tests for
$<-,[[<-,dim<-methods and a package-defined replacement generic. Found through glinty's two output-registration methods, whose pages had carried the bad lines since they were first generated.