Skip to content

Commit

Permalink
Issue 126: deprecate style only, style description only, and document…
Browse files Browse the repository at this point in the history
… only workflows (#131)

* Remove R functions for description, style only, docs only workflows

Partially addresses #126.

* add warning about deprecation
partially addresses #126

* run devtools::document()

* fix: add date to deprecation msg
  • Loading branch information
k-doering-NOAA committed Jul 15, 2024
1 parent efda7e9 commit 2695d1a
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 158 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/style-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Warn about workflow removal
run: |
echo "::warning title=Deprecating style-description workflow::The style-description reusable workflow will be deprecated on 5 December 2024. Use ghactions4r::use_style_and_document() instead to set up a replacement with additional functionality."
- name: Install curl dependency
run: |
sudo apt-get update
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/style-r-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Warn about workflow removal
run: |
echo "::warning title=Deprecating style-r-code workflow::The style-r-code reusable workflow will be deprecated on 5 December 2024. Use ghactions4r::use_style_and_document() instead to set up a replacement with additional functionality."
- uses: r-lib/actions/setup-r@v2

- name: Install dependencies
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/update-roxygen-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Warn about workflow removal
run: |
echo "::warning title=Deprecating update-roxygen-docs workflow::The update-roxygen-docs reusable workflow will be deprecated on 5 December 2024. Use ghactions4r::use_style_and_document() instead to set up a replacement with additional functionality."
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
Expand Down
3 changes: 0 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@ export(use_connect_publish)
export(use_doc_and_style_r)
export(use_r_cmd_check)
export(use_spell_check)
export(use_style_description)
export(use_style_r_code)
export(use_update_pkgdown)
export(use_update_roxygen_docs)
40 changes: 0 additions & 40 deletions R/use_r_workflows.R
Original file line number Diff line number Diff line change
Expand Up @@ -204,46 +204,6 @@ use_build_pkgdown <- function(workflow_name = "call-build-pkgdown.yml") {
)
}

#' use workflow in current pkg to run devtools::document() and submit results as a PR
#' @template workflow_name
#' @export
use_update_roxygen_docs <- function(workflow_name = "call-update-docs.yml") {
usethis::use_github_action("call-update-docs.yml",
save_as = workflow_name,
url = "https://raw.githubusercontent.com/nmfs-fish-tools/ghactions4r/main/inst/templates/call-update-docs.yml"
)
usethis::use_git_ignore(ignores = "*.rds", directory = file.path(".github"))
}

#' use workflow in current pkg to run `usethis::use_tidy_description()`
#'
#' Run `usethis::use_tidy_description()` upon changes to the DESCRIPTION file
#' and submit results as a PR.
#' @template workflow_name
#' @export
use_style_description <- function(workflow_name = "call-style-description.yml") {
check_workflow_name(workflow_name)
usethis::use_github_action(
"call-style-description.yml",
save_as = workflow_name,
url = "https://raw.githubusercontent.com/nmfs-fish-tools/ghactions4r/main/inst/templates/call-style-description.yml"
)
usethis::use_git_ignore(ignores = "*.rds", directory = file.path(".github"))
}

#' use workflow in current pkg to run styler::style_pkg() and submit results as a PR
#' @template workflow_name
#' @export
use_style_r_code <- function(workflow_name = "call-style.yml") {
check_workflow_name(workflow_name)
usethis::use_github_action("call-style.yml",
save_as = workflow_name,
url = "https://raw.githubusercontent.com/nmfs-fish-tools/ghactions4r/main/inst/templates/call-style.yml"
)
usethis::use_git_ignore(ignores = "*.rds", directory = file.path(".github"))
}


#' use workflow in current pkg to build and deploy (update) bookdown
#' Builds the bookdown, then deploys it to a branch in the same repository called gh-pages.
#' The repository must be
Expand Down
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,6 @@ ghactions4r::use_calc_coverage()
```
(a codecov.io account is also necessary to view the coverage results)

- To update documentation using `devtools::document()`:
```r
ghactions4r::use_update_roxygen_docs()
```

- To update R code styling using `styler::style_pkg()`:
```r
ghactions4r::use_style_r_code()
```

- To update the style of the DESCRIPTION file using `usethis::use_tidy_description()`:
```r
ghactions4r::use_style_description()
```

- To update documentation, DESCRIPTION file, and code styling for an R package (with the option of running `ghactions4r::rm_dollar_sign()`):
```r
ghactions4r::use_doc_and_style_r(use_rm_dollar_sign = FALSE)
Expand Down
17 changes: 0 additions & 17 deletions inst/templates/call-style-description.yml

This file was deleted.

12 changes: 0 additions & 12 deletions inst/templates/call-style.yml

This file was deleted.

11 changes: 0 additions & 11 deletions inst/templates/call-update-docs.yml

This file was deleted.

16 changes: 0 additions & 16 deletions man/use_style_description.Rd

This file was deleted.

15 changes: 0 additions & 15 deletions man/use_style_r_code.Rd

This file was deleted.

15 changes: 0 additions & 15 deletions man/use_update_roxygen_docs.Rd

This file was deleted.

14 changes: 0 additions & 14 deletions tests/testthat/test-use_r_workflows.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,6 @@ test_that("use_build_pkgdown()) works", {
expect_snapshot(test)
})

test_that("use_update_roxygen_docs() works", {
use_update_roxygen_docs()
expect_true(file.exists(".github/workflows/call-update-docs.yml"))
test <- readLines(".github/workflows/call-update-docs.yml")
expect_snapshot(test)
})

test_that("use_style_r_code() works", {
use_style_r_code()
expect_true(file.exists(".github/workflows/call-style.yml"))
test <- readLines(".github/workflows/call-style.yml")
expect_snapshot(test)
})

test_that("use_build_deploy_bookdown() works", {
use_build_deploy_bookdown()
expect_true(file.exists(".github/workflows/call-build-deploy-bookdown.yml"))
Expand Down

0 comments on commit 2695d1a

Please sign in to comment.