From 553ab311548d83f3f41c1f2093145cc1065bcc0a Mon Sep 17 00:00:00 2001 From: mpadge Date: Thu, 7 Mar 2024 12:12:24 +0100 Subject: [PATCH] add 'quiet' param --- DESCRIPTION | 2 +- R/editors.R | 18 +++++++++++------- codemeta.json | 2 +- man/editor_status.Rd | 5 ++++- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9a93d77..68be065 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dashboard Title: What the Package Does (One Line, Title Case) -Version: 0.0.1.002 +Version: 0.0.1.003 Authors@R: person(given = "First", family = "Last", diff --git a/R/editors.R b/R/editors.R index bd76817..066d5e1 100644 --- a/R/editors.R +++ b/R/editors.R @@ -1,9 +1,10 @@ #' Get current status of all rOpenSci editors. #' +#' @param quiet If `FALSE`, display progress information on screen. #' @return (Invisibly) A `data.frame` with one row per editor and some key #' statistics. #' @noRd -editor_gh_data <- function () { +editor_gh_data <- function (quiet = FALSE) { q <- gh_editors_team_qry (stats = FALSE) editors <- gh::gh_gql (query = q) @@ -72,10 +73,12 @@ editor_gh_data <- function () { ) page_count <- page_count + 1L - message ( - "Retrieved page [", page_count, "] to issue number [", - max (number), "]" - ) + if (!quiet) { + message ( + "Retrieved page [", page_count, "] to issue number [", + max (number), "]" + ) + } } # Reduce only to issues assigned to "editors" team members: @@ -113,11 +116,12 @@ editor_gh_data <- function () { #' Generate a summary report of current state of all rOpenSci editors #' +#' @param quiet If `FALSE`, display progress information on screen. #' @return A `data.frame` with one row per issue and some key statistics. #' @export -editor_status <- function () { - dat <- editor_gh_data () +editor_status <- function (quiet = FALSE) { + dat <- editor_gh_data (quiet = quiet) dat$status <- "FREE" dat$status [dat$state == "OPEN"] <- "BUSY" diff --git a/codemeta.json b/codemeta.json index d940c6c..21d7131 100644 --- a/codemeta.json +++ b/codemeta.json @@ -6,7 +6,7 @@ "name": "dashboard: What the Package Does (One Line, Title Case)", "codeRepository": "https://github.com/ropensci-review-tools/dashboard", "license": "https://spdx.org/licenses/MIT", - "version": "0.0.1.002", + "version": "0.0.1.003", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", diff --git a/man/editor_status.Rd b/man/editor_status.Rd index 096dcde..3288c6b 100644 --- a/man/editor_status.Rd +++ b/man/editor_status.Rd @@ -4,7 +4,10 @@ \alias{editor_status} \title{Generate a summary report of current state of all rOpenSci editors} \usage{ -editor_status() +editor_status(quiet = FALSE) +} +\arguments{ +\item{quiet}{If `FALSE`, display progress information on screen.} } \value{ A `data.frame` with one row per issue and some key statistics.