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

Fix r-devel warning leakage #14

Merged
merged 9 commits into from
Nov 14, 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
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
^README\.Rmd$
^CRAN-RELEASE$
^\.github$
^.*\.code-workspace$
^_pkgdown\.yml$
^docs$
^pkgdown$
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
.DS_Store
inst/doc
CRAN-RELEASE
docs
6 changes: 3 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.1
Version: 0.1.2
Authors@R: c(
person("James", "Balamuta",
email = "[email protected]",
Expand All @@ -10,8 +10,8 @@ Authors@R: c(
)
Description: Provides environment hooks that obtain errors and warnings which
occur during the execution of code to automatically search for solutions.
URL: https://github.com/r-assist/errorist
BugReports: https://github.com/r-assist/errorist/issues
URL: https://github.com/coatless-rpkg/errorist, https://r-pkg.thecoatlessprofessor.com/errorist/
BugReports: https://github.com/coatless-rpkg/errorist/issues
Depends: R (>= 3.0.0)
Imports: searcher (>= 0.0.2)
Suggests: testthat,
Expand Down
32 changes: 23 additions & 9 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,59 @@
# errorist 0.1.2

## Fixes

- Revised the warning check as empty warnings no longer have a `NULL` return.
([#13](https://github.com/coatless-rpkg/errorist/issues/13))

## Deployment

- Added pkgdown website
([#14](https://github.com/coatless-rpkg/errorist/pull/14))
- Updated to the latest version of `r-lib` GitHub actions.
([#14](https://github.com/coatless-rpkg/errorist/pull/14))

# errorist 0.1.1

## Fixes

- Switched insertion shiv `message()` to `packageStartupMessage()`.
([#12](https://github.com/r-assist/errorist/pull/12))
([#12](https://github.com/coatless-rpkg/errorist/pull/12))

- Removed `LazyData: true` from `DESCRIPTION`.
([#12](https://github.com/r-assist/errorist/pull/12))
([#12](https://github.com/coatless-rpkg/errorist/pull/12))


- Switched URLs to using `https` instead of `http` and removed broken links.
([#12](https://github.com/r-assist/errorist/pull/12))
([#12](https://github.com/coatless-rpkg/errorist/pull/12))

## Deployment

- Updated to the latest version of `r-lib` GitHub actions.
([#12](https://github.com/r-assist/errorist/pull/12))
([#12](https://github.com/coatless-rpkg/errorist/pull/12))

# errorist 0.1.0

## Feature

- When multiple warnings occur, each unique warning is searched separately
instead of searching only the latest value. ([#9](https://github.com/r-assist/errorist/pull/9),
closing ([#7](https://github.com/r-assist/errorist/issues/7)))
instead of searching only the latest value. ([#9](https://github.com/coatless-rpkg/errorist/pull/9),
closing ([#7](https://github.com/coatless-rpkg/errorist/issues/7)))

## Fixes

- Warning messages now have their locale specific prefix.
([#9](https://github.com/r-assist/errorist/pull/9))
([#9](https://github.com/coatless-rpkg/errorist/pull/9))

- Ensured the `last.warning` object was created by setting `options('warn' = 0)`,
which is the default value. Upon unload, the warning level is restored to
the old value. ([#8](https://github.com/r-assist/errorist/pull/8))
the old value. ([#8](https://github.com/coatless-rpkg/errorist/pull/8))

- Fixed a spurious URL in README/NEWS.md

## Documentation

- Improved the package vignette by providing examples of how the handler pick
up errors and warnings. ([#10](https://github.com/r-assist/errorist/pull/10))
up errors and warnings. ([#10](https://github.com/coatless-rpkg/errorist/pull/10))


# errorist 0.0.3
Expand Down
13 changes: 9 additions & 4 deletions R/handlers.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@
#' disable_errorist()
#' @export
#' @rdname errorist_init
enable_errorist = function(error_search_func = getOption("errorist.warning", searcher::search_google),
warning_search_func = getOption("errorist.warning", searcher::search_google)) {
packageStartupMessage("Warnings and errors will automatically trigger a web search.")
enable_errorist = function(
error_search_func = getOption("errorist.warning", searcher::search_google),
warning_search_func = getOption("errorist.warning", searcher::search_google))
{
packageStartupMessage(
"Warnings and errors will automatically trigger a web search."
)

enable_error_shim(error_search_func)
enable_warning_shim(warning_search_func)
}
Expand Down Expand Up @@ -113,7 +118,7 @@ warning_handler = function(search_func =
# Determines if a warning was triggered
last_warning_value = warnings()

if (!is.null(last_warning_value)) {
if (!is.null(last_warning_value) && length(last_warning_value)) {
warning_contents = warning_msg_format(last_warning_value)
} else {
warning_contents = NA
Expand Down
4 changes: 4 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
url: http://r-pkg.thecoatlessprofessor.com/errorist/
template:
bootstrap: 5

8 changes: 8 additions & 0 deletions errorist.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}
5 changes: 3 additions & 2 deletions man/errorist-package.Rd

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