inbo / checklist

An R package for checking R packages and R code
https://inbo.github.io/checklist
GNU General Public License v3.0
16 stars 2 forks source link

Citation file needs an update #64

Closed ElsLommelen closed 2 years ago

ElsLommelen commented 3 years ago

Today I installed the new version of checklist (0.1.13), which solved a lot of issues for me (thanks!), but when running the check_package() test, I suddenly got a new error on the subject of CITATION: CITATION file needs an update. I noticed on the NEWS website that a new function update_citation() was added, that (according to the function description) creates or updates the file inst/CITATION. So I ran this function to solve the problem, but it gave the same error both locally and on github (where I didn't push the file yet).

The generated file inst/CITATION has the following content:

citHeader("To cite `inbodb` in publications please use:")
# begin checklist entry
citEntry(
  entry = "Manual",
  title = "inbodb: Connect to and retrieve data from databases on the INBO server. Version 0.0.2",
  author = c(person(given = "Els", family = "Lommelen"), person(given = "Hans", family = "Van Calster"), person(given = "Els", family = "De Bie"), person(given = "Floris", family = "Vanderhaeghe")),
  year = 2021,
  url = "https://github.com/inbo/inbodb",
  abstract = "A bundle of functions to connect to and retrieve data from databases on the INBO server, with dedicated functions to query some of these databases.",
  textVersion = "Lommelen, Els; Van Calster, Hans; De Bie, Els; Vanderhaeghe, Floris (2021) inbodb: Connect to and retrieve data from databases on the INBO server. Version 0.0.2. https://github.com/inbo/inbodb, https://inbo.github.io/inbodb/",
)
# end checklist entry

It is nice to have such additions that I honestly would just forget to add, but maybe it could be helpful to have some reference to information that helps solving problems in case they occur (e.g. a link to a manual on citations in the function documentation)?

hansvancalster commented 3 years ago

Did you try running setup_package() (but review all changes and revert those you do not want)? This should also have added the CITATION file. It worked for me with the protocolhelper package - although initially I saw a similar message but it was gone after PR #63 .

ElsLommelen commented 3 years ago

I tried running setup_package() first now, but this makes no difference (except for some minor changes in .gitignore and _pkgdown.yml): the CITATION file was already added after using check_package() yesterday, and I think this file hasn't changed when using setup_package() (and I actually hope it doesn't change this way: this would mean different unrelated functions are developed to generate the same file, or the same function generates a each time a different file, and both are a recipe for problems when performing checks on it ;-) ).

By the way, I encountered the same problem in another package. I could also give the content of the generated CITATION file, or I could test a solution for the problem on this second package, I leave it up to you.

ThierryO commented 3 years ago

Did you commit the CITATION file? You get the error when git notices changes (untracked, unstaged or staged) to the CITATION file. Committing the CITATION file generated by check_package()should remove the error.

ElsLommelen commented 3 years ago

Indeed, that's it: it has to be committed. Could you please make this clear somewhere for all users? Preferably clarify this in the error message CITATION needs an update itself, or otherwise add it somewhere in the function documentation of update_citation() (though this may be less relevant for users that only need this function) or in the vignette describing the setup.

ThierryO commented 3 years ago

@ElsLommelen can you check the updated message in 26d9c1d

ElsLommelen commented 3 years ago

The message looks fine to me, I would certainly know what to do after reading it.

ThierryO commented 2 years ago

solved in #69