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

Polish code and docs re: options for DESCRIPTION fields #367

Merged
merged 15 commits into from May 29, 2018

Conversation

Projects
None yet
2 participants
@jennybc
Member

jennybc commented May 26, 2018

Closes #233 create_package() should document options

Closes #159 Review all uses of getOption("devtools.SOMETHING")

Rationalize and document the use of options and internal defaults re: DESCRIPTION fields. Key principles:

  • Prefer usethis options to devtools options, but consult devtools options for backwards-compatibility
  • Eliminate redundant consultation of options
  • Adopt a modifyList() mentality vs. the "all or nothing" mentality of %||%
  • Add tests to make sure the order of precedence is what we say it is

@jennybc jennybc changed the title from WIP re: options to Polish code and docs re: options for DESCRIPTION fields May 28, 2018

@jennybc jennybc requested review from hadley and jimhester May 28, 2018

Show outdated Hide outdated R/description.R
Show outdated Hide outdated R/description.R

jennybc added some commits May 28, 2018

@jennybc

This comment has been minimized.

Show comment
Hide comment
@jennybc

jennybc May 29, 2018

Member

I think this does everything we discussed @hadley:

  • Drop support of individual devtools' options and document this in NEWS.
  • Add check that user's fields is a dictionary-ish list.
  • Consolidate
    • data: option- and package-based defaults exposed via use_description_defaults()
    • logic: user's fields > usethis option > devtools option > usethis defaults, enacted in build_description_list()
  • Tests now focus on build_description_list()
Member

jennybc commented May 29, 2018

I think this does everything we discussed @hadley:

  • Drop support of individual devtools' options and document this in NEWS.
  • Add check that user's fields is a dictionary-ish list.
  • Consolidate
    • data: option- and package-based defaults exposed via use_description_defaults()
    • logic: user's fields > usethis option > devtools option > usethis defaults, enacted in build_description_list()
  • Tests now focus on build_description_list()
Show outdated Hide outdated R/description.R
ByteCompile = "true"
build_description_list <- function(fields = list()) {
defaults <- use_description_defaults()
defaults <- utils::modifyList(

This comment has been minimized.

@hadley

hadley May 29, 2018

Member

It feels to me like this belongs in use_description_defaults()

@hadley

hadley May 29, 2018

Member

It feels to me like this belongs in use_description_defaults()

This comment has been minimized.

@jennybc

jennybc May 29, 2018

Member

I actually made use_description_defaults() "data only" on purpose. It's the only easy way to see the usethis field defaults w/o reading source. Unless you care deeply, will leave this.

@jennybc

jennybc May 29, 2018

Member

I actually made use_description_defaults() "data only" on purpose. It's the only easy way to see the usethis field defaults w/o reading source. Unless you care deeply, will leave this.

Show outdated Hide outdated tests/testthat/test-use-description.R
Show outdated Hide outdated tests/testthat/test-use-description.R

jennybc added some commits May 29, 2018

@hadley

hadley approved these changes May 29, 2018

@jennybc jennybc merged commit 5fca4ce into master May 29, 2018

6 checks passed

codecov/patch 100% of diff hit (target 62.91%)
Details
codecov/project 63.13% (+0.22%) compared to f9becb7
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@jennybc jennybc deleted the options branch May 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment