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

Fix ignored filenames #52

Closed hansvancalster closed 3 years ago

hansvancalster commented 3 years ago

checklist::check_filename() checks the *.Rproj file generated by Rstudio. I think this file should be ignored to avoid warning about use of hyphen in that filename. Related to #50 (the fix in #51 only addressed the lintr aspect).

ThierryO commented 3 years ago

IMHO we shouldn't ignore the file. Ignoring a file implies doing no checks what so ever. And this is too liberal. Besides that, if the user replaces the hyphen with an underscore, then warning goes away.

hansvancalster commented 3 years ago

IMHO we shouldn't ignore the file. Ignoring a file implies doing no checks what so ever. And this is too liberal. Besides that, if the user replaces the hyphen with an underscore, then warning goes away.

In the previous version of the package (see NEWS) we avoided lintr checks in the .Rproj file because it returned a false positive due to clashing filenaming convention between checklist and the repository naming convention at INBO. See https://github.com/inbo/checklist/issues/43#issuecomment-842229418

So replacing the hyphen with an underscore is not a good solution in this case.

ThierryO commented 3 years ago

I'm affraid you misread the NEWS. check_lintr() no longer checks the content of the .Rproj. That was clearly a mistake.

hansvancalster commented 3 years ago

I'm affraid you misread the NEWS. check_lintr() no longer checks the content of the .Rproj. That was clearly a mistake.

I realized that (which is why I edited my original post).

But I see you do not want to allow a hyphen in the name of *.Rproj - even though that will often be the case for INBO repositories. The best solution - I think - is then to turn the warning into an allowed warning using checklist::write_checklist() and not to replace the hyphens by underscores. In the latter case, I am afraid that users may run into troubles / unexpected issues (https://github.com/rstudio/rstudio/issues/1909); maybe even have multiple Rproj files when using the guidelines to clone a repository (haven't tested) (one with hyphens created by Rstudio and the other with underscores as cloned from git after renaming?).

I will close this PR, but please re-open if you would like me to look for a different solution that does not ignore the .Rproj file, but does allow a hyphen in the .Rproj name.