This document contains guidelines for the collaboration in the flexpolyline R package.
Ready to contribute? Here's how to set up flexpolyline for local development.
- Fork the repository to your GitHub account and clone the forked repository locally.
- Install the dependencies (check the
DESCRIPTION
file). - Create a feature or bugfix branch as appropriate:
git checkout -b feature/<feature-description> master
orgit checkout -b bugfix/<bugfix-description> master
- Work locally on the feature, make sure to add or adjust:
- entries in
NEWS.md
- function documentation (run
devtools::document()
before commit) - tests for the feature
- vignettes
- entries in
- Push changes to the new branch.
- If CI tests are passing, create a pull request on GitHub of your
feature/...
orbugfix/...
branch into themaster
branch of the original repository.
The trunk-based development workflow uses one branch master
to record the history of the project. In addition to the mainline short-lived feature or bugfix branches are used to develop new features or fix bugs.
Each new feature should reside in its own short-lived branch. Branch off of a feature/<feature-description>
branch from master
. When a feature is complete, it gets merged back into master
and the feature branch is deleted.
Each bugfix should reside in its own short-lived branch. Branch off of a bugfix/<bugfix-description>
branch from master
. When the fix is complete, it gets merged back into master
and the bugfix branch is deleted.
This packages uses semantic versions. Once master
has aquired enough features for a release, set the new version number in the DESCRIPTION
and NEWS.md
files and submit the package to CRAN. When CRAN has accepted the package submission, the master
branch is tagged with the version number, which triggers the build of the documentation site using pkgdown
.
Use snake_case
for variable, argument and function name definitions and avoid capital letters.
Dots (.
) in function definitions are reserved for the functions and method dispatch in the S3 object system (e.g. print.my_class
) or as prefix to hide functions (e.g. .my_hidden_function
).
This packages uses roxygen2 for the package documentation.
Example:
#' Add together two numbers
#'
#' @param x A number
#' @param y A number
#' @return The sum of \code{x} and \code{y}
#' @examples
#' add(1, 1)
#' add(10, 1)
add <- function(x, y) {
x + y
}
Add a header to CLI scripts according to the following template:
#!/usr/bin/env Rscript
# -----------------------------------------------------------------------------
# Name :example_script.R
# Description :Short description of the scripts purpose.
# Author :Name <your@email.ch>
# Date :YYYY-MM-DD
# Version :0.1.0
# Usage :./example_script.R
# Notes :Is there something important to consider when executing the
# script?
# =============================================================================
Add your GitHub username to the bugfix or feature entry in the NEWS.md
to ensure credits are given correctly:
# version x.x.x.9000
* Added <feature description> (@<github_username>, [#1](https://github.com/munterfi/flexpolyline/pull/1)).
* Bugfix: <description> (@<github_username>, closes [#2](https://github.com/munterfi/flexpolyline/issues/2)).
Please note that this project is released with a Contributor Code of Conduct. By contributing to this project you agree to abide by its terms.