Skip to content

Guide to contributing code

Xiaoying Pu edited this page Dec 13, 2019 · 4 revisions

Git how-to

  • Learn about pull, push, add, commit, etc
    • If merge conflict, the editor that pops up is vim <3
    • So learn vim as well; the built-in tutorial takes 30 min
  • Learn how branches work in git Git - Basic Branching and Merging

Workflow

  • Create an issue if there’s a question/bug (can directly create from code, too). Or pick an issue to work on (assign yourself to it) 28055A40-D115-4B03-9D3D-81004AE0DEA8
  • Fetch & merge from the master branch every time before you start working on your branch
  • Don’t forget to write tests for new code and write documentation.
  • When you’re done, commit and push to the remote.
    • Write issue number so that the issue closes, like “changes for issue #41”
  • Check
  • If you completed an issue on GitHub, submit a pull request, so that the changes get to be merged to the master branch
    • Informative pull request title/message: add issue number, like #14
    • Xiaoying will merge those pull requests at the weekly meeting

0FFC5FD2-B8AC-4D9C-A81A-21FFDA04CADB

Working on a package

  • The basics: Writing an R package from scratch
  • It’s important to reload the package every time you make changes to the packages source code, so reload with Ctrl/Cmd + Shift + L or devtools::load_all()
  • To fix some dependency complaints and to update documentation to the NAMESPACE file, do devtools::document()

Writing unit tests

How ggplot custom geoms works

Clone this wiki locally