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

Some updates to the default DESCRIPTION file #428

Merged
merged 4 commits into from Feb 21, 2014

Conversation

Projects
None yet
2 participants
@ncarchedi
Contributor

ncarchedi commented Feb 19, 2014

I started with a clean slate on this pull request to address the issues discussed in #411. For reference, here they are again:

  1. http://stackoverflow.com/questions/17662713/devtools-description-file
  2. https://gist.github.com/mbannert/8403801

I made the default DESCRIPTION file created by devtools more similar to the default DESCRIPTION file created by RStudio (when creating a new package). Authors@R, License, and Suggests still defer to getOption().

Here's the result of my changes:

> library(devtools)
> create("testPackage")
Creating package testPackage in .
No DESCRIPTION found. Creating with values:

Package: testPackage
Type: Package
Title: What the package does (short line)
Version: 0.1
Date: 2014-02-18
Authors@R: "First Last <first.last@example.com> [aut, cre]"
Description: More about what it does (maybe more than one line)
Depends: R (>= 3.0.2)
License: What license is it under?
LazyData: true
Adding Rstudio project file to testPackage

And immediately calling document(), which caused an error with the previous default value for Authors@R:

> document("testPackage")
Updating testPackage documentation
Loading testPackage
Updating namespace directives
Writing testPackage.Rd
> 

Finally, after setting some options (temporarily):

> options(devtools.desc.author = '"Nick Carchedi <nick.carchedi@example.com> [aut, cre]"', devtools.desc.license = "GPL (>= 2)")
> create("testPackage2")
Creating package testPackage2 in .
No DESCRIPTION found. Creating with values:

Package: testPackage2
Type: Package
Title: What the package does (short line)
Version: 0.1
Date: 2014-02-18
Authors@R: "Nick Carchedi <nick.carchedi@example.com> [aut, cre]"
Description: More about what it does (maybe more than one line)
Depends: R (>= 3.0.2)
License: GPL (>= 2)
LazyData: true
Adding Rstudio project file to testPackage2
>
R/load.r Outdated
@@ -213,10 +213,12 @@ build_description <- function(name, extra = list()) {
defaults <- compact(list(
Package = name,
Title = "",
Description = "",
Type = "Package",

This comment has been minimized.

@hadley

hadley Feb 21, 2014

Member

I think this can be omitted since it's the default.

R/load.r Outdated
"Authors@R" = getOption("devtools.desc.author"),
Description = "More about what it does (maybe more than one line)",

This comment has been minimized.

@hadley

hadley Feb 21, 2014

Member

How about: "What the package does (paragraph)"

R/load.r Outdated
Version = "0.1",
Date = Sys.Date(),

This comment has been minimized.

@hadley

hadley Feb 21, 2014

Member

Never put the date in the DESCRIPTION. There's no need and it gets out of date very quickly ;)

@hadley

This comment has been minimized.

Member

hadley commented Feb 21, 2014

Looks good. A few minor points inline.

@ncarchedi

This comment has been minimized.

Contributor

ncarchedi commented Feb 21, 2014

All good suggestions. Here's the new output:

> create("testPackage")
Creating package testPackage in .
No DESCRIPTION found. Creating with values:

Package: testPackage
Title: What the package does (short line)
Version: 0.1
Authors@R: "First Last <first.last@example.com> [aut, cre]"
Description: What the package does (paragraph)
Depends: R (>= 3.0.2)
License: What license is it under?
LazyData: true
Adding Rstudio project file to testPackage
> 
@hadley

This comment has been minimized.

Member

hadley commented Feb 21, 2014

Great. Could you please add a bullet point to NEWS.md briefly describing the change and thanking yourself (via your github username)

@ncarchedi

This comment has been minimized.

Contributor

ncarchedi commented Feb 21, 2014

Sure, thanks!

You might consider bringing the RStudio defaults in line with the new devtools defaults. When you create a new package project in RStudio, here's what it gives you:

Package: testPackage
Type: Package
Title: What the package does (short line)
Version: 1.0
Date: 2014-02-21
Author: Who wrote it
Maintainer: Who to complain to <yourfault@somewhere.net>
Description: More about what it does (maybe more than one line)
License: What license is it under?

hadley added a commit that referenced this pull request Feb 21, 2014

Merge pull request #428 from ncarchedi/master
Some updates to the default DESCRIPTION file

@hadley hadley merged commit 8a3f5cd into r-lib:master Feb 21, 2014

@hadley

This comment has been minimized.

Member

hadley commented Feb 21, 2014

Thanks. @jjallaire if you get a chance, it'd be great if the rstudio defaults matched this.

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