Get Started
Welcome! We are glad that you want to contribute to our project! π
This project accepts contributions via GitHub Pull Requests.
This document outlines the process to help get your contribution accepted.
There are many ways to contribute:
You can start by looking through the GitHub Issues filtered by labels.
We follow some contributor guidelines that you will find in our contributor guidelines.
Don't worry if your contribution does not follow all the guidelines. We will guide you in the code review process. The threshold for contributing is low, and we appreciate any contribution great or small. π
Prerequisitesβ
- See Documentation guide for how to get started with contributions to this documentation.
How to contributeβ
Contribution is done in 3 simple steps:
Initiate changeβ
For major changes, please open an issue first to discuss what you would like to change. For smaller changes, it is sufficient to explain the change without referring to an issue.
Make a Pull Requestβ
To contribute to the project, you will have to make the change and create a Pull Request on GitHub. How you do this depends on your role.
- Equinor internal contributors, you may open a Pull Request directly,
- Independent contributors, you will Fork the repository.
Get code reviewβ
Once a Pull Request has been made, we will give you feedback and maybe suggest changes.
The core team looks at pull requests on a regular basis, we review the code and guide you if needed. Here you will find more information about the GitHub Code Review Process
Guidelinesβ
- For major changes, please open an issue first to discuss what you would like to change
- Work on your own fork of the main repo
- Use a separate branch for each issue youβre working on
- Use conventional commit. See our Git commit format for details, and our Git guide for our full guide
- Please include unit tests with all your code changes
- We follow Trunk Based Development style of working with short-lived feature branches.
Pull Requestsβ
Please try to make your Pull Requests easy to review for us.
- Make small pull requests. The smaller, the faster to review and the more likely it will be merged soon.
- Don't make changes unrelated to the goals of your PR.
While you're writing up the pull request, you can add closes #<issue number>
in the message body where issue number
is the issue you're fixing. Therefore, an example would be closes #42
would close issue #42.
Git commit formatβ
Git commits are required to follow conventional commits. Please see our Conventional Commit Guide for examples.
Readabilityβ
We use the pre-commit hooks in order to ensure uniform formatting and to exclude potential code issues.
We strive for readable code. A few good tips are:
- Self-documenting code with self-explaining variable names
- Composition over inheritance
- Functional code over Object-Oriented Code
- Rugged code to write more robust code
- Domain Driven Design to to match the code with the domain we are working on
Code styleβ
Except for the pre-commits hooks mentioned above, we also strive to follow the following code style:
- Use capital letters for constants i.e. SECONDS_PER_HOUR
- Try to split methods/modules/classes into smaller bits of code
- Remove, do not comment out, unused code
- Use types and type hinting
- We comment the code when it is not self-explanatory
- Be consistent with existing code style - try to make it look like the code is written by one developer
- For Python, we follow PEP 8 β Style Guide for Python Code and PEP 20 - The Zen of Python:
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
Please reach out to us if you have any questions. π
Thank you for your contribution! π