From e19bc2ca47ed20f2add2686e14959d9a08abdf82 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Sat, 29 Jun 2024 14:55:45 +0200 Subject: [PATCH 1/8] Check examples with stricter settings --- .github/workflows/check-all-examples.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-all-examples.yaml b/.github/workflows/check-all-examples.yaml index 36415fc90..d1f1507f0 100644 --- a/.github/workflows/check-all-examples.yaml +++ b/.github/workflows/check-all-examples.yaml @@ -37,6 +37,12 @@ jobs: - name: Run examples run: | - options(crayon.enabled = TRUE) + options( + crayon.enabled = TRUE, + warn = 2L, + warnPartialMatchArgs = TRUE, + warnPartialMatchAttr = TRUE, + warnPartialMatchDollar = TRUE + ) devtools::run_examples(fresh = TRUE, run_dontrun = TRUE, run_donttest = TRUE) shell: Rscript {0} From 27a07d52ea23ec4b7698efd678c50aa1c9e36992 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Mon, 1 Jul 2024 16:03:34 +0200 Subject: [PATCH 2/8] Create check-test-warnings.yaml --- .github/workflows/check-test-warnings.yaml | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/check-test-warnings.yaml diff --git a/.github/workflows/check-test-warnings.yaml b/.github/workflows/check-test-warnings.yaml new file mode 100644 index 000000000..414385293 --- /dev/null +++ b/.github/workflows/check-test-warnings.yaml @@ -0,0 +1,39 @@ +# based on test-coverage, running testthat with options(warn = 2) to fail on test warnings +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: test-package + +jobs: + test-package: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: local::. + + - name: Run Tests + run: | + ## -------------------------------------------------------------------- + options( + crayon.enabled = TRUE, + warn = 2L, + warnPartialMatchArgs = TRUE, + warnPartialMatchAttr = TRUE, + warnPartialMatchDollar = TRUE + ) + if (Sys.getenv("_R_CHECK_FORCE_SUGGESTS_", "") == "") Sys.setenv("_R_CHECK_FORCE_SUGGESTS_" = "false") + testthat::test_dir("tests") + shell: Rscript {0} From 181cceaef2480a45152992b1f8022eab28e4c872 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Sat, 30 Nov 2024 20:33:47 +0100 Subject: [PATCH 3/8] Update WORDLIST --- inst/WORDLIST | 166 ++++++++++---------------------------------------- 1 file changed, 32 insertions(+), 134 deletions(-) diff --git a/inst/WORDLIST b/inst/WORDLIST index 3b67a1317..f70375732 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -1,217 +1,130 @@ +AST Addin -addin Addins -addins -api AppVeyor +CMD +DSLs +EOF +EOL +EOLs +EQ +Freepik +Gayathri +Github +Invasiveness +JamesIves +Jupyterlab +LF +Lifecycle +ORCID +README +RMarkdown +RStudio +Rmarkdown +Rmd +Rnw +Robinlovelace +Roxygen +Shallowify +StackOverflow +Tidyverse +Unindent +Visit'em +YAML +addin +addins arg -AST -aut -backport backports bdr benchmarking -bootswatch -BugReports -bXj cancelling -cff ci cli -CMD -codebase codegrip coercible coercions -compat config counterpair -coventions -cpp -cre -ctb -cyclocomp -cynkra dec dependabot -desc -devtools dir -docsearch dont dontrun dontshow donttest dplyr -DSLs emacs -EOF -EOL -EOLs -EQ examplesIf -expr -eZm fansi -Fi filetype -Fjmav flaticon forcond formatter -Freepik gadenbuie -Gayathri -getOption ggplot -Github github -gitsum -gmail grkstyle -GSOC helpfiles -href https -icloud ifelse -Indrajeet -indrajeetspatilmorality -initializer inode integrations internal's -Invasiveness invasiveness io ixmypi -JamesIves -JBP -Jupyterlab -kirill -Kirill knitr -krlmlr -labelled learnr -LF -Lifecycle lifecycle -linter -linters lintr -lorenz lorenzwalthert -macOS magrittr -mav md -MERCHANTABILITY mlr mlr's -mutli -Müller -navbar -nbv -netlify nocomments -NONINFRINGEMENT -nonportable -nzchar -ocx oneliner -ORCID -ourself -packrat pandoc -params parsable -parsesum -Patil -patilindrajeet patilindrajeets -pdy -PGW pkgapi pkgconfig pkgdown pos pre precommit -prefill prettycode priori -PRs -purrr -qez qmd -RcppExports -README readme rebased -reindent reindented reindention -relevel -renv repo reprex -revdepcheck rlang rlang's -RMarkdown -Rmarkdown rmarkdown -Rmd rmd -Rnw rnw roadmap -Robinlovelace -roclet -roclets ropensci -roxgen -Roxygen roxygen -RoxygenNote rplumber rprofile -rprojroot -RStudio -RStudio's -rstudioapi -saamwerk -Sd semicoloner -Shallowify sharding spaceout -StackOverflow -styler stylerignore stylerignored -stylers -Stylers -sublicense -summarises testthat -tg -th tibble tibbles -tidyr -Tidyverse tidyverse -todo travis -ubuntu -Uf -ui uncached unexplainable unicode -Unindent unindent unindention unlink @@ -219,24 +132,9 @@ unnest utf vctrs vec -Vh -VignetteBuilder -Visit'em -walthert -Walthert -winbuilder withr -WN -www xaringan xfun -Xie -xk -XN -YAML yaml yihui -yl -YPa -zm zzz From 7260ff90e62616459a081299f794f24e55bcc9db Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 30 Nov 2024 19:37:20 +0000 Subject: [PATCH 4/8] pre-commit --- inst/WORDLIST | 162 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 130 insertions(+), 32 deletions(-) diff --git a/inst/WORDLIST b/inst/WORDLIST index f70375732..a6c3937ce 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -1,130 +1,213 @@ -AST Addin -Addins -AppVeyor -CMD -DSLs -EOF -EOL -EOLs -EQ -Freepik -Gayathri -Github -Invasiveness -JamesIves -Jupyterlab -LF -Lifecycle -ORCID -README -RMarkdown -RStudio -Rmarkdown -Rmd -Rnw -Robinlovelace -Roxygen -Shallowify -StackOverflow -Tidyverse -Unindent -Visit'em -YAML addin +Addins addins +api +AppVeyor arg +AST +aut +backport backports bdr benchmarking +bootswatch +BugReports +bXj cancelling ci cli +CMD +codebase codegrip coercible coercions +compat config counterpair +coventions +cpp +cre +cyclocomp +cynkra dec dependabot +desc +devtools dir dont dontrun dontshow donttest dplyr +DSLs emacs +EOF +EOL +EOLs +EQ examplesIf +expr +eZm fansi +Fi filetype +Fjmav flaticon forcond formatter +Freepik gadenbuie +Gayathri +getOption ggplot +Github github +gitsum +gmail grkstyle +GSOC helpfiles +href https +icloud ifelse +Indrajeet +indrajeetspatilmorality +initializer inode integrations internal's +Invasiveness invasiveness io ixmypi +JamesIves +JBP +Jupyterlab +kirill +Kirill knitr +krlmlr +labelled learnr +LF +Lifecycle lifecycle +linter +linters lintr +lorenz lorenzwalthert magrittr +mav md +MERCHANTABILITY mlr mlr's +mutli +Müller +navbar +nbv +netlify nocomments +NONINFRINGEMENT +nonportable +nzchar +ocx oneliner +ORCID +ourself +packrat pandoc +params parsable +parsesum +Patil +patilindrajeet patilindrajeets +pdy +PGW pkgapi pkgconfig pkgdown pos pre precommit +prefill prettycode priori +PRs +purrr +qez qmd +RcppExports +README readme rebased +reindent reindented reindention +relevel +renv repo reprex +revdepcheck rlang rlang's +RMarkdown +Rmarkdown rmarkdown +Rmd rmd +Rnw rnw roadmap +Robinlovelace +roclet +roclets ropensci +roxgen +Roxygen roxygen +RoxygenNote rplumber rprofile +rprojroot +RStudio +RStudio's +rstudioapi +saamwerk +Sd semicoloner +Shallowify sharding spaceout +StackOverflow +styler stylerignore stylerignored +stylers +Stylers +sublicense +summarises testthat +tg +th tibble tibbles +tidyr +Tidyverse tidyverse +todo travis +ubuntu +Uf +ui uncached unexplainable unicode +Unindent unindent unindention unlink @@ -132,9 +215,24 @@ unnest utf vctrs vec +Vh +VignetteBuilder +Visit'em +walthert +Walthert +winbuilder withr +WN +www xaringan xfun +Xie +xk +XN +YAML yaml yihui +yl +YPa +zm zzz From 173d39722718c004017dde31194b1a5e47d6b99a Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Sat, 30 Nov 2024 20:42:54 +0100 Subject: [PATCH 5/8] consolidate into an existing check --- .github/workflows/check-all-examples.yaml | 48 ---------------------- .github/workflows/check-no-warnings.yaml | 48 ++++++++++++++++++++++ .github/workflows/check-test-warnings.yaml | 39 ------------------ 3 files changed, 48 insertions(+), 87 deletions(-) delete mode 100644 .github/workflows/check-all-examples.yaml create mode 100644 .github/workflows/check-no-warnings.yaml delete mode 100644 .github/workflows/check-test-warnings.yaml diff --git a/.github/workflows/check-all-examples.yaml b/.github/workflows/check-all-examples.yaml deleted file mode 100644 index d1f1507f0..000000000 --- a/.github/workflows/check-all-examples.yaml +++ /dev/null @@ -1,48 +0,0 @@ -# Make sure all examples run successfully, even the ones that are not supposed -# to be run or tested on CRAN machines by default. -# -# The examples that fail should use -# - `if (FALSE) { ... }` (if example is included only for illustrative purposes) -# - `try({ ... })` (if the intent is to show the error) -# -# This workflow helps find such failing examples that need to be modified. - -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - -name: check-all-examples - -jobs: - check-all-examples: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - pak-version: devel - extra-packages: | - any::devtools - local::. - - - name: Run examples - run: | - options( - crayon.enabled = TRUE, - warn = 2L, - warnPartialMatchArgs = TRUE, - warnPartialMatchAttr = TRUE, - warnPartialMatchDollar = TRUE - ) - devtools::run_examples(fresh = TRUE, run_dontrun = TRUE, run_donttest = TRUE) - shell: Rscript {0} diff --git a/.github/workflows/check-no-warnings.yaml b/.github/workflows/check-no-warnings.yaml new file mode 100644 index 000000000..4b792a68d --- /dev/null +++ b/.github/workflows/check-no-warnings.yaml @@ -0,0 +1,48 @@ +# execute all examples and tests with warnings turned into errors to look for new warnings +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: check-no-warnings + +jobs: + check-no-warnings: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + pak-version: devel + extra-packages: | + any::devtools + local::. + + - name: Run examples + run: | + options(crayon.enabled = TRUE, warn = 2L) + devtools::run_examples(fresh = TRUE, run_dontrun = TRUE, run_donttest = TRUE) + shell: Rscript {0} + + - name: Run Tests + run: | + options(crayon.enabled = TRUE) + pkgload::load_all() + # this workaround needed to play nicely with parallel testing + # see: https://github.com/r-lib/testthat/issues/1912 + test_script_paths <- testthat::find_test_scripts("tests/testthat") + test_with_warning_as_error <- function(path) { + withr::local_options(list(warn = 2L)) + testthat::test_file(path, stop_on_failure = TRUE, stop_on_warning = TRUE) + } + purrr::walk(test_script_paths, test_with_warning_as_error) + shell: Rscript {0} diff --git a/.github/workflows/check-test-warnings.yaml b/.github/workflows/check-test-warnings.yaml deleted file mode 100644 index 414385293..000000000 --- a/.github/workflows/check-test-warnings.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# based on test-coverage, running testthat with options(warn = 2) to fail on test warnings -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - -name: test-package - -jobs: - test-package: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: local::. - - - name: Run Tests - run: | - ## -------------------------------------------------------------------- - options( - crayon.enabled = TRUE, - warn = 2L, - warnPartialMatchArgs = TRUE, - warnPartialMatchAttr = TRUE, - warnPartialMatchDollar = TRUE - ) - if (Sys.getenv("_R_CHECK_FORCE_SUGGESTS_", "") == "") Sys.setenv("_R_CHECK_FORCE_SUGGESTS_" = "false") - testthat::test_dir("tests") - shell: Rscript {0} From 8fb3d272c32d7b0a444d2613526818750d425679 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Sat, 30 Nov 2024 20:45:48 +0100 Subject: [PATCH 6/8] check with devel spelling --- .pre-commit-config.yaml | 2 + inst/WORDLIST | 162 ++++++++-------------------------------- 2 files changed, 34 insertions(+), 130 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4f34c10b7..ab505369f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,6 +39,8 @@ repos: - rlang - id: use-tidy-description - id: spell-check + additional_dependencies: + - ropensci/spelling exclude: > (?x)^( \.github/.*\.yaml| diff --git a/inst/WORDLIST b/inst/WORDLIST index a6c3937ce..f70375732 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -1,213 +1,130 @@ +AST Addin -addin Addins -addins -api AppVeyor +CMD +DSLs +EOF +EOL +EOLs +EQ +Freepik +Gayathri +Github +Invasiveness +JamesIves +Jupyterlab +LF +Lifecycle +ORCID +README +RMarkdown +RStudio +Rmarkdown +Rmd +Rnw +Robinlovelace +Roxygen +Shallowify +StackOverflow +Tidyverse +Unindent +Visit'em +YAML +addin +addins arg -AST -aut -backport backports bdr benchmarking -bootswatch -BugReports -bXj cancelling ci cli -CMD -codebase codegrip coercible coercions -compat config counterpair -coventions -cpp -cre -cyclocomp -cynkra dec dependabot -desc -devtools dir dont dontrun dontshow donttest dplyr -DSLs emacs -EOF -EOL -EOLs -EQ examplesIf -expr -eZm fansi -Fi filetype -Fjmav flaticon forcond formatter -Freepik gadenbuie -Gayathri -getOption ggplot -Github github -gitsum -gmail grkstyle -GSOC helpfiles -href https -icloud ifelse -Indrajeet -indrajeetspatilmorality -initializer inode integrations internal's -Invasiveness invasiveness io ixmypi -JamesIves -JBP -Jupyterlab -kirill -Kirill knitr -krlmlr -labelled learnr -LF -Lifecycle lifecycle -linter -linters lintr -lorenz lorenzwalthert magrittr -mav md -MERCHANTABILITY mlr mlr's -mutli -Müller -navbar -nbv -netlify nocomments -NONINFRINGEMENT -nonportable -nzchar -ocx oneliner -ORCID -ourself -packrat pandoc -params parsable -parsesum -Patil -patilindrajeet patilindrajeets -pdy -PGW pkgapi pkgconfig pkgdown pos pre precommit -prefill prettycode priori -PRs -purrr -qez qmd -RcppExports -README readme rebased -reindent reindented reindention -relevel -renv repo reprex -revdepcheck rlang rlang's -RMarkdown -Rmarkdown rmarkdown -Rmd rmd -Rnw rnw roadmap -Robinlovelace -roclet -roclets ropensci -roxgen -Roxygen roxygen -RoxygenNote rplumber rprofile -rprojroot -RStudio -RStudio's -rstudioapi -saamwerk -Sd semicoloner -Shallowify sharding spaceout -StackOverflow -styler stylerignore stylerignored -stylers -Stylers -sublicense -summarises testthat -tg -th tibble tibbles -tidyr -Tidyverse tidyverse -todo travis -ubuntu -Uf -ui uncached unexplainable unicode -Unindent unindent unindention unlink @@ -215,24 +132,9 @@ unnest utf vctrs vec -Vh -VignetteBuilder -Visit'em -walthert -Walthert -winbuilder withr -WN -www xaringan xfun -Xie -xk -XN -YAML yaml yihui -yl -YPa -zm zzz From e89e65b2a4dc445f21e512c5ca32fa37cd9c109b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 30 Nov 2024 19:50:34 +0000 Subject: [PATCH 7/8] pre-commit --- inst/WORDLIST | 162 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 130 insertions(+), 32 deletions(-) diff --git a/inst/WORDLIST b/inst/WORDLIST index f70375732..a6c3937ce 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -1,130 +1,213 @@ -AST Addin -Addins -AppVeyor -CMD -DSLs -EOF -EOL -EOLs -EQ -Freepik -Gayathri -Github -Invasiveness -JamesIves -Jupyterlab -LF -Lifecycle -ORCID -README -RMarkdown -RStudio -Rmarkdown -Rmd -Rnw -Robinlovelace -Roxygen -Shallowify -StackOverflow -Tidyverse -Unindent -Visit'em -YAML addin +Addins addins +api +AppVeyor arg +AST +aut +backport backports bdr benchmarking +bootswatch +BugReports +bXj cancelling ci cli +CMD +codebase codegrip coercible coercions +compat config counterpair +coventions +cpp +cre +cyclocomp +cynkra dec dependabot +desc +devtools dir dont dontrun dontshow donttest dplyr +DSLs emacs +EOF +EOL +EOLs +EQ examplesIf +expr +eZm fansi +Fi filetype +Fjmav flaticon forcond formatter +Freepik gadenbuie +Gayathri +getOption ggplot +Github github +gitsum +gmail grkstyle +GSOC helpfiles +href https +icloud ifelse +Indrajeet +indrajeetspatilmorality +initializer inode integrations internal's +Invasiveness invasiveness io ixmypi +JamesIves +JBP +Jupyterlab +kirill +Kirill knitr +krlmlr +labelled learnr +LF +Lifecycle lifecycle +linter +linters lintr +lorenz lorenzwalthert magrittr +mav md +MERCHANTABILITY mlr mlr's +mutli +Müller +navbar +nbv +netlify nocomments +NONINFRINGEMENT +nonportable +nzchar +ocx oneliner +ORCID +ourself +packrat pandoc +params parsable +parsesum +Patil +patilindrajeet patilindrajeets +pdy +PGW pkgapi pkgconfig pkgdown pos pre precommit +prefill prettycode priori +PRs +purrr +qez qmd +RcppExports +README readme rebased +reindent reindented reindention +relevel +renv repo reprex +revdepcheck rlang rlang's +RMarkdown +Rmarkdown rmarkdown +Rmd rmd +Rnw rnw roadmap +Robinlovelace +roclet +roclets ropensci +roxgen +Roxygen roxygen +RoxygenNote rplumber rprofile +rprojroot +RStudio +RStudio's +rstudioapi +saamwerk +Sd semicoloner +Shallowify sharding spaceout +StackOverflow +styler stylerignore stylerignored +stylers +Stylers +sublicense +summarises testthat +tg +th tibble tibbles +tidyr +Tidyverse tidyverse +todo travis +ubuntu +Uf +ui uncached unexplainable unicode +Unindent unindent unindention unlink @@ -132,9 +215,24 @@ unnest utf vctrs vec +Vh +VignetteBuilder +Visit'em +walthert +Walthert +winbuilder withr +WN +www xaringan xfun +Xie +xk +XN +YAML yaml yihui +yl +YPa +zm zzz From 5aa06990060e059de75cfa5682ad7d850b36a270 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Sat, 30 Nov 2024 20:53:25 +0100 Subject: [PATCH 8/8] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ab505369f..4f34c10b7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,8 +39,6 @@ repos: - rlang - id: use-tidy-description - id: spell-check - additional_dependencies: - - ropensci/spelling exclude: > (?x)^( \.github/.*\.yaml|