Thank you for contributing to Ore! Please have a read through this document and make sure you understand it all before contributing.
If you'd like to write code for us, great, welcome aboard! We have a few things that you should be aware of.
Use of feature gates is an important part of ore library.
For the matter of consistency, and because we use a changelog generator that needs a particular style, we require the commit message to be in the following format:
%type%(%scope%): %header%
%optional description%
%closes%
%optional signing%
Valid type
s are:
feat
: Featuresfix
: Bug fixesdocs
: Documentationstyle
: Code style fixesrefactor
: Code refactorsperf
: Performance enhancementstest
: Testschore
:TODO
srevert
: revert previous commits
We follow Rust formatting and naming conventions. You can install rustfmt
and
run cargo fmt
to help with formatting. Some things to note:
-
Line endings
- Use Unix line endings when committing (\n).
- Windows users of git can do
git config --global core.autocrlf true
to let git convert them automatically.
-
Column width
- 100 characters
- Feel free to wrap when it will help with readability
-
Indentation
- Use 4 spaces for indentations, do not use tabs.
-
Deprecation
- Do not deprecate content unless you have a replacement, or if the provided feature is removed.
- Be prepared to provide justification for the deprecation.
- When deprecating, provide the month and year when it was deprecated.
Note that this style guide is not a hard and fast requirement, but please keep your code style sane and similar to ours.
In your PRs, please make sure you fulfill the following:
- Provide a justification for the change - is it a new feature or a fix to a bug?
- Before sending a pull request ensure that your branch is up to date with the branch you are targeting.
- Do not squash commits unless directed to do so, but please rebase your changes on top of master when you feel your changes are ready to be submitted - Do not merge. We will squash the commits in a way we feel logical.