benmarwick / rrtools

rrtools: Tools for Writing Reproducible Research in R
Other
670 stars 85 forks source link

Uppercase characters are not allowed in package names #76

Closed joeroe closed 5 years ago

joeroe commented 5 years ago

create_compendium() and use_compendium() refuse to make a package with uppercase characters in the name:

> rrtools::use_compendium("LongWindedScientificAnalysis")
Error: 'LongWindedScientificAnalysis' is not a valid package name. It should:
* Contain only ASCII letters, numbers, and '.'
* Have at least two characters
* Start with a letter
* Not end with '.'
* Not contain any upper case characters

This was added f2e3b43, to ensure compatibility with travis. But I'd make the case for allowing uppercase characters:

A solution would be to throw a warning about the travis issue when creating a compendium with uppercase characters, rather than an error. The hard check could be moved to use_travis().

benmarwick commented 5 years ago

Yes, a warning sounds like a good alternative to a strict rule, thanks for the suggestion.

Another option here is to separate the package name from the repo name. For example @cboettig names his compendium pkgs simply 'compendium', and then has more flexible names for the repo: https://github.com/cboettig/noise-phenomena/blob/master/DESCRIPTION

I like that because it saves the user from making a decision they probably don't care about. CRAN is not the end point for these compendium pkgs, so it hardly matters what the pkg is called.

What do you think about that?

joeroe commented 5 years ago

That sounds like a good idea. I can think of some reasons why you might want the package to have a descriptive name, e.g. if you want to library() it in another project, so maybe add it as an option rather than a default?

ha0ye commented 5 years ago

Chiming in to say:

benmarwick commented 5 years ago

Thanks for the feedback, we couldn't remember why we had this rule, and everything seems to work fine with upper and lower case mixed together, as you say. So we've removed that rule in https://github.com/benmarwick/rrtools/commit/caeb97f03772c5d3ce0ac71240c2315de147eeab

image

Thanks again!