diff --git a/.Rbuildignore b/.Rbuildignore index 67dd501..fcf8827 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,3 +9,7 @@ ^README\.Rmd$ ^CRAN-RELEASE$ ^\.github$ +^.*\.code-workspace$ +^_pkgdown\.yml$ +^docs$ +^pkgdown$ diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..ed7650c --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -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/github-pages-deploy-action@v4.4.1 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.gitignore b/.gitignore index 89fbe6c..c78e5fe 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ .DS_Store inst/doc CRAN-RELEASE +docs diff --git a/DESCRIPTION b/DESCRIPTION index dcc6dc5..b6e926f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 = "balamut2@illinois.edu", @@ -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, diff --git a/NEWS.md b/NEWS.md index 98850ba..653b9f5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/R/handlers.R b/R/handlers.R index 5c24779..57a65e7 100644 --- a/R/handlers.R +++ b/R/handlers.R @@ -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) } @@ -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 diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..5f58625 --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,4 @@ +url: http://r-pkg.thecoatlessprofessor.com/errorist/ +template: + bootstrap: 5 + diff --git a/errorist.code-workspace b/errorist.code-workspace new file mode 100644 index 0000000..876a149 --- /dev/null +++ b/errorist.code-workspace @@ -0,0 +1,8 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": {} +} \ No newline at end of file diff --git a/man/errorist-package.Rd b/man/errorist-package.Rd index fb4f9f0..9aab1ee 100644 --- a/man/errorist-package.Rd +++ b/man/errorist-package.Rd @@ -11,8 +11,9 @@ Provides environment hooks that obtain errors and warnings which occur during th \seealso{ Useful links: \itemize{ - \item \url{https://github.com/r-assist/errorist} - \item Report bugs at \url{https://github.com/r-assist/errorist/issues} + \item \url{https://github.com/coatless-rpkg/errorist} + \item \url{https://r-pkg.thecoatlessprofessor.com/errorist/} + \item Report bugs at \url{https://github.com/coatless-rpkg/errorist/issues} } }