A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://thinkr-open.github.io/fusen/dev/reference/inflate_all.html below:

Inflate all your flat files — inflate_all • fusen

Inflate all the flat files stored in "dev/" and starting with "flat_"

Usage
inflate_all(
  pkg = ".",
  document = TRUE,
  check = TRUE,
  open_vignette = FALSE,
  overwrite = TRUE,
  check_unregistered = TRUE,
  codecov = FALSE,
  stylers,
  ...
)

inflate_all_no_check(
  pkg = ".",
  document = TRUE,
  open_vignette = FALSE,
  overwrite = TRUE,
  check_unregistered = TRUE,
  codecov = FALSE,
  stylers,
  ...
)
Arguments
pkg

Path to package

document

Logical. Whether to document your package using att_amend_desc

check

Logical. Whether to check package after Rmd inflating

open_vignette

Logical. Whether to open vignette file at the end of the process

overwrite

Logical (TRUE, FALSE) or character ("ask", "yes", "no). Whether to overwrite vignette and functions if already exists.

check_unregistered

Logical. Whether to help detect unregistered files. Typically files not created from a flat file and added manually in the repository.

codecov

Logical. Whether to compute code coverage with covr::package_coverage().

stylers

Function to be run at the end of the process, like styler::style_pkg or lintr::lint_package or a lambda function combining functions like: function() {styler::style_pkg(); lintr::lint_package()}. For a unique function, use the format without parenthesis () at the end of the command.

...

Arguments passed to devtools::check(). For example, you can do inflate(check = TRUE, quiet = TRUE), where quiet is passed to devtools::check().

Value

side effect. Inflates all your flat files that can be inflated.

Details

This requires to inflate() all flat files individually at least once, so that their specific inflate configurations are stored.

This also requires to register all R, tests and vignettes files of your package, even if not created with an inflate. Run inflate_all() once and read the messages. The first time, you will probably need to run register_all_to_config() if your package is not new.

For more information, read the vignette("inflate-all-your-flat-files", package = "fusen")

Examples
if (FALSE) { # \dontrun{
# Usually, in the current package run inflate_all() directly
# These functions change the current user workspace
inflate_all()
# Or inflate_all_no_check() to prevent checks to run
inflate_all_no_check()
# Or inflate with the styler you want
inflate_all(stylers = styler::style_pkg)
} # }

# You can also inflate_all flats of another package as follows
# Example with a dummy package with a flat file
dummypackage <- tempfile("inflateall.otherpkg")
dir.create(dummypackage)
fill_description(pkg = dummypackage, fields = list(Title = "Dummy Package"))
flat_files <- add_minimal_package(
  pkg = dummypackage,
  overwrite = TRUE,
  open = FALSE
)
#> Created file .here in /tmp/Rtmpki0c42/inflateall.otherpkg18b8534f893e . Please start a new R session in the new project directory.
flat_file <- flat_files[grep("flat", basename(flat_files))]
# Inflate the flat file once
usethis::with_project(dummypackage, {
  # if you are starting from a brand new package, inflate_all() will crash
  # it's because of the absence of a fusen config file
  #
  # inflate_all() # will crash

  # Add licence
  usethis::use_mit_license("John Doe")

  # you need to inflate manually your flat file first
  inflate(
    pkg = dummypackage,
    flat_file = flat_file,
    vignette_name = "Get started",
    check = FALSE,
    open_vignette = FALSE,
    document = TRUE,
    overwrite = "yes"
  )

  # your config file has been created
  config_yml_ref <-
    yaml::read_yaml(getOption("fusen.config_file", default = "dev/config_fusen.yaml"))
})
#>  Setting active project to "/tmp/Rtmpki0c42/inflateall.otherpkg18b8534f893e".
#>  Adding "MIT + file LICENSE" to License.
#>  Writing LICENSE.
#>  Writing LICENSE.md.
#>  Adding "^LICENSE\\.md$" to .Rbuildignore.
#>  Loading inflateall.otherpkg18b8534f893e
#> Writing NAMESPACE
#>  Adding knitr to Suggests field in DESCRIPTION.
#>  Use `requireNamespace("knitr", quietly = TRUE)` to test if knitr is
#>   installed.
#>  Then directly refer to functions with `knitr::fun()`.
#>  Adding "inst/doc" to .gitignore.
#> ── config file for dev/flat_minimal.Rmd ────────────────────────────────────────
#>  R: R/my_fun.R was added to the config file
#>  tests: tests/testthat/test-my_fun.R was added to the config file
#>  vignettes: vignettes/get-started.Rmd was added to the config file
#> Saving attachment parameters to yaml config file
#> Updating inflateall.otherpkg18b8534f893e documentation
#>  Loading inflateall.otherpkg18b8534f893e
#> Writing NAMESPACE
#> Writing my_fun.Rd
#>  Loading inflateall.otherpkg18b8534f893e
#> [+] 2 package(s) added: rmarkdown, testthat.
#>  Setting active project to "/tmp/Rtmpki0c42/dummy.package18b8761dfea7".

# Next time, you can run inflate_all() directly
usethis::with_project(dummypackage, {
  # now you can run inflate_all()
  inflate_all(check = FALSE, document = TRUE)
})
#>  Setting active project to "/tmp/Rtmpki0c42/inflateall.otherpkg18b8534f893e".
#>  The flat file flat_minimal.Rmd is going to be inflated
#> ── config file for dev/flat_minimal.Rmd ────────────────────────────────────────
#> ── check not registered files ──────────────────────────────────────────────────
#>  There are no unregistered files.
#> Documentation parameters were restored from attachment config file.
#> Updating inflateall.otherpkg18b8534f893e documentation
#>  Loading inflateall.otherpkg18b8534f893e
#> Writing NAMESPACE
#>  Loading inflateall.otherpkg18b8534f893e
#>  Setting active project to "/tmp/Rtmpki0c42/dummy.package18b8761dfea7".

# If you wish, the code coverage can be computed
usethis::with_project(dummypackage, {
  # now you can run inflate_all()
  inflate_all(check = FALSE, document = TRUE, codecov = TRUE)
})
#>  Setting active project to "/tmp/Rtmpki0c42/inflateall.otherpkg18b8534f893e".
#>  The flat file flat_minimal.Rmd is going to be inflated
#> ── config file for dev/flat_minimal.Rmd ────────────────────────────────────────
#> ── check not registered files ──────────────────────────────────────────────────
#>  There are no unregistered files.
#> Documentation parameters were restored from attachment config file.
#> Updating inflateall.otherpkg18b8534f893e documentation
#>  Loading inflateall.otherpkg18b8534f893e
#> Writing NAMESPACE
#>  Loading inflateall.otherpkg18b8534f893e
#>  Computing code coverage - it might take some time
#> inflateall.otherpkg18b8534f893e Coverage: 0.00%
#> R/my_fun.R: 0.00%
#>  Setting active project to "/tmp/Rtmpki0c42/dummy.package18b8761dfea7".

# Clean the temporary directory
unlink(dummypackage, recursive = TRUE)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4