Skip to content

How to contribute

Nicolas Casajus edited this page May 3, 2023 · 7 revisions

This page presents the good pratices to contribute to this R package.

Workflow

  • Fork this repository
  • Clone your fork (you can use RStudio if you want)
  • Create a new branch (optional)
  • Create a new function in the folder R/
  • Document your function by using the Roxygen syntax
  • Update the package documentation by running devtools::document()
  • Check the integrity of the package by running devtools::check()
  • Add some unit tests for your function in the tests/ folder (optional)
  • Test your function by running devtools::test()
  • Add a line in the section Overview in the README.Rmd
  • Render the README.Rmd by running rmarkdown::render("README.Rmd")
  • Push your changes to GitHub (on the fork repo)
  • Submit a Pull Request (on the original repo)
  • Wait for the review

Important: if you want to contribute again (after your PR has been accepted), you have to keep your fork (and your local copy) up-to-date with the upstream repo. On a terminal, run (just one time):

# Add a new remote ----
git remote add upstream git@github.com:frbcesab/rutils.git

Then, before making any local change, get the new commits from the upstream:

# Sync with the upstream (download commits from the upstream) ----
git fetch upstream
git merge upstream/main

Run the two previous lines regularly.

Finally, follow the previous workflow.

Convention

  • Use the previous workflow (known as the Forking workflow) to work
  • Use the lower_snake_case for naming your objects (variables and functions)
  • Try to use the conventional commits specification for your commit messages
Clone this wiki locally