Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typos, including Github->GitHub #86

Merged
merged 2 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion R/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(...)
Expand Down
2 changes: 1 addition & 1 deletion R/cran.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions R/github.R
Original file line number Diff line number Diff line change
@@ -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"`.
Expand Down Expand Up @@ -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:
#' <https://docs.github.com/en/rest>. 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
Expand All @@ -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)
Expand Down Expand Up @@ -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', ...)
}

Expand Down
30 changes: 15 additions & 15 deletions R/revcheck.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:
#' <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.
#' @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
Expand All @@ -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())
}
Expand All @@ -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())
}
Expand All @@ -460,26 +460,26 @@ 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
#' @export
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)
Expand All @@ -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), ')')
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
18 changes: 9 additions & 9 deletions man/crandalf_check.Rd

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

4 changes: 2 additions & 2 deletions man/github_releases.Rd

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

4 changes: 2 additions & 2 deletions man/rest_api.Rd

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

2 changes: 1 addition & 1 deletion man/retry.Rd

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

2 changes: 1 addition & 1 deletion tests/test-ci.R
Original file line number Diff line number Diff line change
@@ -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')
2 changes: 1 addition & 1 deletion vignettes/xfun.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down