CONTRIBUTING.md

Contributor Guidelines

:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:

The following is a set of guidelines for contributing to the R package hyperSpec.

Code Licensing

We are in the (slow) process of transitioning the license of the hyperspec project to MIT. By contributing, you understand and agree that your work becomes the part of the hyperSpec project and you grant permission to the hyperSpec project to license your contribution under the GNU GPL v3 or a compatible license and/or under the MIT license or a compatible license.

Reporting Bugs and Submitting Suggestions

Color Use (Vignettes & Perhaps Examples)

Code and Documentation Style Guide

Vignette Style and Standards

Working With Git

Branches

This project follows the git flow branching model.

Briefly

The branch master contains stable releases that are tested and guaranteed to work. It is not allowed to contribute directly to master.

The branch develop contains latest delivered development changes for the next release. When develop reaches a stable point and is ready to be released, it gets merged to master and tagged with a version number (e.g. 'v0.99.21'). This procedure is a subject for a strict review.

You should not directly contribute to develop, unless the change is trivial (e.g. a typo). Instead, for any new feature or bugfix, please create a separate supporting branch. We use a default naming convention for them:

It is recommended to use the git flow tool to streamline the process (see Cheatsheet for git flow). However, do not call git flow xxx finish as it makes a merge without the code review - instead, finish your branch by opening a pull request.

Please make sure that the package can be built and and that all checks and unit tests are passed before merging back into develop. The shortcut in RStudio for that is Ctrl+Shift+E.

If you are making a significant change, please also add an entry to NEWS.md.

Wait, What if I'm not Allowed to Create a Branch in the Main Repository?

If you are not a member of the project then you cannot create a branch in the main repository. But this is not a problem! In this case, you simply fork the main repository, make the changes starting off the develop branch, and merge it back into the develop branch of the main repository via a pull request.

After a successful code review the pull request gets accepted, and your changes are represented in the main repo as a separate branch (in accordance with our guidelines). After that you can delete your fork, if you'd like.

Pull Requests

Open a pull request via GitHub interface to let others see your work and review it. It is a collaborative tool, so we encourage you to open a 'draft pull request' as soon as you start working on your part. This provides a place for the community to discuss your work and correct it as you go. Once your part is completed, change the status to “Ready for review”.

The project maintainer may want to merge your pull request when your work is usable, even before it is 100% complete. In such a case, the branch must be deleted and a new one created off the develop branch. You can use the same name for it to indicate that this is a continuation. It will be merged, as usual, via a new pull request. This may seem to be an overhead at first glance, but it leads to a faster integration and makes the the pull requests smaller and less overwhelming.

The merged support branches should be deleted - they're clutter. If you want to keep their name for reference, just apply a git tag after the merge. Never reuse merged branches, it can lead to problems.

Git Commits

Commit often, try to make small atomic commits. An atomic commit addresses only a small separate fix or change and is more or less self-consistent. Every commit should be related to one feature only, but the commit should group strongly related changes together (e.g. when refactoring to rename a function, all files that are affected by this should be in the same commit).

Commit Messages

Versioning

The project adheres to the semantic versioning guidelines, as outlined at https://semver.org/ (Work in progress, see #123).

Briefly, the version string has the form x.y.z (or major.minor.patch), where the major number gets incremented if a release introduces breaking changes, the minor one after any changes in functionality (new features of bugfixes), and the patch number is increased after any trivial change. If a major or minor number is incremented, all subsequent ones are set to zero.

The version numbers refer only to commits in the master branch, and get incremented in one of two cases:

Release Process

The process starts when the package is in a stable state that can be released to CRAN (release candidate). First, decide on a new version number x.y.z based on the severity of changes. Then:

Thanks! :heart:



r-hyperspec/hyperSpec documentation built on May 31, 2024, 5:53 p.m.