Skip to content

Update R.gitignore #4672

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

promicrobial
Copy link

@promicrobial promicrobial commented Jun 17, 2025

Reasons for making this change

I've noticed that the current version has not taken the use of Quarto or renv ignore rules into consideration. The file is also missing the RStudio project file .Rbuildignore.

Both Quarto and renv create cache and/or library directories that should not be checked in to git.

Links to documentation supporting these rule changes

If enabled, Quarto creates a _freeze directory that stores computations to reduce the need to re-compute code. Users may or may not want to add this to their .gitignore files depending on if you need others to reproduce your computational environment (source).

  • Quarto should automatically add .local to your .gitignore to ensure that .local files are not committed (source), but to be better safe than sorry I have added a pattern for this.
  • Output directories can be ignored (source).
  • renv and .renvignore but not renv/activate.R (source)
  • .Rbuildignore is missing from the RStudio patterns

Merge and Approval Steps

  • Confirm that you've read the contribution guidelines and ensured your PR aligns
  • Ensure CI is passing
  • Get a review and Approval from one of the maintainers

Added patterns for tools commonly used in the R ecosystem (renv, Quarto).
Made _freeze directory exclusion optional
@promicrobial promicrobial requested a review from a team as a code owner June 17, 2025 00:05
@promicrobial promicrobial changed the title Update r.gitignore Update R.gitignore Jun 17, 2025
@wirecat
Copy link
Collaborator

wirecat commented Jun 20, 2025

@promicrobial Everything but .Rbuildignore makes sense and docs help a lot with the review, thank you!

For .Rbuildignore it's listed as a project setting file and when I look into it, I can't tell whether it should be ignored or not 🤔. I do see people ignoring it a bit on GitHub though. Is this maybe a situation where it should be commented out with a comment explaining why some people may want to ignore the file?

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

Successfully merging this pull request may close these issues.

2 participants