Conversation
|
@renkun-ken CRAN check doesn't like the use of attach, PTAL. |
ab22ea1 to
6a56d74
Compare
R/diagnostics.R
Outdated
| attach(globals, name = env_name, warn.conflicts = FALSE) | ||
| on.exit(detach(env_name, character.only = TRUE)) | ||
| parent.env(globals) <- environment() | ||
| lints <- with(globals, lintr::lint(path, cache = cache, text = content)) |
There was a problem hiding this comment.
What if globals contains symbols such as path, and cache, and content?
There was a problem hiding this comment.
I tried putting path <- NULL in a package R file, and the following occurs:
Failed to run diagnostics: ! error in callr subprocess
Caused by error in `if (needs_tempfile) { ...`:
! missing value where TRUE/FALSE needed
There was a problem hiding this comment.
Good catch. Let me fix it.
There was a problem hiding this comment.
Looks like the variables must be accessible from the global environment. Looks like globals must be attached and we'll have to walk-around the CRAN policy?
There was a problem hiding this comment.
Just like what callr has done using do.call("attach", ...) at
https://github.com/r-lib/callr/blob/5adbb27027c377b3ad0d4b3b471f81b36b02da67/R/hook.R#L7
There was a problem hiding this comment.
Thanks, submitting to CRAN.
|
It's on the way to CRAN. |
Will merge after CRAN accepts the submission.