Skip to content
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

Cleanup ignore files #150

Merged
merged 1 commit into from
Nov 27, 2023
Merged

Cleanup ignore files #150

merged 1 commit into from
Nov 27, 2023

Conversation

nanxstats
Copy link
Collaborator

This PR cleans up .gitignore and .Rbuildignore by removing the superfluous rules and reordering the lists.

@jdblischak
Copy link
Collaborator

Are you sure that doc and Meta are no longer sometimes created when regenerating the package documentation? I couldn't find anything about this in either the roxygen2 NEWS or the devtools NEWS. In fact, both roxygen2 and devtools list doc and Meta in both their .gitignore and .Rbuildignore files. These might just be stale, but I can't find any assurance that the problem of these directories has been resolved.

@nanxstats
Copy link
Collaborator Author

nanxstats commented Nov 27, 2023

Are you sure that doc and Meta are no longer sometimes created when regenerating the package documentation? I couldn't find anything about this in either the roxygen2 NEWS or the devtools NEWS. In fact, both roxygen2 and devtools list doc and Meta in both their .gitignore and .Rbuildignore files. These might just be stale, but I can't find any assurance that the problem of these directories has been resolved.

I'm not aware of a single case where these directories are created under the source package from my past experience, that's why I think these rules should be removed. I wonder if the original template author @elong0527 can provide a positive example. If not, we should remove them.

Apparently, Meta/ and doc/ are directories that appear in the binary package - see the R Packages book. I'd say it's highly unusual if they appear in the source package, and I'm curious what workflow could create them under the source package.

@nanxstats nanxstats merged commit b120502 into main Nov 27, 2023
7 checks passed
@nanxstats nanxstats deleted the ignore branch November 27, 2023 19:11
@jdblischak
Copy link
Collaborator

I'm not aware of a single case where these directories are created under the source package from my past experience, that's why I think these rules should be removed.

We can remove them. Worst-case scenario we add them back

I'd say it's highly unusual if they appear in the source package, and I'm curious what workflow could create them under the source package.

It used to happen to my packages all the time when using roxygen2/devtools/pkgdown to document and build the package. It may have been fixed (I wouldn't have noticed since I started ignoring them), but I couldn't find any documentation for this. There are 6k+ GitHub repos that include Meta and doc in their .Rbuildignore, so at least at one point it was a very common problem

https://github.com/search?q=path%3A.Rbuildignore%20Meta&type=code

@nanxstats
Copy link
Collaborator Author

Found it: devtools::build_vignettes() will create doc/ and Meta/ without cleaning up. I'm not sure if this is a popular tool, but I'm ok about adding them back. To be honest, I just click the Knit button and it just works...

@jdblischak
Copy link
Collaborator

Found it: devtools::build_vignettes() will create doc/ and Meta/ without cleaning up.

Thanks for finding it! I was frustrated that I couldn't find the source. I thought it was either devtools::document() or pkgdown::build_site(). But I do call devtools::build_vignettes() in my workflowr convenience script document.R, which explains why I manually delete Meta and doc

I'm not sure if this is a popular tool, but I'm ok about adding them back. To be honest, I just click the Knit button and it just works...

Let's not worry about it for now. If it becomes a nuisance in the future, we can add it back then

@jdblischak
Copy link
Collaborator

And since I was curious, I investigated why this hasn't been addressed. Deleting these empty directories was added to clean_vignettes() 2 years ago (source), so it still requires manually running clean_vignettes()

@nanxstats
Copy link
Collaborator Author

Wow, I guess if devtools has a designated output directory like R CMD check does (.Rcheck), things like this would be less of a problem...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants