2023-10-10 16:48:39 +08:00
# Contributors guidelines
This document summarizes the most important points for people interested in
contributing to Godot, especially via bug reports or pull requests.
The Godot documentation has a dedicated [Contributing section ](https://docs.godotengine.org/en/latest/contributing/ways_to_contribute.html )
which details these points and more, and is a recommended read.
2016-02-09 00:33:21 +08:00
2020-01-30 08:29:54 +08:00
## Table of contents
2017-01-11 21:27:12 +08:00
2020-01-30 08:29:54 +08:00
- [Reporting bugs ](#reporting-bugs )
- [Proposing features or improvements ](#proposing-features-or-improvements )
- [Contributing pull requests ](#contributing-pull-requests )
2023-10-10 16:48:39 +08:00
- [Contributing to Godot translations ](#contributing-to-godot-translations )
2020-01-30 08:29:54 +08:00
- [Communicating with developers ](#communicating-with-developers )
2017-01-11 21:27:12 +08:00
2020-01-30 08:29:54 +08:00
## Reporting bugs
2016-02-09 00:33:21 +08:00
2022-02-25 06:14:29 +08:00
Report bugs [here ](https://github.com/godotengine/godot/issues/new?assignees=&labels=&template=bug_report.yml ).
Please follow the instructions in the template when you do.
2020-01-30 08:29:54 +08:00
2023-10-10 16:48:39 +08:00
Notably, please include a Minimal Reproduction Project (MRP), which is a small
Godot project which reproduces the issue, with no unnecessary files included.
Be sure to not include the `.godot` folder in the archive to save space.
Make sure that the bug you are experiencing is reproducible in the latest Godot
releases. You can find an overview of all Godot releases [on the website ](https://godotengine.org/download/archive/ )
to confirm whether your current version is the latest one. It's worth testing
against both the latest stable release and the latest dev snapshot for the next
Godot release.
If you run into a bug which wasn't present in an earlier Godot version (what we
call a _regression_ ), please mention it and clarify which versions you tested
(both the one(s) working and the one(s) exhibiting the bug).
2020-01-30 08:29:54 +08:00
## Proposing features or improvements
2023-10-10 16:48:39 +08:00
**The main issue tracker is for bug reports and does not accept feature proposals.**
2020-01-30 08:29:54 +08:00
2023-10-10 16:48:39 +08:00
Instead, head to the [Godot Proposals repository ](https://github.com/godotengine/godot-proposals )
and follow the instructions in the README file and issue template.
2020-01-30 08:29:54 +08:00
2016-02-12 17:59:59 +08:00
## Contributing pull requests
2016-02-09 00:33:21 +08:00
2020-01-30 08:29:54 +08:00
If you want to add new engine features, please make sure that:
2016-02-09 00:33:21 +08:00
2020-01-30 08:29:54 +08:00
- This functionality is desired, which means that it solves a common use case
2018-11-20 21:27:24 +08:00
that several users will need in their real-life projects.
2020-01-30 08:29:54 +08:00
- You talked to other developers on how to implement it best. See also
[Proposing features or improvements ](#proposing-features-or-improvements ).
- Even if it doesn't get merged, your PR is useful for future work by another
2017-05-30 16:54:52 +08:00
developer.
2016-02-12 17:59:59 +08:00
2017-05-30 16:54:52 +08:00
Similar rules can be applied when contributing bug fixes - it's always best to
discuss the implementation in the bug report first if you are not 100% about
what would be the best fix.
2016-02-12 17:59:59 +08:00
2023-10-10 16:48:39 +08:00
You can refer to the [Pull request review process ](https://docs.godotengine.org/en/latest/contributing/workflow/pr_review_guidelines.html )
for insights into the intended lifecycle of pull requests. This should help you
ensure that your pull request fulfills the requirements.
2018-11-20 21:27:24 +08:00
2018-10-14 13:59:52 +08:00
In addition to the following tips, also take a look at the
2023-01-15 00:38:00 +08:00
[Engine development guide ](https://docs.godotengine.org/en/latest/contributing/development/index.html )
2018-10-14 13:59:52 +08:00
for an introduction to developing on Godot.
2023-01-15 00:38:00 +08:00
The [Contributing docs ](https://docs.godotengine.org/en/latest/contributing/ways_to_contribute.html )
also have important information on the [PR workflow ](https://docs.godotengine.org/en/latest/contributing/workflow/pr_workflow.html )
2023-10-10 16:48:39 +08:00
(with a helpful guide for Git usage), and our [Code style guidelines ](https://docs.godotengine.org/en/latest/contributing/development/code_style_guidelines.html )
which all contributions need to follow.
2020-09-30 21:57:34 +08:00
2023-10-10 16:48:39 +08:00
### Be mindful of your commits
2016-02-12 17:59:59 +08:00
2018-10-14 13:59:52 +08:00
Try to make simple PRs that handle one specific topic. Just like for reporting
issues, it's better to open 3 different PRs that each address a different issue
2023-10-10 16:48:39 +08:00
than one big PR with three commits. This makes it easier to review, approve, and
merge the changes independently.
2016-02-12 17:59:59 +08:00
2017-05-30 16:54:52 +08:00
When updating your fork with upstream changes, please use ``git pull --rebase``
to avoid creating "merge commits". Those commits unnecessarily pollute the git
history when coming from PRs.
2016-02-12 17:59:59 +08:00
2017-05-30 16:54:52 +08:00
Also try to make commits that bring the engine from one stable state to another
stable state, i.e. if your first commit has a bug that you fixed in the second
2023-10-10 16:48:39 +08:00
commit, try to merge them together before making your pull request. This
includes fixing build issues or typos, adding documentation, etc.
2016-02-09 00:33:21 +08:00
2023-01-15 00:38:00 +08:00
See our [PR workflow ](https://docs.godotengine.org/en/latest/contributing/workflow/pr_workflow.html )
2018-11-20 21:27:24 +08:00
documentation for tips on using Git, amending commits and rebasing branches.
2023-10-10 16:48:39 +08:00
This [Git style guide ](https://github.com/agis-/git-style-guide ) also has some
good practices to have in mind.
2020-01-30 08:29:54 +08:00
### Format your commit messages with readability in mind
2016-11-16 20:01:01 +08:00
2020-01-30 08:29:54 +08:00
The way you format your commit messages is quite important to ensure that the
commit history and changelog will be easy to read and understand. A Git commit
message is formatted as a short title (first line) and an extended description
2017-05-30 16:54:52 +08:00
(everything after the first line and an empty separation line).
2016-11-16 20:01:01 +08:00
2017-05-30 16:54:52 +08:00
The short title is the most important part, as it is what will appear in the
2023-10-10 16:48:39 +08:00
changelog or in the GitHub interface unless you click the "expand" button.
Try to keep that first line under 72 characters, but you can go slightly above
if necessary to keep the sentence clear.
It should be written in English, starting with a capital letter, and usually
with a verb in imperative form. A typical bugfix would start with "Fix", while
the addition of a new feature would start with "Add". A prefix can be added to
specify the engine area affected by the commit. Some examples:
- Add C# iOS support
- Show doc tooltips when hovering properties in the theme editor
- Fix GLES3 instanced rendering color and custom data defaults
- Core: Fix `Object::has_method()` for script static methods
If your commit fixes a reported issue, please include it in the _description_
2024-06-22 21:18:07 +08:00
of the PR (not in the title, or the commit message) using one of the
2023-10-10 16:48:39 +08:00
[GitHub closing keywords ](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue )
such as "Fixes #1234 ". This will cause the issue to be closed automatically if
2024-06-22 21:18:07 +08:00
the PR is merged. Adding it to the commit message is easier, but adds a lot of
unnecessary updates in the issue distracting from the thread.
2020-01-30 08:29:54 +08:00
Here's an example of a well-formatted commit message (note how the extended
2017-05-30 16:54:52 +08:00
description is also manually wrapped at 80 chars for readability):
2016-11-16 20:01:01 +08:00
2020-01-30 08:29:54 +08:00
```text
2016-11-16 20:08:28 +08:00
Prevent French fries carbonization by fixing heat regulation
2016-11-16 20:01:01 +08:00
When using the French fries frying module, Godot would not regulate the heat
and thus bring the oil bath to supercritical liquid conditions, thus causing
unwanted side effects in the physics engine.
By fixing the regulation system via an added binding to the internal feature,
this commit now ensures that Godot will not go past the ebullition temperature
2017-01-11 21:27:12 +08:00
of cooking oil under normal atmospheric conditions.
2016-11-16 20:01:01 +08:00
```
2020-01-30 08:29:54 +08:00
**Note:** When using the GitHub online editor or its drag-and-drop
feature, *please* edit the commit title to something meaningful. Commits named
"Update my_file.cpp" won't be accepted.
2016-11-16 20:01:01 +08:00
2023-10-10 16:48:39 +08:00
### Document your changes
If your pull request adds methods, properties or signals that are exposed to
scripting APIs, you **must** update the class reference to document those.
This is to ensure the documentation coverage doesn't decrease as contributions
are merged.
[Update documentation XML files ](https://docs.godotengine.org/en/latest/contributing/documentation/updating_the_class_reference.html )
using your compiled binary, then fill in the descriptions.
Follow the style guide described in the
[Documentation writing guidelines ](https://docs.godotengine.org/en/latest/contributing/documentation/docs_writing_guidelines.html ).
If your pull request modifies parts of the code in a non-obvious way, make sure
to add comments in the code as well. This helps other people understand the
change without having to dive into the Git history.
### Write unit tests
When fixing a bug or contributing a new feature, we recommend including unit
tests in the same commit as the rest of the pull request. Unit tests are pieces
of code that compare the output to a predetermined *expected result* to detect
regressions. Tests are compiled and run on GitHub Actions for every commit and
pull request.
Pull requests that include tests are more likely to be merged, since we can have
greater confidence in them not being the target of regressions in the future.
For bugs, the unit tests should cover the functionality that was previously
broken. If done well, this ensures regressions won't appear in the future
again. For new features, the unit tests should cover the newly added
functionality, testing both the "success" and "expected failure" cases if
applicable.
Feel free to contribute standalone pull requests to add new tests or improve
existing tests as well.
See [Unit testing ](https://docs.godotengine.org/en/latest/contributing/development/core_and_modules/unit_testing.html )
for information on writing tests in Godot's C++ codebase.
## Contributing to Godot translations
2017-05-30 16:54:52 +08:00
2023-10-10 16:48:39 +08:00
You can contribute to Godot translations on [Hosted Weblate ](https://hosted.weblate.org/projects/godot-engine/ ),
an open source and web-based translation platform.
2017-01-11 21:27:12 +08:00
2023-10-10 16:48:39 +08:00
Please refer to our [editor and documentation localization guidelines ](https://docs.godotengine.org/en/latest/contributing/documentation/editor_and_docs_localization.html )
for an overview of the translation resources and what they correspond to.
2018-11-20 21:27:24 +08:00
2017-05-30 16:54:52 +08:00
## Communicating with developers
2017-01-11 21:27:12 +08:00
2017-05-30 16:54:52 +08:00
The Godot Engine community has [many communication
channels](https://godotengine.org/community), some used more for user-level
discussions and support, others more for development discussions.
To communicate with developers (e.g. to discuss a feature you want to implement
or a bug you want to fix), the following channels can be used:
2020-01-30 08:29:54 +08:00
2021-03-05 17:37:06 +08:00
- [Godot Contributors Chat ](https://chat.godotengine.org ): You will
find most core developers there, so it's the go-to platform for direct chat
2023-10-10 16:48:39 +08:00
about Godot Engine development. Browse the [Directory ](https://chat.godotengine.org/directory/channels )
for an overview of public channels focusing on various engine areas which you
might be interested in.
2021-03-05 17:37:06 +08:00
- [Bug tracker ](https://github.com/godotengine/godot/issues ): If there is an
2023-10-10 16:48:39 +08:00
existing issue about a topic you want to discuss, you can participate directly.
If not, you can open a new issue. Please mind the guidelines outlined above
for bug reporting.
2021-03-05 17:37:06 +08:00
- [Feature proposals ](https://github.com/godotengine/godot-proposals/issues ):
To propose a new feature, we have a dedicated issue tracker for that. Don't
hesitate to start by talking about your idea on the Godot Contributors Chat
to make sure that it makes sense in Godot's context.
2017-01-11 21:27:12 +08:00
2020-01-30 08:29:54 +08:00
Thanks for your interest in contributing!
2016-02-09 00:33:21 +08:00
2020-01-30 08:29:54 +08:00
—The Godot development team