-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow invalid CRAN names #883
Conversation
- stop_for_name controls whether to throw error for invalid CRAN package names - Default to warning for use_description(), error for create_package() - Add tests - update NEWS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only other argument name that comes to mind -- somehow this seems more literally true -- is check_name
. If we do that, it would make sense to change the doc string as well.
- Simplify check logic with elimination of warnings - Update tests - Re-document
R/description.R
Outdated
@@ -97,17 +101,16 @@ build_description_list <- function(fields = list()) { | |||
compact(utils::modifyList(defaults, fields)) | |||
} | |||
|
|||
check_package_name <- function(name) { | |||
check_package_name <- function(name, stop_for_name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the signature can revert to just being name
, right?
test_that("valid CRAN names checked", { | ||
withr::local_options(list(usethis.description = NULL, devtools.desc = NULL)) | ||
scoped_temporary_package(dir = file_temp(pattern = "invalid_pkg_name")) | ||
expect_error(use_description(check_name = FALSE), NA) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've got expect_error_free()
for this (defined in tests/testthat/helper.R
).
5dae6a1
to
01cc846
Compare
Thanks! |
stop_for_name
controls whether to throw errorfor invalid CRAN package names
use_description()
, errorfor
create_package()
I am unsure if
stop_for_name
is the best argument name, open to other suggestions!Closes #528