Skip to content

Commit

Permalink
Store _freeze in version control
Browse files Browse the repository at this point in the history
  • Loading branch information
jabenninghoff committed Nov 26, 2023
1 parent 8ef35d1 commit c48b5a1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 27 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# rdev 1.8.5

* Changed `use_analysis_package()` to store `_freeze` directory in git per Quarto [guide](https://quarto.org/docs/projects/code-execution.html#using-freeze)

# rdev 1.8.4

* Also set GitHub Pages URL in `use_rdev_pkgdown()`
Expand Down
44 changes: 19 additions & 25 deletions R/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -475,44 +475,38 @@ use_analysis_package <- function(use_quarto = TRUE, prompt = FALSE) {
# workaround for lintr, R CMD check
create <- gitignore <- rbuildignore <- NULL

analysis_layout <- tibble::tribble(
~pattern, ~create, ~gitignore, ~rbuildignore,
"analysis", TRUE, FALSE, FALSE,
"analysis/*.docx", FALSE, TRUE, TRUE,
"analysis/*.html", FALSE, TRUE, TRUE,
"analysis/*.md", FALSE, TRUE, TRUE,
"analysis/*.pdf", FALSE, TRUE, TRUE,
"analysis/*-figure/", FALSE, TRUE, TRUE,
"analysis/assets", TRUE, FALSE, FALSE,
"analysis/data", TRUE, FALSE, FALSE,
"analysis/import", TRUE, TRUE, TRUE,
"analysis/rendered", TRUE, TRUE, TRUE,
"docs", TRUE, FALSE, TRUE
)

if (use_quarto) {
analysis_layout <- tibble::tribble(
quarto_layout <- tibble::tribble(
~pattern, ~create, ~gitignore, ~rbuildignore,
"analysis", TRUE, FALSE, FALSE,
"analysis/*.docx", FALSE, TRUE, TRUE,
"analysis/*.html", FALSE, TRUE, TRUE,
"analysis/*.md", FALSE, TRUE, TRUE,
"analysis/*.pdf", FALSE, TRUE, TRUE,
"analysis/*-figure/", FALSE, TRUE, TRUE,
"analysis/assets", TRUE, FALSE, FALSE,
"analysis/data", TRUE, FALSE, FALSE,
"analysis/import", TRUE, TRUE, TRUE,
"analysis/rendered", TRUE, TRUE, TRUE,
"docs", TRUE, FALSE, TRUE,
".nojekyll", FALSE, FALSE, TRUE,
".quarto", FALSE, FALSE, TRUE,
"/.quarto/", FALSE, TRUE, FALSE,
"_freeze", FALSE, FALSE, TRUE,
"/_freeze/", FALSE, TRUE, FALSE,
"_quarto.yml", FALSE, FALSE, FALSE
)
analysis_layout <- rbind(analysis_layout, quarto_layout)
} else {
analysis_layout <- tibble::tribble(
pkgdown_layout <- tibble::tribble(
~pattern, ~create, ~gitignore, ~rbuildignore,
"analysis", TRUE, FALSE, FALSE,
"analysis/*.docx", FALSE, TRUE, TRUE,
"analysis/*.html", FALSE, TRUE, TRUE,
"analysis/*.md", FALSE, TRUE, TRUE,
"analysis/*.pdf", FALSE, TRUE, TRUE,
"analysis/*-figure/", FALSE, TRUE, TRUE,
"analysis/assets", TRUE, FALSE, FALSE,
"analysis/data", TRUE, FALSE, FALSE,
"analysis/import", TRUE, TRUE, TRUE,
"analysis/rendered", TRUE, TRUE, TRUE,
"docs", TRUE, FALSE, TRUE,
"pkgdown", TRUE, FALSE, TRUE,
"_pkgdown.yml", FALSE, FALSE, TRUE
)
analysis_layout <- rbind(analysis_layout, pkgdown_layout)
}

analysis_dirs <- subset(analysis_layout, create)$pattern
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ test_that("use_analysis_package returns expected values", {
"^docs$", "^\\.nojekyll$", "^\\.quarto$", "^_freeze$"
), gitignore = c(
"analysis/*.docx", "analysis/*.html", "analysis/*.md", "analysis/*.pdf", "analysis/*-figure/",
"analysis/import", "analysis/rendered", "/.quarto/", "/_freeze/"
"analysis/import", "analysis/rendered", "/.quarto/"
)
)
desc_urls <- c("https://example.github.io/package/", "https://github.com/example/package")
Expand Down
2 changes: 1 addition & 1 deletion vignettes/analysis-package-layout.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ R |`x`|`x`| All project functions go here, with [roxygen2
README.Rmd |`x`|`x`| Generated with `usethis::use_readme_md()` or rdev template
README.md |`x`|`x`| Generated with `devtools::build_readme()`
TODO.md |`x`|`x`| To-do list, inspired by renv's [historical TODO.md](https://github.com/rstudio/renv/blob/99737730ea69730b211770ba2bfa78301cf0e7b2/TODO.md)
_freeze | | | Used by the Quarto [`freeze`](https://quarto.org/docs/projects/code-execution.html#freeze) option
_freeze | |`x`| Used by the Quarto [`freeze`](https://quarto.org/docs/projects/code-execution.html#freeze) option
_pkgdown.yml | |`x`| [pkgdown](https://pkgdown.r-lib.org) metadata, stored in the project root to make it more [discoverable](https://github.com/search?q=filename%3Apkgdown.yml+path%3A%2F&type=Code) (not used with Quarto)
_quarto.yml |`x`|`x`| Quarto [configuration file](https://quarto.org/docs/projects/quarto-projects.html#project-metadata)
analysis | |`x`| Exploratory data analysis in R Notebooks and R Presentations. Include functions from the R directory using `library()`, not `source()`.
Expand Down

0 comments on commit c48b5a1

Please sign in to comment.