From 082a8ba7d61d4051248098a2bebdd3fa8efc55e5 Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Sat, 13 Jul 2024 19:17:40 +0200 Subject: [PATCH 01/11] fix new pkgdown version --- tests/testthat/in/DESCRIPTION | 1 + tests/testthat/in/_pkgdown-articles.yml | 1 + tests/testthat/in/_pkgdown-index-articles.yml | 1 + tests/testthat/in/_pkgdown-index.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/tests/testthat/in/DESCRIPTION b/tests/testthat/in/DESCRIPTION index 8edf3858f..ae383353d 100644 --- a/tests/testthat/in/DESCRIPTION +++ b/tests/testthat/in/DESCRIPTION @@ -9,3 +9,4 @@ Imports: Remotes: ropenscilabs/tic Encoding: UTF-8 +URL: https://example.com diff --git a/tests/testthat/in/_pkgdown-articles.yml b/tests/testthat/in/_pkgdown-articles.yml index 324ba88cc..17d228612 100644 --- a/tests/testthat/in/_pkgdown-articles.yml +++ b/tests/testthat/in/_pkgdown-articles.yml @@ -4,3 +4,4 @@ articles: contents: - why-use-hooks - some-more +url: https://example.com diff --git a/tests/testthat/in/_pkgdown-index-articles.yml b/tests/testthat/in/_pkgdown-index-articles.yml index 59036a668..7a6ccddbb 100644 --- a/tests/testthat/in/_pkgdown-index-articles.yml +++ b/tests/testthat/in/_pkgdown-index-articles.yml @@ -10,3 +10,4 @@ articles: navbar: ~ contents: - pkgdown +url: https://example.com diff --git a/tests/testthat/in/_pkgdown-index.yml b/tests/testthat/in/_pkgdown-index.yml index c28bb158c..c2cf11fbd 100644 --- a/tests/testthat/in/_pkgdown-index.yml +++ b/tests/testthat/in/_pkgdown-index.yml @@ -4,3 +4,4 @@ reference: Edit the pre-commit configuration - contents: - autoupdate +url: https://example.com From d28564dc8eeb44dcda5296de2d91677475a5235e Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Sun, 14 Jul 2024 16:10:55 +0200 Subject: [PATCH 02/11] delete unused reference file --- tests/testthat/reference-objects/DESCRIPTION | 24 -------------------- 1 file changed, 24 deletions(-) delete mode 100644 tests/testthat/reference-objects/DESCRIPTION diff --git a/tests/testthat/reference-objects/DESCRIPTION b/tests/testthat/reference-objects/DESCRIPTION deleted file mode 100644 index b7d607d35..000000000 --- a/tests/testthat/reference-objects/DESCRIPTION +++ /dev/null @@ -1,24 +0,0 @@ -Package: precommit -Title: Pre commit hooks -Version: 0.0.0.9007 -Author: Lorenz Walthert -Maintainer: Lorenz Walthert -Imports: - docopt, - fs, - here, - oneliner (>= 0.1.0), - roxygen2, - spelling, - styler (>= 1.1.1.9002), - testthat, - tic, - usethis, - withr -Remotes: - lorenzwalthert/oneliner, - r-lib/styler, - ropenscilabs/tic -Encoding: UTF-8 -Roxygen: list(markdown = TRUE) -RoxygenNote: 6.1.1 From bd8ad270fdaf2aeda75a805438e2c6392f0b4531 Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Sun, 14 Jul 2024 16:17:29 +0200 Subject: [PATCH 03/11] show description --- .github/workflows/end-to-end.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/end-to-end.yml b/.github/workflows/end-to-end.yml index 1db2d2aef..6fde20b36 100644 --- a/.github/workflows/end-to-end.yml +++ b/.github/workflows/end-to-end.yml @@ -61,6 +61,7 @@ jobs: - name: Run pre-commit run: | + cat DESCRIPTION echo 'one' > README.Rmd echo 'one' >> codemeta.json echo 'one' > README.md From 6dfeb702a7ee05c6b735fd249b364957e5a8d573 Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Sun, 14 Jul 2024 16:19:58 +0200 Subject: [PATCH 04/11] more verbose end to end test --- .github/workflows/end-to-end.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/end-to-end.yml b/.github/workflows/end-to-end.yml index 6fde20b36..3136c10fa 100644 --- a/.github/workflows/end-to-end.yml +++ b/.github/workflows/end-to-end.yml @@ -61,16 +61,19 @@ jobs: - name: Run pre-commit run: | + brew install pre-commit cat DESCRIPTION echo 'one' > README.Rmd echo 'one' >> codemeta.json echo 'one' > README.md echo "#' some code\n#'\n#' @param here.\n#' @name somethings\nNULL" > R/test.R # overwrite if anything there - brew install pre-commit pre-commit install + echo 'running R/test.R' pre-commit run --files R/test.R + echo 'running DESCRIPTION' pre-commit run --files DESCRIPTION git add README* + echo 'running README' pre-commit run --files README.Rmd cp tests/testthat/in/_pkgdown-index-articles.yml _pkgdown.yml rm -rf vignettes @@ -79,7 +82,9 @@ jobs: rm -rf man/ mkdir -p man cp tests/testthat/in/autoupdate.Rd man/ + echo 'running _pkgdown.yml' pre-commit run --files _pkgdown.yml + echo 'running man/autoupdate.Rd' pre-commit run --files man/autoupdate.Rd git reset HEAD --hard # restore initial state env: From 6b560c1aee4128a59501fa390d5b30a88722d204 Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Sun, 14 Jul 2024 16:22:28 +0200 Subject: [PATCH 05/11] Revert "delete unused reference file" This reverts commit d28564dc8eeb44dcda5296de2d91677475a5235e. --- tests/testthat/reference-objects/DESCRIPTION | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/testthat/reference-objects/DESCRIPTION diff --git a/tests/testthat/reference-objects/DESCRIPTION b/tests/testthat/reference-objects/DESCRIPTION new file mode 100644 index 000000000..b7d607d35 --- /dev/null +++ b/tests/testthat/reference-objects/DESCRIPTION @@ -0,0 +1,24 @@ +Package: precommit +Title: Pre commit hooks +Version: 0.0.0.9007 +Author: Lorenz Walthert +Maintainer: Lorenz Walthert +Imports: + docopt, + fs, + here, + oneliner (>= 0.1.0), + roxygen2, + spelling, + styler (>= 1.1.1.9002), + testthat, + tic, + usethis, + withr +Remotes: + lorenzwalthert/oneliner, + r-lib/styler, + ropenscilabs/tic +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +RoxygenNote: 6.1.1 From f9f28de67d539bcca47fe0965811913cdfb1db91 Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Sun, 14 Jul 2024 16:28:32 +0200 Subject: [PATCH 06/11] use compatible description --- .github/workflows/end-to-end.yml | 14 ++++++++++---- tests/testthat/reference-objects/DESCRIPTION | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/end-to-end.yml b/.github/workflows/end-to-end.yml index 3136c10fa..60e60c092 100644 --- a/.github/workflows/end-to-end.yml +++ b/.github/workflows/end-to-end.yml @@ -62,19 +62,23 @@ jobs: - name: Run pre-commit run: | brew install pre-commit + pre-commit install cat DESCRIPTION - echo 'one' > README.Rmd - echo 'one' >> codemeta.json - echo 'one' > README.md + echo "#' some code\n#'\n#' @param here.\n#' @name somethings\nNULL" > R/test.R # overwrite if anything there - pre-commit install echo 'running R/test.R' pre-commit run --files R/test.R + echo 'running DESCRIPTION' pre-commit run --files DESCRIPTION + + echo 'one' > README.Rmd + echo 'one' >> codemeta.json + echo 'one' > README.md git add README* echo 'running README' pre-commit run --files README.Rmd + cp tests/testthat/in/_pkgdown-index-articles.yml _pkgdown.yml rm -rf vignettes mkdir vignettes @@ -82,8 +86,10 @@ jobs: rm -rf man/ mkdir -p man cp tests/testthat/in/autoupdate.Rd man/ + cp tests/testthat/reference-objects/DESCRIPTION . echo 'running _pkgdown.yml' pre-commit run --files _pkgdown.yml + echo 'running man/autoupdate.Rd' pre-commit run --files man/autoupdate.Rd git reset HEAD --hard # restore initial state diff --git a/tests/testthat/reference-objects/DESCRIPTION b/tests/testthat/reference-objects/DESCRIPTION index b7d607d35..c1411e1ec 100644 --- a/tests/testthat/reference-objects/DESCRIPTION +++ b/tests/testthat/reference-objects/DESCRIPTION @@ -22,3 +22,4 @@ Remotes: Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 6.1.1 +URL: https://example.com From 2e77eb07352ea2ad198f847d5e59ce7a1e48004a Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Sun, 14 Jul 2024 16:54:07 +0200 Subject: [PATCH 07/11] re-order to ensure codemeta and description are in place --- .github/workflows/end-to-end.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/end-to-end.yml b/.github/workflows/end-to-end.yml index 60e60c092..5b23a42c9 100644 --- a/.github/workflows/end-to-end.yml +++ b/.github/workflows/end-to-end.yml @@ -69,11 +69,12 @@ jobs: echo 'running R/test.R' pre-commit run --files R/test.R + echo 'one' >> codemeta.json + cp tests/testthat/reference-objects/DESCRIPTION . echo 'running DESCRIPTION' pre-commit run --files DESCRIPTION echo 'one' > README.Rmd - echo 'one' >> codemeta.json echo 'one' > README.md git add README* echo 'running README' @@ -86,7 +87,6 @@ jobs: rm -rf man/ mkdir -p man cp tests/testthat/in/autoupdate.Rd man/ - cp tests/testthat/reference-objects/DESCRIPTION . echo 'running _pkgdown.yml' pre-commit run --files _pkgdown.yml From fdc859716f9d188a0170fa5417e275cb47f8b9e6 Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Sun, 14 Jul 2024 17:12:11 +0200 Subject: [PATCH 08/11] ensure codemeta is younger than description --- .github/workflows/end-to-end.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/end-to-end.yml b/.github/workflows/end-to-end.yml index 5b23a42c9..fd1f137de 100644 --- a/.github/workflows/end-to-end.yml +++ b/.github/workflows/end-to-end.yml @@ -62,15 +62,16 @@ jobs: - name: Run pre-commit run: | brew install pre-commit - pre-commit install + pre-commit install --install-hooks cat DESCRIPTION echo "#' some code\n#'\n#' @param here.\n#' @name somethings\nNULL" > R/test.R # overwrite if anything there echo 'running R/test.R' pre-commit run --files R/test.R - echo 'one' >> codemeta.json cp tests/testthat/reference-objects/DESCRIPTION . + sleep 1 + echo 'one' >> codemeta.json echo 'running DESCRIPTION' pre-commit run --files DESCRIPTION From 30ae9afe9842b14ede10ad4de44cc0c1981eecee Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Sun, 14 Jul 2024 17:52:30 +0200 Subject: [PATCH 09/11] skip tests that interfear with pkgdown --- .github/workflows/end-to-end.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/end-to-end.yml b/.github/workflows/end-to-end.yml index fd1f137de..c2ebf40a9 100644 --- a/.github/workflows/end-to-end.yml +++ b/.github/workflows/end-to-end.yml @@ -63,36 +63,41 @@ jobs: run: | brew install pre-commit pre-commit install --install-hooks - cat DESCRIPTION - echo "#' some code\n#'\n#' @param here.\n#' @name somethings\nNULL" > R/test.R # overwrite if anything there echo 'running R/test.R' + echo "#' some code\n#'\n#' @param here.\n#' @name somethings\nNULL" > R/test.R # overwrite if anything there pre-commit run --files R/test.R + echo 'running DESCRIPTION' cp tests/testthat/reference-objects/DESCRIPTION . - sleep 1 + sleep 2 echo 'one' >> codemeta.json - echo 'running DESCRIPTION' pre-commit run --files DESCRIPTION + echo 'running README' echo 'one' > README.Rmd + sleep 1 echo 'one' > README.md git add README* - echo 'running README' pre-commit run --files README.Rmd + echo 'running _pkgdown.yml' cp tests/testthat/in/_pkgdown-index-articles.yml _pkgdown.yml rm -rf vignettes mkdir vignettes cp tests/testthat/in/pkgdown.Rmd vignettes/ + pre-commit run --files _pkgdown.yml + + echo 'running man/autoupdate.Rd' + git reset HEAD --hard # restore initial state + git clean -f rm -rf man/ mkdir -p man cp tests/testthat/in/autoupdate.Rd man/ - echo 'running _pkgdown.yml' - pre-commit run --files _pkgdown.yml + SKIP=pkgdown,consistent-release-tag pre-commit run --files man/autoupdate.Rd - echo 'running man/autoupdate.Rd' - pre-commit run --files man/autoupdate.Rd git reset HEAD --hard # restore initial state + git clean -f + env: SKIP: consistent-release-tag From f869e14183932ed7dc2e286b8a9acae73f7be544 Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Mon, 15 Jul 2024 09:58:56 +0200 Subject: [PATCH 10/11] pkgdown needs to be in sync with man/ --- .github/workflows/end-to-end.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/end-to-end.yml b/.github/workflows/end-to-end.yml index c2ebf40a9..16c686554 100644 --- a/.github/workflows/end-to-end.yml +++ b/.github/workflows/end-to-end.yml @@ -83,6 +83,9 @@ jobs: echo 'running _pkgdown.yml' cp tests/testthat/in/_pkgdown-index-articles.yml _pkgdown.yml + rm -rf man/ + mkdir man + cp tests/testthat/in/autoupdate.Rd man/autoudpate.Rd rm -rf vignettes mkdir vignettes cp tests/testthat/in/pkgdown.Rmd vignettes/ From ece9b1ed1d809e2af7affa17bc5cf6d49bc26639 Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Mon, 15 Jul 2024 10:38:42 +0200 Subject: [PATCH 11/11] only run roxygenise hook --- .github/workflows/end-to-end.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/end-to-end.yml b/.github/workflows/end-to-end.yml index 16c686554..f24068081 100644 --- a/.github/workflows/end-to-end.yml +++ b/.github/workflows/end-to-end.yml @@ -97,7 +97,7 @@ jobs: rm -rf man/ mkdir -p man cp tests/testthat/in/autoupdate.Rd man/ - SKIP=pkgdown,consistent-release-tag pre-commit run --files man/autoupdate.Rd + pre-commit run roxygenize --files man/autoupdate.Rd git reset HEAD --hard # restore initial state git clean -f