|
| 1 | +# Contributing Guide |
| 2 | + |
| 3 | +For development setup, see [Development Guide](#development-guide) below. |
| 4 | + |
| 5 | +## Code |
| 6 | + |
| 7 | +Please review these details before committing, especially for AI-generated code. |
| 8 | + |
| 9 | +### General |
| 10 | + |
| 11 | +1. Keep changes minimal — do not add what is not necessary. |
| 12 | +2. Comments are not always better when abundant. Ideally, the code should be self-explanatory. |
| 13 | +3. Files must end with a newline. |
| 14 | +4. Use Markdown syntax (backtick-fenced) for identifiers in comments and error messages. |
| 15 | +5. Comments and error messages must be in English. |
| 16 | +6. Comments and error messages should follow the language's conventions first. If the language does not specify, use complete sentences — capitalize the first letter and end with punctuation. |
| 17 | + |
| 18 | +### C++ |
| 19 | + |
| 20 | +1. Unless specified in [Adapt New Models](MODELS.md), follow the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) strictly. Use the default `.clang-format`. |
| 21 | +2. Error and warning messages follow the [LLVM Coding Standards](https://llvm.org/docs/CodingStandards.html#error-and-warning-messages). |
| 22 | +3. Initializer list order must match member declaration order. |
| 23 | +4. Formatted by `scripts/format.py` |
| 24 | + |
| 25 | +### Python |
| 26 | + |
| 27 | +Unless specified in [Adapt New Models](MODELS.md), follow [PEP 8](https://peps.python.org/pep-0008/) as the primary style guide. For anything PEP 8 does not cover in detail, refer to the [GDScript style guide](https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_styleguide.html)—while it targets a different language, its non-syntax conventions are still applicable. |
| 28 | + |
| 29 | +Formatted by `scripts/format.py` |
| 30 | + |
| 31 | +#### Additional Rules |
| 32 | + |
| 33 | +1. **Comments** should be complete English sentences, starting with a capital letter and ending with punctuation. Use Markdown syntax when referencing code within comments. |
| 34 | + |
| 35 | +2. **Docstrings:** Follow [PEP 257](https://peps.python.org/pep-0257/) conventions. |
| 36 | + |
| 37 | +3. Formatted by `scripts/format.py` |
| 38 | + |
| 39 | +## Commits |
| 40 | + |
| 41 | +Commit messages must follow [Conventional Commits](https://www.conventionalcommits.org/). |
| 42 | + |
| 43 | +Existing commit messages may follow the "issue/### - " legacy format with an issue created to describe the case. |
| 44 | + |
| 45 | +## Pull Requests |
| 46 | + |
| 47 | +1. Small PRs should be squashed. Large PRs may keep multiple commits, but each commit must be meaningful and well-formed. |
| 48 | +2. PR titles should respect to issue number and case summary. |
| 49 | +3. Before merging (or after each stage of changes), build and test on major involved platforms. Include the results in PRs. |
| 50 | + |
| 51 | +## Branches |
| 52 | + |
| 53 | +Branch names use the format `<type>/xxx-yyyy-zzzz`, where `<type>` matches the PR title's Conventional Commits type, and words are joined with hyphens. |
| 54 | + |
| 55 | +Existing branch names may use the legacy format `issue/###`, followed by a suffix when necessary. |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +# Development Guide |
| 60 | + |
| 61 | +Refer to [ReadMe](README.md) and [Adapt New Models](MODELS.md) |
| 62 | + |
| 63 | +## Troubleshooting |
| 64 | + |
| 65 | +1. to be populated |
0 commit comments