diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index a22a2dc..a3ac618 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,4 +1,10 @@ -on: [push, pull_request] +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] name: R-CMD-check @@ -12,55 +18,32 @@ jobs: fail-fast: false matrix: config: - - { os: windows-latest, r: 'release'} - - { os: windows-latest, r: 'devel'} - - { os: macOS-latest, r: 'release'} - - { os: macOS-latest, r: 'devel'} - - { os: ubuntu-16.04, r: '3.5', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} - - { os: ubuntu-16.04, r: 'release', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - CRAN: ${{ matrix.config.cran }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true - - uses: r-lib/actions/setup-pandoc@master - - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('DESCRIPTION') }} - - - name: Install system dependencies - if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc - run: | - Rscript -e "install.packages('remotes')" -e "remotes::install_github('r-hub/sysreqs')" - sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") - sudo -s eval "$sysreqs" - - name: Install dependencies - run: Rscript -e "install.packages('remotes')" -e "remotes::install_deps(dependencies = TRUE)" -e "remotes::install_cran('rcmdcheck')" + extra-packages: any::rcmdcheck + needs: check - - name: Check - run: Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'warning', check_dir = 'check')" - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@master + - uses: r-lib/actions/check-r-package@v2 with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check - - - name: Test coverage - if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'release' - run: | - Rscript -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")' + upload-snapshots: true diff --git a/DESCRIPTION b/DESCRIPTION index bc0249f..dcc6dc5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: errorist Title: Automatically Search Errors or Warnings -Version: 0.1.0 +Version: 0.1.1 Authors@R: c( person("James", "Balamuta", email = "balamut2@illinois.edu", @@ -20,7 +20,6 @@ Suggests: testthat, rmarkdown License: GPL (>= 2) Encoding: UTF-8 -LazyData: true -RoxygenNote: 7.0.2 +RoxygenNote: 7.2.3 Roxygen: list(markdown = TRUE) VignetteBuilder: knitr diff --git a/NEWS.md b/NEWS.md index 1cec2d9..98850ba 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,22 @@ +# errorist 0.1.1 + +## Fixes + +- Switched insertion shiv `message()` to `packageStartupMessage()`. + ([#12](https://github.com/r-assist/errorist/pull/12)) + +- Removed `LazyData: true` from `DESCRIPTION`. + ([#12](https://github.com/r-assist/errorist/pull/12)) + + +- Switched URLs to using `https` instead of `http` and removed broken links. + ([#12](https://github.com/r-assist/errorist/pull/12)) + +## Deployment + +- Updated to the latest version of `r-lib` GitHub actions. + ([#12](https://github.com/r-assist/errorist/pull/12)) + # errorist 0.1.0 ## Feature @@ -58,7 +77,7 @@ the following folks: on [XKCD Comic 1185: Ineffective Sorts](https://xkcd.com/1185/). - [Barry Rowlingson](http://barry.rowlingson.com) for the package name and remarks about functionality. -- [Brodie Gaslam](http://www.brodieg.com/) for pointing out +- [Brodie Gaslam](https://www.brodieg.com/) for pointing out [`addTaskCallback()`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/taskCallback.html) as a way to create a warning handler and for a brief discussion on "call" objects. diff --git a/R/handlers.R b/R/handlers.R index 87fc3be..5c24779 100644 --- a/R/handlers.R +++ b/R/handlers.R @@ -45,7 +45,7 @@ #' @rdname errorist_init enable_errorist = function(error_search_func = getOption("errorist.warning", searcher::search_google), warning_search_func = getOption("errorist.warning", searcher::search_google)) { - message("Warnings and errors will automatically trigger a web search.") + packageStartupMessage("Warnings and errors will automatically trigger a web search.") enable_error_shim(error_search_func) enable_warning_shim(warning_search_func) } @@ -53,7 +53,7 @@ enable_errorist = function(error_search_func = getOption("errorist.warning", sea #' @export #' @rdname errorist_init disable_errorist = function() { - message("Warnings and errors are no longer automatically searched.") + packageStartupMessage("Warnings and errors are no longer automatically searched.") disable_error_shim() disable_warning_shim() } @@ -144,7 +144,7 @@ warning_handler = function(search_func = #' @param error_search_func,warning_search_func #' The search function from [`searcher`] that should be called when #' an error or warning occurs. By default, searches are routed through -#' [Google](https://google.com). +#' [Google](https://www.google.com/). #' #' @details #' By default, both [enable_warning_shim()] and [enable_error_shim()] functions diff --git a/README.Rmd b/README.Rmd index 2985604..141b047 100644 --- a/README.Rmd +++ b/README.Rmd @@ -15,10 +15,9 @@ knitr::opts_chunk$set( # errorist -[![R build status](https://github.com/r-assist/errorist/workflows/R-CMD-check/badge.svg)](https://github.com/r-assist/errorist/actions) -[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/errorist)](https://cran.r-project.org/package=errorist) -[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/errorist)](http://www.r-pkg.org/pkg/errorist) -[![Coverage Status](https://img.shields.io/codecov/c/github/r-assist/errorist/master.svg)](https://codecov.io/github/r-assist/errorist?branch=master) +[![R-CMD-check](https://github.com/r-assist/errorist/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-assist/errorist/actions/workflows/R-CMD-check.yaml) +[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/errorist)](https://cran.r-project.org/package=errorist) +[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/errorist)](https://www.r-pkg.org/pkg/errorist) > @@ -113,7 +112,7 @@ for errors that occurred at runtime. on [XKCD Comic 1185: Ineffective Sorts](https://xkcd.com/1185/). - [Barry Rowlingson](http://barry.rowlingson.com) for the package name and remarks about functionality. -- [Brodie Gaslam](http://www.brodieg.com/) for pointing out +- [Brodie Gaslam](https://www.brodieg.com/) for pointing out [`addTaskCallback()`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/taskCallback.html) as a way to create a warning handler and for a brief discussion on "call" objects. diff --git a/README.md b/README.md index 8e99df2..e6c3135 100644 --- a/README.md +++ b/README.md @@ -5,17 +5,14 @@ -[![R build -status](https://github.com/r-assist/errorist/workflows/R-CMD-check/badge.svg)](https://github.com/r-assist/errorist/actions) -[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/errorist)](https://cran.r-project.org/package=errorist) +[![R-CMD-check](https://github.com/r-assist/errorist/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-assist/errorist/actions/workflows/R-CMD-check.yaml) +[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/errorist)](https://cran.r-project.org/package=errorist) [![CRAN RStudio mirror -downloads](http://cranlogs.r-pkg.org/badges/errorist)](http://www.r-pkg.org/pkg/errorist) -[![Coverage -Status](https://img.shields.io/codecov/c/github/r-assist/errorist/master.svg)](https://codecov.io/github/r-assist/errorist?branch=master) +downloads](https://cranlogs.r-pkg.org/badges/errorist)](https://www.r-pkg.org/pkg/errorist) > *errorist*: one who holds to and propagates error -> +> > — [Merriam > Webster](https://www.merriam-webster.com/dictionary/errorist) @@ -61,12 +58,12 @@ messages is Google. You can specify a different search engine handler by setting default values: - - `errorist.warning`: Warning search engine portal. The default is - `searcher::search_google`. - - `errorist.error`: Error search engine portal. The default is - `searcher::search_google`. - - `errorist.autoload`: Automatically search errors. The default is - `TRUE`. +- `errorist.warning`: Warning search engine portal. The default is + `searcher::search_google`. +- `errorist.error`: Error search engine portal. The default is + `searcher::search_google`. +- `errorist.autoload`: Automatically search errors. The default is + `TRUE`. If frequent use of the package occurs, consider adding the different search handlers as an option in your `.Rprofile`: @@ -107,19 +104,19 @@ support for errors that occurred at runtime. # Special Thanks - - [Dirk Eddelbuettel](http://dirk.eddelbuettel.com) for starting the - discussion on [XKCD Comic 1185: Ineffective - Sorts](https://xkcd.com/1185/). - - [Barry Rowlingson](http://barry.rowlingson.com) for the package name - and remarks about functionality. - - [Brodie Gaslam](http://www.brodieg.com/) for pointing out - [`addTaskCallback()`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/taskCallback.html) - as a way to create a warning handler and for a brief discussion on - “call” objects. - - [Joshua Ulrich](https://github.com/joshuaulrich/) for advise on - incorporating the semi-documented - [`last.warning`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/warning.html) - object that *R* populates with warning messages. +- [Dirk Eddelbuettel](http://dirk.eddelbuettel.com) for starting the + discussion on [XKCD Comic 1185: Ineffective + Sorts](https://xkcd.com/1185/). +- [Barry Rowlingson](http://barry.rowlingson.com) for the package name + and remarks about functionality. +- [Brodie Gaslam](https://www.brodieg.com/) for pointing out + [`addTaskCallback()`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/taskCallback.html) + as a way to create a warning handler and for a brief discussion on + “call” objects. +- [Joshua Ulrich](https://github.com/joshuaulrich/) for advise on + incorporating the semi-documented + [`last.warning`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/warning.html) + object that *R* populates with warning messages. # License diff --git a/man/errorist-package.Rd b/man/errorist-package.Rd index d7dd7cb..fb4f9f0 100644 --- a/man/errorist-package.Rd +++ b/man/errorist-package.Rd @@ -6,8 +6,7 @@ \alias{errorist-package} \title{errorist: Automatically Search Errors or Warnings} \description{ -Provides environment hooks that obtain errors and warnings which - occur during the execution of code to automatically search for solutions. +Provides environment hooks that obtain errors and warnings which occur during the execution of code to automatically search for solutions. } \seealso{ Useful links: diff --git a/man/errorist_init.Rd b/man/errorist_init.Rd index 0ff9504..19a2212 100644 --- a/man/errorist_init.Rd +++ b/man/errorist_init.Rd @@ -13,13 +13,9 @@ enable_errorist( disable_errorist() } \arguments{ -\item{error_search_func}{The search function from \code{\link{searcher}} that should be called when +\item{error_search_func, warning_search_func}{The search function from \code{\link{searcher}} that should be called when an error or warning occurs. By default, searches are routed through -\href{https://google.com}{Google}.} - -\item{warning_search_func}{The search function from \code{\link{searcher}} that should be called when -an error or warning occurs. By default, searches are routed through -\href{https://google.com}{Google}.} +\href{https://www.google.com/}{Google}.} } \description{ Activates or disengages the automatic look up of error or warning codes in diff --git a/man/shims.Rd b/man/shims.Rd index 503f0ac..cca4b75 100644 --- a/man/shims.Rd +++ b/man/shims.Rd @@ -22,7 +22,7 @@ disable_error_shim() \arguments{ \item{error_search_func, warning_search_func}{The search function from \code{\link{searcher}} that should be called when an error or warning occurs. By default, searches are routed through -\href{https://google.com}{Google}.} +\href{https://www.google.com/}{Google}.} } \description{ Add or remove a listener to top-level task callbacks that checks for @@ -43,7 +43,7 @@ a function for \code{error} in \code{options()}. For the warning shim, a top-level task callback added to the environment -via \code{\link[base:addTaskCallback]{base::addTaskCallback()}}. This causes the warning handler to fire +via \code{\link[base:taskCallback]{base::addTaskCallback()}}. This causes the warning handler to fire each time a new function call occurs in \emph{R} regardless of whether it triggers an error. } @@ -84,7 +84,7 @@ enable_error_shim(error_search_func = searcher::search_google) disable_error_shim() } \seealso{ -\code{\link[base:addTaskCallback]{base::addTaskCallback()}} +\code{\link[base:taskCallback]{base::addTaskCallback()}} } \author{ James Joseph Balamuta diff --git a/vignettes/working-with-errorist.Rmd b/vignettes/working-with-errorist.Rmd index 69f47fb..49fd37a 100644 --- a/vignettes/working-with-errorist.Rmd +++ b/vignettes/working-with-errorist.Rmd @@ -24,7 +24,7 @@ of being as invisible as possible. To achieve the invisibility, on package load, handlers to receive error and warning message are automatically created and applied. These handlers propogate the messages raised by _R_ into the [`searcher`](https://CRAN.R-project.org/package=searcher) package, which -automatically searches the contents on [Google](https://google.com/) by default. +automatically searches the contents on [Google](https://www.google.com/) by default. ## Usage