diff --git a/NAMESPACE b/NAMESPACE index a0c0ee4..087133e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) diff --git a/R/diagnostic_test.R b/R/diagnostic_test.R index e27f090..e46883e 100644 --- a/R/diagnostic_test.R +++ b/R/diagnostic_test.R @@ -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) } @@ -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. diff --git a/_pkgdown.yml b/_pkgdown.yml index 47e7eff..d1831d1 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -47,6 +47,7 @@ reference: contents: - diagnostic_test - check_proxy_settings + - check_github_pat - check_renv_download_method - title: Helpers diff --git a/man/check_github_pat.Rd b/man/check_github_pat.Rd new file mode 100644 index 0000000..6390f1b --- /dev/null +++ b/man/check_github_pat.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/diagnostic_test.R +\name{check_github_pat} +\alias{check_github_pat} +\title{Check GITHUB_PAT setting} +\usage{ +check_github_pat(clean = FALSE, verbose = FALSE) +} +\arguments{ +\item{clean}{Attempt to clean settings} + +\item{verbose}{Run in verbose mode} +} +\value{ +List object containing the github_pat keyword content. +} +\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 +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. +} +\examples{ +check_github_pat() +} diff --git a/man/check_proxy_settings.Rd b/man/check_proxy_settings.Rd index bcf49c2..cc15de0 100644 --- a/man/check_proxy_settings.Rd +++ b/man/check_proxy_settings.Rd @@ -29,7 +29,5 @@ and Azure DevOps if present, so this script identifies and (if clean=TRUE is set) removes them. } \examples{ -\dontrun{ check_proxy_settings() } -} diff --git a/tests/testthat/test-diagnostic_test.R b/tests/testthat/test-diagnostic_test.R index 2295d05..17ff89c 100644 --- a/tests/testthat/test-diagnostic_test.R +++ b/tests/testthat/test-diagnostic_test.R @@ -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( @@ -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) ) })