Style a package

style_pkg(
  path = ".",
  config_file = "tergo.toml",
  configuration = list(),
  force = FALSE,
  extensions = c(".R", ".r"),
  verbose = interactive()
)

Arguments

path

(character) The path to the package. Default ".".

config_file

(character) The path to the configuration file. Default "tergo.toml".

configuration

(list) Configuration for formatting. Default list().

force

(logical(1)) Whether to format the files even if no package was found. TRUE - format the .R and .r files found in the directory (recursive). FALSE exit without formatting anything. Default FALSE.

extensions

(character) The extensions of the files to format. Default c(".R", ".r").

verbose

(logical(1)) Whether per file status and run statistics should be printed. Default interactive().

Value

No return values, called for side effects.

Details

Configuration is read from a file named tergo.toml in the root of the package. The precedence of the configuration is (from the highest to lowest):

  1. The configuration passed to the function.

  2. The configuration file.

To see possible configuration options, see get_default_config().

Examples

style_pkg()
style_pkg(path = "./tergo", config_file = "custom_tergo.toml", verbose = TRUE)
#> addins.R 
#> extendr-wrappers.R 
#> styling.R 
#> tergo.R 
#> bench.R 
#> configure.R 
#> update_authors.R 
#> 
#> Summary:
#>   ▶ Files processed : 7
#>    Successful      : 7
#>    Failed          : 0