usethis
usethis copied to clipboard
`create_package()` checks the wrong name when using `fields` and "Package"
- Create a directory that is not a valid package name, e.g. "my-test-directory".
- Now from within that directory, try to initialize a package using {usethis}:
usethis::create_package(".", fields = list(Package = "valid.package.name"), check_name = TRUE) # Error: 'my-test-directory' is not a valid package name. To be allowed on CRAN, it should: ...
Setting check_name = FALSE
allows the call to proceed correctly, and indeed the created DESCRIPTION file has the package name set correctly, too: Package: valid.package.name
.
So, it appears check_name = TRUE
ignores the case where the name is specified in the fields
argument.
EDIT: behavior observed with {usethis} v2.1.6.