Skip to content

Fix @returns alias (#24) and unquoted-name false positive (#23)#25

Merged
TroyHernandez merged 6 commits into
mainfrom
grant-issues-23-24
Jun 24, 2026
Merged

Fix @returns alias (#24) and unquoted-name false positive (#23)#25
TroyHernandez merged 6 commits into
mainfrom
grant-issues-23-24

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

Two issues reported by @grantmcdermott while running tinyrox on tinyplot.

#24@returns rejected as unknown tag

roxygen2 supports @returns as an alias of @return; tinyrox only allowlisted @return, so a single @returns aborted document(). Added @returns to the tag allowlist and routed it to the same Rd slot.

#23 — dependency package name flagged in Description prose

check_description_cran() cross-referenced the package's own dependency names against the Title/Description prose, so "base R graphics system" got flagged because graphics is an import (and fix = TRUE rewrote it to 'graphics'). CRAN only wants quoting when you refer to a package/software by name, not for ordinary words.

The check is now tiered by confidence:

  • Curated software names (OpenAI, TensorFlow, ...) — unambiguous proper nouns, so a directive warning and auto-quoting by fix = TRUE / fix_description_cran().
  • Dependency names — ambiguous in prose, so an advisory warning only, and never rewritten by the auto-fix paths.

So graphics is flagged with a soft "ordinary-word uses are fine" note and left untouched, while OpenAI still gets the hard nudge.

Version bumped to 0.3.3.6, tinytests added for both, R CMD check --as-cran clean (0/0/0).

Closes #23
Closes #24

Curated software names (OpenAI, TensorFlow) are unambiguous: directive warning plus auto-quoting by fix=TRUE and fix_description_cran(). Dependency names from Imports/Depends are ambiguous in prose (e.g. base R graphics system), so they get an advisory warning only and are never rewritten. Fixes a false positive that warned about and auto-quoted the ordinary word graphics.
@TroyHernandez

Copy link
Copy Markdown
Contributor Author

Thanks @grantmcdermott, both fixed here (v0.3.3.6).

@returns is now a first-class alias of @return, so it won't abort document() anymore (#24).

The graphics one was a genuine false positive (#23). The check was matching your own dependency names against the Description prose, so "base R graphics system" tripped on the graphics import, and fix = TRUE would even rewrite it to 'graphics'. CRAN only wants quoting when you're naming the software, not for ordinary words, so dependency names now get a soft advisory and the auto-fix leaves them alone. Curated names like OpenAI still get the firm nudge since there's no ordinary-word use of those.

Appreciate you putting tinyrox through its paces on tinyplot.

@TroyHernandez

Copy link
Copy Markdown
Contributor Author

Quick follow-up, @grantmcdermott: digging into your two reports made me question two of tinyrox's own defaults, and I'm planning to fold the answers into this PR rather than spin up separate ones.

  1. Unknown tags currently hard-error and abort the whole document() run, which is why a single @returns blocked you entirely. I'm leaning toward warn-and-skip instead (roxygen2's behavior), so one unlisted tag can't take down the build.

  2. The Description unquoted-name check that flagged graphics has no roxygen2 or R CMD check equivalent and leans on a hardcoded "known software" list. I'm reconsidering whether a minimal doc generator should be in that business at all.

Both would land as amendments to this PR, not blockers. Since you started me down this path, curious whether you'd call the strict-allowlist hard error a feature or a footgun.

@grantmcdermott

Copy link
Copy Markdown

Thanks Troy. Both sound like good ideas to me. Quick responses/thoughts:

  1. Yes, a warning seems a better default than erroring out.
  2. Same. The current approach is probably fragile (as we've seen) and I'm not sure that it buys you all that much that in the first place.;R CMD check will already error if your DESCRIPTION is misconfigured.

An unknown or misspelled tag previously aborted document() for the whole package (this is how a single @returns blocked tinyplot). It now warns, names the tag, drops its content, and keeps parsing every other tag. The allowlist still governs what produces Rd output.
A documentation generator should not lint DESCRIPTION prose. Drops the unquoted-name check (check_description_cran/fix_description_cran) and the web-service-link check, along with their hardcoded KNOWN_SOFTWARE_NAMES / WEBSERVICE_PACKAGES lists, which had no roxygen2 or R CMD check equivalent and produced the graphics false positive. The token-based code checker (#21) and the example checks stay; check_cran() now runs just those two.
@TroyHernandez TroyHernandez merged commit c8b8c39 into main Jun 24, 2026
4 of 6 checks passed
@TroyHernandez TroyHernandez deleted the grant-issues-23-24 branch June 24, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add @returns (plural) to tags allowlist Unexpected DESCRIPTION error: names need to be single quoted?

2 participants