hub/CONTRIBUTING.md

91 lines
4.3 KiB
Markdown
Raw Normal View History

2020-06-08 10:30:52 -04:00
# Contributing guidelines
## Push Request Checklist
2020-06-08 10:30:52 -04:00
Before sending your pull requests, make sure you followed this list.
- Read [contributing guidelines](CONTRIBUTING.md).
- Read [Code of Conduct](CODE_OF_CONDUCT.md).
- Check if my changes are consistent with the [guidelines](CONTRIBUTING.md#user-content-general-guidelines-and-philosophy-for-contribution).
- Changes are consistent with the [Coding Style](CONTRIBUTING.md#user-content-coding-style).
- Manually test your code and add [Unit Tests](CONTRIBUTING.md#user-content-testing-best-practices).
- [Document your work](CONTRIBUTING.md#user-content-documentation).
2020-06-08 10:30:52 -04:00
## How to become a contributor and submit your own code
### Contributor License Agreements
CERC Libs is released under [LGPL license](LICENSE.md) so even if we'd love to accept your patches, Before we can take them, please be sure that you are the intelectual property owner of your code and that do you fully understand and respect our software license.
2020-06-08 10:30:52 -04:00
***NOTE***: Only original source code from you can be accepted into the main repository.
2020-06-08 10:30:52 -04:00
### Contributing code
2020-06-08 10:30:52 -04:00
If you have improvements to CERC Libs, or you want to extend the functionality, please send us your pull request as seen at [git pull request documentation](https://git-scm.com/docs/git-request-pull)
2020-06-08 10:30:52 -04:00
Once the pull requests are approved and pass continuous integration checks, a team member will apply `ready to pull` label to your change and your pull request will be merged on CERC Libs and become an integral part of Insel4D platform.
2020-06-08 10:30:52 -04:00
If you prefer to contribute, instead to add a new functionality you can also take a look into our ticket system and try to fix any of the listed issues.
2020-06-08 10:30:52 -04:00
### Contribution guidelines and standards
Before sending your pull request for review,
2020-06-08 10:30:52 -04:00
make sure your changes are consistent with the guidelines and follow the
CERC Libs coding style.
2020-06-08 10:30:52 -04:00
#### General guidelines and philosophy for contribution
* Include unit tests when you contribute new features, as they help to a)
prove that your code works correctly, and b) guard against future breaking
changes to lower the maintenance cost.
* Bug fixes also generally require unit tests, because the presence of bugs
usually indicates insufficient test coverage.
* Keep backward compatibility in mind when you change code in CERC Libs and
if you need to broke the backward compatibility please ensure that you:.
..* Clearly indicate which features are affected by your changes.
..* Technical reasons for the changes.
2020-06-08 10:30:52 -04:00
* Tests should follow the
[testing best practices](CONTRIBUTING.md#testing_best_practices)
2020-06-08 10:30:52 -04:00
guide.
* [Document your contribution](CONTRIBUTING.md#documentation)
2020-06-08 10:30:52 -04:00
#### License
At the top of any new file a small header with author contact information and the license information should be included.
2020-06-08 10:30:52 -04:00
"""
Name module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author name mail@concordia.ca
"""
#### Coding style
2020-06-08 10:30:52 -04:00
Changes to CERC Libs python code should conform to our coding style
[Cerc Python Style Guide](PYGUIDE.md)
2020-06-08 10:30:52 -04:00
But as a general basis all contributions need to be focus in the concept of code clarity and use `pylint` to check your Python changes.
To install `pylint` and check a file
with `pylint` against Cerc custom style definition:
2020-06-08 10:30:52 -04:00
```bash
pip install pylint
pylint --rcfile=pylintrc myfile.py
2020-06-08 10:30:52 -04:00
```
<a name="testing_best_practices"></a>
#### Testing best practices
2020-06-08 10:30:52 -04:00
Prior to any pull request is expected that the code is both, manualy and automatically tested, to ensure at least some quality minimum, there are a few practices for unittest that we believe are important, so we encorage you to follow it.
2020-06-08 10:30:52 -04:00
* Test should be self contained, that implies that test preparation and cleaning up is performed at the before and after the test execution.
* We encorage you to create if possible functional tests that cover the complete workflow of the implemented functionality
* Maximize your code coverage by ensure that you are testing as much of your code as possible.
2020-06-08 10:30:52 -04:00
#### Documentation
2020-06-08 10:30:52 -04:00
In case of new functionality a general overview, configuration, instalation and usage manuals need to be provided by the developer, this will not only provide a nice starting point for all the future users but help you to detect any inconsistences in your design.