Create a package example producing notes and errors

create_example_pkg(
  path = tempfile(pattern = "pkg-"),
  with_functions = TRUE,
  with_extra_notes = FALSE,
  with_nonascii = FALSE,
  with_undocumented_data = FALSE
)

Arguments

path

Path where to store the example package

with_functions

Logical. Whether there will be functions or not (with notes)

with_extra_notes

Logical. Whether there are extra notes or not

with_nonascii

Logical. If TRUE, copy a fixture file containing non-ASCII characters (French comments, string literals, message text) so audit_ascii() / fix_ascii() have something to surface.

with_undocumented_data

Logical. If TRUE, save a small data.frame to data/ without writing a roxygen block for it, so audit_dataset_doc() flags it as undocumented.

Value

Path where the example package is stored.

Examples

create_example_pkg()
#>  Creating /tmp/RtmpXWgQdx/pkg-1a3a7c49f5bf/checkpackage/.
#>  Setting active project to "/tmp/RtmpXWgQdx/pkg-1a3a7c49f5bf/checkpackage".
#>  Creating R/.
#>  Writing DESCRIPTION.
#> Package: checkpackage
#> Title: What the Package Does (One Line, Title Case)
#> Version: 0.0.0.9000
#> Authors@R (parsed):
#>     * First Last <first.last@example.com> [aut, cre]
#> Description: What the package does (one paragraph).
#> License: `use_mit_license()`, `use_gpl3_license()` or friends to
#>     pick a license
#> Encoding: UTF-8
#> Roxygen: list(markdown = TRUE)
#> RoxygenNote: 8.0.0
#>  Writing NAMESPACE.
#>  Setting active project to "<no active project>".
#> Saving attachment parameters to yaml config file
#> Updating checkpackage documentation
#> Writing NAMESPACE
#>  Loading checkpackage
#>  function.R:4: @return requires a value.
#> Writing NAMESPACE
#> Writing my_long_fun_name_for_multiple_lines_globals.Rd
#> Writing my_plot.Rd
#> Writing my_not_exported_doc.Rd
#>  Loading checkpackage
#>  function.R:4: @return requires a value.
#> [+] 1 package(s) added: dplyr.
#>  Demo package created at /tmp/RtmpXWgQdx/pkg-1a3a7c49f5bf/checkpackage
#>  Active fixtures: bad-function examples (tags, globals).