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

Address CRAN check issues from Ripley #12

Merged
merged 11 commits into from
Mar 5, 2023
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
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
67 changes: 25 additions & 42 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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
21 changes: 20 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions R/handlers.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
#' @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)
}

#' @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()
}
Expand Down Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ knitr::opts_chunk$set(
# errorist

<!-- badges: start -->
[![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)
<!-- badges: end -->

>
Expand Down Expand Up @@ -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.
Expand Down
49 changes: 23 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@

<!-- badges: start -->

[![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)
<!-- badges: end -->

> *errorist*: one who holds to and propagates error
>
>
> — [Merriam
> Webster](https://www.merriam-webster.com/dictionary/errorist)

Expand Down Expand Up @@ -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`:
Expand Down Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions man/errorist-package.Rd

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

8 changes: 2 additions & 6 deletions man/errorist_init.Rd

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

6 changes: 3 additions & 3 deletions man/shims.Rd

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

2 changes: 1 addition & 1 deletion vignettes/working-with-errorist.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down