Skip to content
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

Merged
merged 3 commits into from Sep 11, 2019

Conversation

@noamross
Copy link
Contributor

commented Sep 8, 2019

  • 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

I am unsure if stop_for_name is the best argument name, open to other suggestions!

Closes #528

Allow invalid CRAN names
- 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
@jennybc
Copy link
Member

left a comment

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.

R/create.R Outdated Show resolved Hide resolved
R/description.R Show resolved Hide resolved
tests/testthat/test-use-description.R Outdated Show resolved Hide resolved
Change argument to check_name, eliminate warnings
- Simplify check logic with elimination of warnings
- Update tests
- Re-document
@@ -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) {

This comment has been minimized.

Copy link
@jennybc

jennybc Sep 11, 2019

Member

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)

This comment has been minimized.

Copy link
@jennybc

jennybc Sep 11, 2019

Member

We've got expect_error_free() for this (defined in tests/testthat/helper.R).

NEWS.md Outdated Show resolved Hide resolved

@noamross noamross force-pushed the noamross:non-cran-desc branch from 5dae6a1 to 01cc846 Sep 11, 2019

@jennybc

This comment has been minimized.

Copy link
Member

commented Sep 11, 2019

Thanks!

@jennybc jennybc merged commit f76f8ff into r-lib:master Sep 11, 2019

4 checks passed

codecov/patch 100% of diff hit (target 48.5%)
Details
codecov/project 48.74% (+0.24%) compared to 5c1efdd
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.