2015-10-04 10:22:24 +08:00
|
|
|
# Contributing to Mainflux
|
|
|
|
|
2017-09-23 19:43:23 +08:00
|
|
|
The following is a set of guidelines for contributing to Mainflux and its libraries, which are
|
2018-03-23 06:53:43 +08:00
|
|
|
hosted in the [Mainflux Organization](https://github.com/mainflux) on GitHub.
|
2015-10-04 10:22:24 +08:00
|
|
|
|
|
|
|
This project adheres to the [Contributor Covenant 1.2](http://contributor-covenant.org/version/1/2/0).
|
2017-09-23 19:43:23 +08:00
|
|
|
By participating, you are expected to uphold this code. Please report unacceptable behavior to
|
|
|
|
[abuse@mainflux.com](mailto:abuse@mainflux.com).
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2017-09-23 19:43:23 +08:00
|
|
|
## Reporting issues
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2017-09-23 19:43:23 +08:00
|
|
|
Reporting issues is a great way to contribute to the project. We always appreciate a well-written,
|
2018-03-23 06:53:43 +08:00
|
|
|
thorough bug reports.
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2017-09-23 19:43:23 +08:00
|
|
|
Prior to raising a new issue, check out [our issue
|
|
|
|
list](https://github.com/mainflux/mainflux/issues) to determine whether it already include the
|
|
|
|
problem you are facing.
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2017-09-23 19:43:23 +08:00
|
|
|
A good bug report shouldn't leave others needing to chase you up for more information. Please try to
|
|
|
|
be as detailed as possible. The following questions might serve as a template for writing a detailed
|
|
|
|
reports:
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2017-09-23 19:43:23 +08:00
|
|
|
- What were you trying to achieve?
|
|
|
|
- What are the expected results?
|
|
|
|
- What are the received results?
|
|
|
|
- What are the steps to reproduce the issue?
|
|
|
|
- In what environment did you encounter the issue?
|
2015-10-04 10:22:24 +08:00
|
|
|
|
|
|
|
## Pull requests
|
|
|
|
|
2017-09-23 19:43:23 +08:00
|
|
|
Good pull requests (e.g. patches, improvements, new features) are a fantastic help. They should
|
|
|
|
remain focused in scope and avoid containing unrelated commits.
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2017-09-23 19:43:23 +08:00
|
|
|
**Please ask first** before embarking any significant pull request (e.g. implementing new features,
|
|
|
|
refactoring code etc.), otherwise you risk spending a lot of time working on something that the
|
|
|
|
maintainers might not want to merge into the project.
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2017-09-23 19:43:23 +08:00
|
|
|
Please adhere to the coding conventions used throughout the project. If in doubt, consult the
|
2018-03-23 06:53:43 +08:00
|
|
|
[Effective Go](https://golang.org/doc/effective_go.html) style guide.
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
To start contributing to the project, [fork](https://help.github.com/articles/fork-a-repo/) it,
|
|
|
|
clone your fork repository, and configure the remotes:
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
```
|
|
|
|
git clone https://github.com/<your-username>/mainflux.git
|
|
|
|
cd mainflux
|
|
|
|
git remote add upstream https://github.com/mainflux/mainflux.git
|
|
|
|
```
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
If you cloned a while ago, get the latest changes from upstream:
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
```
|
|
|
|
git checkout master
|
|
|
|
git pull --rebase upstream master
|
|
|
|
```
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
Create a new topic branch from `master` using the naming convention `MF-[issue-number]`
|
|
|
|
to help us keep track of your contribution scope:
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
```
|
|
|
|
git checkout -b MF-[issue-number]
|
|
|
|
```
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
Commit your changes in logical chunks. When you are ready to commit, make sure
|
|
|
|
to write a Good Commit Message™. Consult the [Erlang's contributing guide](https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
|
|
|
|
if you're not sure what constitutes a Good Commit Message™. Use [interactive rebase](https://help.github.com/articles/about-git-rebase)
|
|
|
|
to group your commits into logical units of working before making them public.
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
Note that every commit you make must be signed. By signing off your work you indicate that you
|
|
|
|
are accepting the [Developer Certificate of Origin](https://developercertificate.org/).
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
Use your real name (sorry, no pseudonyms or anonymous contributions). If you set your `user.name`
|
|
|
|
and `user.email` git configs, you can sign your commit automatically with `git commit -s`.
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
Locally merge (or rebase) the upstream development branch into your topic branch:
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
```
|
|
|
|
git pull --rebase upstream master
|
|
|
|
```
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
Push your topic branch up to your fork:
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
```
|
|
|
|
git push origin MF-[issue-number]
|
|
|
|
```
|
2015-10-04 10:22:24 +08:00
|
|
|
|
2018-04-09 05:03:12 +08:00
|
|
|
[Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title
|
|
|
|
and detailed description.
|