Skip to content

Commit

Permalink
Cleaning up and updating pkgdown with check github_pat
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbielby committed Nov 12, 2024
1 parent 03f0437 commit 0d1e2f2
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 7 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(check_github_pat)
export(check_proxy_settings)
export(check_renv_download_method)
export(comma_sep)
Expand Down
6 changes: 3 additions & 3 deletions R/diagnostic_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ check_proxy_settings <- function(
} else {
message("PASS: No proxy settings found in your Git configuration.")
proxy_config <- as.list(rep("", length(proxy_setting_names))) |>
setNames(proxy_setting_names)
stats::setNames(proxy_setting_names)
}
return(proxy_config)
}
Expand All @@ -79,8 +79,8 @@ check_proxy_settings <- function(
#'
#' @description
#' If the GITHUB_PAT keyword is set, then it can cause issues with R installing
#' packages from GitHub (usually with an error of "ERROR [curl: (22) The
#' requested URL returned error: 401]"). This script checks whether the keyword
#' packages from GitHub (usually with an error of "ERROR \[curl: (22) The
#' requested URL returned error: 401\]"). This script checks whether the keyword
#' is set and can then clear it (if clear=TRUE).
#' The user will then need to identify where the "GITHUB_PAT" variable is being
#' set from and remove it to permanently fix the issue.
Expand Down
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ reference:
contents:
- diagnostic_test
- check_proxy_settings
- check_github_pat
- check_renv_download_method

- title: Helpers
Expand Down
27 changes: 27 additions & 0 deletions man/check_github_pat.Rd

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

2 changes: 0 additions & 2 deletions man/check_proxy_settings.Rd

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

4 changes: 2 additions & 2 deletions tests/testthat/test-diagnostic_test.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
test_that("Check proxy settings identifies and removes proxy setting", {
# Set a dummy config parameter for the purposes of testing
git2r::config(http.proxy.test = "this-is-a-test-entry", global = TRUE)
proxy_setting_names = c("http.proxy.test", "https.proxy.test")
proxy_setting_names <- c("http.proxy.test", "https.proxy.test")
# Check that check_proxy_settings identifies the rogue entry
expect_equal(
check_proxy_settings(
Expand All @@ -27,7 +27,7 @@ test_that("Check proxy settings identifies and removes proxy setting", {
) |>
suppressMessages(),
proxy_config <- as.list(rep("", length(proxy_setting_names))) |>
setNames(proxy_setting_names)
stats::setNames(proxy_setting_names)
)
})

Expand Down

0 comments on commit 0d1e2f2

Please sign in to comment.