diff --git a/NEWS.md b/NEWS.md index 7cf02dd..3e1494f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,7 +16,7 @@ - Added an S3 generic function `record_print()`, which is similar to `knitr::knit_print()` but for the purpose of printing visible values in `record()`. -- The `record()` funciton gained new arguments `print` and `print.args` to support custom printing functions and arguments. +- The `record()` function gained new arguments `print` and `print.args` to support custom printing functions and arguments. - Added a function `md_table()`, which is a minimal Markdown table generator. diff --git a/R/app.R b/R/app.R index e95db46..ad6ba70 100644 --- a/R/app.R +++ b/R/app.R @@ -64,7 +64,7 @@ new_app = function(name, handler, open = interactive(), ports = 4321 + 1:10) { #' # with query parameters #' xfun::rest_api('https://httpbin.org', '/response-headers', params = list(foo = 'bar')) #' -#' # get the rate limit info from Github +#' # get the rate limit info from GitHub #' xfun::github_api('/rate_limit') rest_api = function(...) { res = rest_api_raw(...) diff --git a/R/cran.R b/R/cran.R index cc5fbdc..822e598 100644 --- a/R/cran.R +++ b/R/cran.R @@ -29,7 +29,7 @@ cran_updatable = function(days = 90, maintainer = 'Yihui Xie') { sum(d > Sys.Date() - 180) < 6 && d[1] < Sys.Date() - days })) if (length(pkgs <- names(which(flag))) == 0) return(pkgs) - # look into DESCRIPTION in Github repos and see if new version has been pushed + # look into DESCRIPTION in GitHub repos and see if new version has been pushed info = tools::CRAN_package_db() info = info[info$Package %in% pkgs, , drop = FALSE] pkgs = info$Package diff --git a/R/github.R b/R/github.R index 63ae712..2fd123a 100644 --- a/R/github.R +++ b/R/github.R @@ -1,6 +1,6 @@ -#' Get the tags of Github releases of a repository +#' Get the tags of GitHub releases of a repository #' -#' Use the Github API ([github_api()]) to obtain the tags of the +#' Use the GitHub API ([github_api()]) to obtain the tags of the #' releases. #' @param repo The repository name of the form `user/repo`, e.g., #' `"yihui/xfun"`. @@ -60,7 +60,7 @@ github_releases2 = function(repo, tag = '', pattern = '[^"&]+') { } #' @details `github_api()` is a wrapper function based on -#' `rest_api_raw()` to obtain data from the Github API: +#' `rest_api_raw()` to obtain data from the GitHub API: #' . You can provide a personal access #' token (PAT) via the `token` argument, or via one of the environment #' variables \var{GITHUB_PAT}, \var{GITHUB_TOKEN}, \var{GH_TOKEN}. A PAT @@ -78,7 +78,7 @@ github_api = function( names(token) = 'token' error = TRUE on.exit(if (error && token == '') message( - 'You may need to save a Github personal access token in one of the ', + 'You may need to save a GitHub personal access token in one of the ', 'environment variables: ', paste(envs, collapse = ', ') )) res = rest_api_raw('https://api.github.com', endpoint, token, params, headers) @@ -109,7 +109,7 @@ git_test_branch = function() { } gh = function(...) { - if (Sys.which('gh') == '') stop('Github CLI not found: https://cli.github.com') + if (Sys.which('gh') == '') stop('GitHub CLI not found: https://cli.github.com') system2('gh', ...) } diff --git a/R/revcheck.R b/R/revcheck.R index 0d5ee49..f2ab736 100644 --- a/R/revcheck.R +++ b/R/revcheck.R @@ -387,21 +387,21 @@ check_deps = function(x, db = available.packages(), which = 'all') { #' dependencies is large, they will be split into batches and pushed to crandalf #' one by one. #' -#' Due to the time limit of a single job on Github Actions (6 hours), you will +#' Due to the time limit of a single job on GitHub Actions (6 hours), you will #' have to split the large number of reverse dependencies into batches and check -#' them sequentially on Github (at most 5 jobs in parallel). The function +#' them sequentially on GitHub (at most 5 jobs in parallel). The function #' `crandalf_check()` does this automatically when necessary. It requires #' the \command{git} command to be available. #' -#' The function `crandalf_results()` fetches check results from Github +#' The function `crandalf_results()` fetches check results from GitHub #' after all checks are completed, merge the results, and show a full summary of -#' check results. It requires `gh` (Github CLI: +#' check results. It requires `gh` (GitHub CLI: #' ) to be installed and you also need to -#' authenticate with your Github account beforehand. +#' authenticate with your GitHub account beforehand. #' @param pkg The package name of which the reverse dependencies are to be #' checked. #' @param size The number of reverse dependencies to be checked in each job. -#' @param jobs The number of jobs to run in Github Actions (by default, all jobs +#' @param jobs The number of jobs to run in GitHub Actions (by default, all jobs #' are submitted, but you can choose to submit the first few jobs). #' @param which The type of dependencies (see [rev_check()]). #' @export @@ -421,7 +421,7 @@ crandalf_check = function(pkg, size = 400, jobs = Inf, which = 'all') { git('push') message( 'Please create a pull request from the branch ', b, - ' on Github and re-run xfun::crandalf_check("', pkg, '").' + ' on GitHub and re-run xfun::crandalf_check("', pkg, '").' ) return(invisible()) } @@ -435,9 +435,9 @@ crandalf_check = function(pkg, size = 400, jobs = Inf, which = 'all') { git('push') } else if (Sys.which('gh') != '') { gh(c('workflow', 'run', 'rev-check.yaml', '--ref', b)) - message('Triggering rev-check.yaml job against ', b, ' branch in crandalf repo on Github.') + message('Triggering rev-check.yaml job against ', b, ' branch in crandalf repo on GitHub.') } else { - message('Remember to re-run the last job for the package ', pkg, ' on Github.') + message('Remember to re-run the last job for the package ', pkg, ' on GitHub.') } return(invisible()) } @@ -460,15 +460,15 @@ crandalf_check = function(pkg, size = 400, jobs = Inf, which = 'all') { } } -#' @param repo The crandalf repo on Github (of the form `user/repo` such as +#' @param repo The crandalf repo on GitHub (of the form `user/repo` such as #' `"yihui/crandalf"`). Usually you do not need to specify it, unless you #' are not calling this function inside the crandalf project, because #' \command{gh} should be able to figure out the repo automatically. #' @param limit The maximum of records for \command{gh run list} to retrieve. #' You only need a larger number if the check results are very early in the -#' Github Action history. +#' GitHub Action history. #' @param wait Number of seconds to wait if not all jobs have been completed on -#' Github. By default, this function checks the status every 5 minutes until +#' GitHub. By default, this function checks the status every 5 minutes until #' all jobs are completed. Set `wait` to 0 to disable waiting (and throw #' an error immediately when any jobs are not completed). #' @rdname crandalf_check @@ -476,10 +476,10 @@ crandalf_check = function(pkg, size = 400, jobs = Inf, which = 'all') { crandalf_results = function(pkg, repo = NA, limit = 200, wait = 5 * 60) { res = crandalf_jobs(pkg, repo, limit) if (NROW(res) == 0) { - stop('Did not find check results for ', pkg, ' from Github Actions.') + stop('Did not find check results for ', pkg, ' from GitHub Actions.') } if (any(res[, 1] != 'completed')) { - if (wait <= 0) stop('Please wait till all jobs have been completed on Github Actions.') + if (wait <= 0) stop('Please wait till all jobs have been completed on GitHub Actions.') status = NULL repeat { res = crandalf_jobs(pkg, repo, limit) @@ -499,7 +499,7 @@ crandalf_results = function(pkg, repo = NA, limit = 200, wait = 5 * 60) { res = res[i, , drop = FALSE] res = res[res[, 2] == 'failure', , drop = FALSE] if (NROW(res) == 0) { - stop('Did not find any failed results on Github Actions.') + stop('Did not find any failed results on GitHub Actions.') } for (i in seq_len(nrow(res))) { message('Downloading check results (', i, '/', nrow(res), ')') diff --git a/R/utils.R b/R/utils.R index 07f52ea..194c53a 100644 --- a/R/utils.R +++ b/R/utils.R @@ -217,7 +217,7 @@ try_error = function(expr) { #' @param .pause The number of seconds to wait before the next attempt. #' @export #' @examplesIf interactive() -#' # read the Github releases info of the repo yihui/xfun +#' # read the GitHub releases info of the repo yihui/xfun #' xfun::retry(xfun::github_releases, 'yihui/xfun') retry = function(fun, ..., .times = 3, .pause = 5) { for (i in seq_len(.times)) { diff --git a/man/crandalf_check.Rd b/man/crandalf_check.Rd index 675a24d..be27472 100644 --- a/man/crandalf_check.Rd +++ b/man/crandalf_check.Rd @@ -15,22 +15,22 @@ checked.} \item{size}{The number of reverse dependencies to be checked in each job.} -\item{jobs}{The number of jobs to run in Github Actions (by default, all jobs +\item{jobs}{The number of jobs to run in GitHub Actions (by default, all jobs are submitted, but you can choose to submit the first few jobs).} \item{which}{The type of dependencies (see \code{\link[=rev_check]{rev_check()}}).} -\item{repo}{The crandalf repo on Github (of the form \code{user/repo} such as +\item{repo}{The crandalf repo on GitHub (of the form \code{user/repo} such as \code{"yihui/crandalf"}). Usually you do not need to specify it, unless you are not calling this function inside the crandalf project, because \command{gh} should be able to figure out the repo automatically.} \item{limit}{The maximum of records for \command{gh run list} to retrieve. You only need a larger number if the check results are very early in the -Github Action history.} +GitHub Action history.} \item{wait}{Number of seconds to wait if not all jobs have been completed on -Github. By default, this function checks the status every 5 minutes until +GitHub. By default, this function checks the status every 5 minutes until all jobs are completed. Set \code{wait} to 0 to disable waiting (and throw an error immediately when any jobs are not completed).} } @@ -41,15 +41,15 @@ dependencies is large, they will be split into batches and pushed to crandalf one by one. } \details{ -Due to the time limit of a single job on Github Actions (6 hours), you will +Due to the time limit of a single job on GitHub Actions (6 hours), you will have to split the large number of reverse dependencies into batches and check -them sequentially on Github (at most 5 jobs in parallel). The function +them sequentially on GitHub (at most 5 jobs in parallel). The function \code{crandalf_check()} does this automatically when necessary. It requires the \command{git} command to be available. -The function \code{crandalf_results()} fetches check results from Github +The function \code{crandalf_results()} fetches check results from GitHub after all checks are completed, merge the results, and show a full summary of -check results. It requires \code{gh} (Github CLI: +check results. It requires \code{gh} (GitHub CLI: \url{https://cli.github.com/manual/}) to be installed and you also need to -authenticate with your Github account beforehand. +authenticate with your GitHub account beforehand. } diff --git a/man/github_releases.Rd b/man/github_releases.Rd index c7b3d42..034d5d9 100644 --- a/man/github_releases.Rd +++ b/man/github_releases.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/github.R \name{github_releases} \alias{github_releases} -\title{Get the tags of Github releases of a repository} +\title{Get the tags of GitHub releases of a repository} \usage{ github_releases( repo, @@ -27,7 +27,7 @@ returned.} A character vector of (GIT) tags. } \description{ -Use the Github API (\code{\link[=github_api]{github_api()}}) to obtain the tags of the +Use the GitHub API (\code{\link[=github_api]{github_api()}}) to obtain the tags of the releases. } \examples{\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} diff --git a/man/rest_api.Rd b/man/rest_api.Rd index 05afc3b..0ada58b 100644 --- a/man/rest_api.Rd +++ b/man/rest_api.Rd @@ -58,7 +58,7 @@ method. If you need to use other HTTP methods (such as \samp{POST}), you have to use other packages such as \pkg{curl} and \pkg{httr}. \code{github_api()} is a wrapper function based on -\code{rest_api_raw()} to obtain data from the Github API: +\code{rest_api_raw()} to obtain data from the GitHub API: \url{https://docs.github.com/en/rest}. You can provide a personal access token (PAT) via the \code{token} argument, or via one of the environment variables \var{GITHUB_PAT}, \var{GITHUB_TOKEN}, \var{GH_TOKEN}. A PAT @@ -76,7 +76,7 @@ xfun::rest_api("https://httpbin.org", "/headers", "OPEN SESAME!") # with query parameters xfun::rest_api("https://httpbin.org", "/response-headers", params = list(foo = "bar")) -# get the rate limit info from Github +# get the rate limit info from GitHub xfun::github_api("/rate_limit") \dontshow{\}) # examplesIf} } diff --git a/man/retry.Rd b/man/retry.Rd index f439bfd..5d8a6ca 100644 --- a/man/retry.Rd +++ b/man/retry.Rd @@ -24,7 +24,7 @@ One application of this function is to download a web resource. Since the download might fail sometimes, you may want to retry it for a few more times. } \examples{\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} -# read the Github releases info of the repo yihui/xfun +# read the GitHub releases info of the repo yihui/xfun xfun::retry(xfun::github_releases, "yihui/xfun") \dontshow{\}) # examplesIf} } diff --git a/tests/test-ci.R b/tests/test-ci.R index ef9d619..d140782 100644 --- a/tests/test-ci.R +++ b/tests/test-ci.R @@ -1,2 +1,2 @@ -# tests to run on CI servers (e.g. Github Actions) +# tests to run on CI servers (e.g. GitHub Actions) if (tolower(Sys.getenv('CI')) == 'true') testit::test_pkg('xfun', 'test-ci') diff --git a/vignettes/xfun.Rmd b/vignettes/xfun.Rmd index 7580b89..360ac6b 100644 --- a/vignettes/xfun.Rmd +++ b/vignettes/xfun.Rmd @@ -24,7 +24,7 @@ library(xfun) After writing about 20 R packages, I found I had accumulated several utility functions that I used across different packages, so I decided to extract them into a separate package. Previously I had been using the evil triple-colon `:::` to access these internal utility functions. Now with **xfun**, these functions have been exported, and more importantly, documented. It should be better to use them under the sun instead of in the dark. -This page shows examples of a subset of functions in this package. For a full list of functions, see the help page `help(package = 'xfun')`. The source package is available on Github: https://github.com/yihui/xfun. +This page shows examples of a subset of functions in this package. For a full list of functions, see the help page `help(package = 'xfun')`. The source package is available on GitHub: https://github.com/yihui/xfun. ## No more partial matching for lists!