Skip to content

Commit c8b80e2

Browse files
committed
add 'quiet' par to dashboard fn
1 parent a99bfc0 commit c8b80e2

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: dashboard
22
Title: What the Package Does (One Line, Title Case)
3-
Version: 0.0.1.004
3+
Version: 0.0.1.005
44
Authors@R:
55
person(given = "First",
66
family = "Last",

R/dashboard-fn.R

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#' Apply the query above to extract data from GitHub GraphQL API, and
22
#' post-process into a `data.frame`.
33
#'
4+
#' @param quiet If `FALSE`, display progress information on screen.
45
#' @param open_only Include only open issues?
56
#' @return (Invisibly) A `data.frame` with one row per issue and some key
67
#' statistics.
78
#' @noRd
8-
dashboard_gh_data <- function (open_only = TRUE) {
9+
dashboard_gh_data <- function (open_only = TRUE, quiet = FALSE) {
910

1011
has_next_page <- TRUE
1112
end_cursor <- NULL
@@ -106,10 +107,12 @@ dashboard_gh_data <- function (open_only = TRUE) {
106107
)
107108

108109
page_count <- page_count + 1L
109-
message (
110-
"Retrieved page [", page_count, "] to issue number [",
111-
max (number), "]"
112-
)
110+
if (!quiet) {
111+
message (
112+
"Retrieved page [", page_count, "] to issue number [",
113+
max (number), "]"
114+
)
115+
}
113116
}
114117

115118
# Reduce "event" data down to current labels only, and sort by labels so
@@ -211,15 +214,16 @@ dashboard_gh_data <- function (open_only = TRUE) {
211214
#' open issues.
212215
#' @param browse If `TRUE` (default), open the results as a \pkg{DT} `datatable`
213216
#' HTML page in default browser.
217+
#' @param quiet If `FALSE`, display progress information on screen.
214218
#' @return A `data.frame` with one row per issue and some key statistics.
215219
#' @export
216220

217-
dashboard <- function (open_only = TRUE, browse = TRUE) {
221+
dashboard <- function (open_only = TRUE, browse = TRUE, quiet = FALSE) {
218222

219223
# Suppress no visible binding notes:
220224
editor <- editor_date <- NULL
221225

222-
dat <- dashboard_gh_data (open_only)
226+
dat <- dashboard_gh_data (open_only, quiet = quiet)
223227

224228
cmt_data <- extract_comment_info (dat)
225229
dat$comments <- NULL
@@ -228,7 +232,7 @@ dashboard <- function (open_only = TRUE, browse = TRUE) {
228232
dplyr::relocate (editor, .after = labels) |>
229233
dplyr::relocate (editor_date, .after = editor)
230234

231-
if (any (dat$has_multiple_stages)) {
235+
if (any (dat$has_multiple_stages) && !quiet) {
232236
numbers <- dat$number [which (dat$has_multiple_stages)]
233237
txt <- ifelse (
234238
length (numbers) == 1,

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"name": "dashboard: What the Package Does (One Line, Title Case)",
77
"codeRepository": "https://github.com/ropensci-review-tools/dashboard",
88
"license": "https://spdx.org/licenses/MIT",
9-
"version": "0.0.1.004",
9+
"version": "0.0.1.005",
1010
"programmingLanguage": {
1111
"@type": "ComputerLanguage",
1212
"name": "R",

man/dashboard.Rd

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)