Skip to content

Commit

Permalink
expose 'roxygenise' param in report fn; closes #39
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Mar 27, 2024
1 parent 3dd673a commit 1185536
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: srr
Title: 'rOpenSci' Review Roclets
Version: 0.1.2.006
Version: 0.1.2.007
Authors@R:
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265"))
Expand Down
26 changes: 17 additions & 9 deletions R/report.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
#' @param branch By default a report will be generated from the current branch
#' as set on the local git repository; this parameter can be used to specify any
#' alternative branch.
#' @param roxygenise If `TRUE` (default), documentation will first be updated
#' with the \pkg{roxygen2} package. This requires local installation of the
#' package, which may take some time if the package has not previously been
#' installed. If this parameter is `FALSE`, the `roxygen2` package is not used,
#' documentation is not updated, and reports are generally generated faster.
#' @return (invisibly) Markdown-formatted lines used to generate the final html
#' document.
#' @family report
Expand All @@ -16,16 +21,19 @@
#' path <- srr_stats_pkg_skeleton ()
#' srr_report (path)
#' }
srr_report <- function (path = ".", branch = "", view = TRUE) {

o <- utils::capture.output (
chk <- tryCatch (
roxygen2::roxygenise (path),
error = function (e) e
srr_report <- function (path = ".", branch = "",
view = TRUE, roxygenise = TRUE) {

if (roxygenise) {
o <- utils::capture.output (
chk <- tryCatch (
roxygen2::roxygenise (path),
error = function (e) e
)
)
)
if (methods::is (chk, "simpleError")) {
stop (chk$message)
if (methods::is (chk, "simpleError")) {
stop (chk$message)
}
}

requireNamespace ("rmarkdown")
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/ropensci-review-tools/srr",
"issueTracker": "https://github.com/ropensci-review-tools/srr/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "0.1.2.006",
"version": "0.1.2.007",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
8 changes: 7 additions & 1 deletion man/srr_report.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1185536

Please sign in to comment.