2024-02-14 15:39:24 +08:00
# Contributing to Axmol Engine
2019-11-23 20:27:39 +08:00
2024-02-14 15:39:24 +08:00
## General considerations
2019-11-23 20:27:39 +08:00
2024-02-14 15:39:24 +08:00
### Providing correct and relevant information is key
2019-11-23 20:27:39 +08:00
2024-02-14 15:39:24 +08:00
When asking a question, reporting a bug, or submitting a patch, it is **very important** to write down clearly all the relevant information the reviewer may need. For a bug report, provide the steps to reproduce it; for a pull request, outline the changes made and the reasons behind them. This will assist the reviewers and make the process of improving Axmol smoother for everybody.
2019-11-23 20:27:39 +08:00
2024-02-14 15:39:24 +08:00
## For questions
Please revise our [FAQ ](https://github.com/axmolengine/axmol/wiki/FAQ ) and check the [GitHub Discussions ](https://github.com/axmolengine/axmol/discussions ), your question may have been already answered.
If that is not the case, you can ask general questions by using:
2019-11-23 20:27:39 +08:00
2022-10-01 16:24:52 +08:00
- Forum (preferred way): https://github.com/axmolengine/axmol/discussions
2019-11-23 20:27:39 +08:00
## Reporting bugs
2024-02-14 15:39:24 +08:00
To report bugs, please use the [Issue Tracker ](https://github.com/axmolengine/axmol/issues ).
2019-11-23 20:27:39 +08:00
Steps to report a bug:
2024-02-14 15:39:24 +08:00
* Open the [issues url ](https://github.com/axmolengine/axmol/issues/new )
2019-11-23 20:27:39 +08:00
* Add all the needed information to reproduce the bug, the information include
* engine version
* steps to reproduce the bug
* some pseudocode
* resources link if needed
## Submitting patches
If you want to contribute code, please follow these steps:
(If you are new to git and/or GitHub, you should read [Pro Git ](http://progit.org/book/ ) , especially the section on [Contributing to a project:Small/Large Public Project ](http://progit.org/book/ch5-2.html#public_small_project ) )
2024-09-11 08:31:08 +08:00
### Following steps must be done once in order to setup repository
- Fork axmol on github page to your own github account
- Clone your own fork:
```
$ git clone https://github.com/< your git accout > /axmol.git
```
- Add remote official from axmolengine/axmol:
2019-11-23 20:27:39 +08:00
```
2022-10-01 16:24:52 +08:00
$ cd axmol
2024-09-11 08:31:08 +08:00
$ git remote add official https://github.com/axmolengine/axmol.git
2019-11-23 20:27:39 +08:00
```
2024-09-11 08:31:08 +08:00
### Following steps must be done for every pull request
- Sync with official:
```
$ git fetch official
```
- Create a new branch on top of the latest dev from official:
```
$ git checkout -b < new_branch_name > official/dev
```
- Do local changes on your new branch. Do as much commits as you need and add short descriptive message to each commit:
```
$ git commit
```
- When all changes are finished push your new branch to your forked repository:
```
$ git push origin < new_branch_name >
```
2022-10-01 16:24:52 +08:00
- Send a “pull request” to user “axmol”
2019-11-23 20:27:39 +08:00
- It must be _complete_ . See the definition below
- It must follow the _Releases_ rules. See the definition below
## Only _complete_ patches will be merged
The patch must be _complete_ . And by that, we mean:
2024-02-13 09:30:21 +08:00
- For C++ code follow the [axmol C++ Coding Style ](docs/CODING_STYLE.md )
2024-02-12 23:53:03 +08:00
- For Python code follow the [PEP8 guidelines ](https://www.python.org/dev/peps/pep-0008 )
2019-11-23 20:27:39 +08:00
- Describe what the patch does
- Include test cases if applicable
- Include unit tests if applicable
- Must be tested in all supported platforms [*]
- Must NOT degrade the performance
- Must NOT break existing tests cases
- Must NOT break the Continuous Integration build
- Must NOT break backward compatibility
- Must compile WITHOUT warnings
- New APIs MUST be **easy to use** , **familiar** to cocos2d-x users
- Code MUST be **easy to extend** and **maintain**
- Must have documentation: C++ APIs must use Doxygen strings, tools must have a README.md file that describe how to use the tool
- Must be efficient (fast / low memory needs)
- It must not duplicate existing code, unless the new code deprecates the old one
- Patches that refactor key components will only be merged in the next major versions.
[*]: If you don't have access to test your code in all the supported platforms, let us know.
2024-02-14 15:39:24 +08:00
## About branch management
Please read [this announcement ](https://github.com/axmolengine/axmol/discussions/1271 ).