Tweak the view function
olivroy opened this issue · comments
Hi, could the view function use rlang::is_interactive()
so it is easier to tweak and silence it with
options(rlang_interactive = FALSE)
https://rlang.r-lib.org/reference/is_interactive.html?q=interactive#null
I'd be happy to contribute a PR, just changing this line
Line 27 in 4de5c15
with
if (!rlang::is_interactive()) return(invisible(x))
Thanks
When writing code, I put calls to view in some places, but it would be handy to deactivate them when sourcing, instead of having to comment them out.
Edit: usethis asks that code doesn't contain interactive()
https://github.com/r-lib/usethis/blob/main/.github/workflows/lint-undesirable-functions.yaml#L64