|
| 1 | +# PR |
| 2 | + |
| 3 | +- 请不要提交PR到各个组件仓库,它们都是 **只读的** |
| 4 | +- 核心组件的 **开发仓库** 是 **[swoft/swoft-component][core]** |
| 5 | +- 扩展组件的 **开发仓库** 是 **[swoft/swoft-ext][ext]** |
| 6 | +- 请 `fork` 对应的 **开发仓库**,修改后,请把你的PR提交到对应的开发仓库 |
| 7 | + |
| 8 | +> 发布版本时官方会将代码同步到各个子仓库。因此,切记不要往子仓库发PR。 |
| 9 | +
|
| 10 | +## 发起PR时的注意事项 |
| 11 | + |
| 12 | +开发组非常欢迎各位向我们提交PR(_Pull Request_),但是为了保证代码质量和统一的风格, |
| 13 | +向官方的主仓库 [swoft/swoft][main] 和 **开发仓库** 贡献代码时需要注意代码和commit格式 |
| 14 | + |
| 15 | +### Commit Message |
| 16 | + |
| 17 | +- commit message 只能是英文信息 |
| 18 | +- 请尽量保证commit message是有意义的说明 |
| 19 | +- 最好以 `add:` `update:` `fix:` 等关键字开头 |
| 20 | + |
| 21 | +### 代码风格 |
| 22 | + |
| 23 | +- 提交的PHP代码 **必须** 遵循 PSR-2 代码风格 |
| 24 | +- 合理且有意义的类、方法、变量命名 |
| 25 | +- 适当的注释,合理的使用空行保持代码的简洁,易于阅读 |
| 26 | +- 不要包含一些无意义的信息 例如 `@author` 等(_提交者是能够从commit log里看到的_) |
| 27 | + |
| 28 | +------------------ |
| 29 | + |
| 30 | +> English Version (_translate by Google_) |
| 31 | +
|
| 32 | +The development team welcomes you to submit PR (_Pull Request_) to us, but to ensure code quality and uniform style, |
| 33 | +go to the official main repository [swoft/swoft][main] and Development repository, Note the code and commit format when contributing code |
| 34 | + |
| 35 | +## Precautions when initiating PR |
| 36 | + |
| 37 | +- Please do not submit PR to each sub-repository, they are all read-only |
| 38 | +- The _development repository_ for the core components is **[swoft/swoft-component][core]** |
| 39 | +- The _development repository_ for extension components is **[swoft/swoft-ext][ext]** |
| 40 | +- Please `fork` the corresponding development warehouse. After modification, please submit your PR to the corresponding development warehouse. |
| 41 | + |
| 42 | +> Officially syncs code to individual sub-warehouses when new versions are released |
| 43 | +
|
| 44 | +### Commit Message |
| 45 | + |
| 46 | +- the commit message can only be in English |
| 47 | +- Please try to ensure that the commit message is meaningful |
| 48 | +- it is best to start with the keyword `add:` `update:` `fix:` |
| 49 | + |
| 50 | +### Code Style |
| 51 | + |
| 52 | +- Submitted PHP code **Must** Follow PSR-2 code style |
| 53 | +- Reasonable and meaningful class, method, variable naming |
| 54 | +- Appropriate comments, reasonable use of blank lines to keep the code simple and easy to read |
| 55 | +- Don't include some meaningless information such as `@author`, etc. (_author is that can be seen from the commit log_) |
| 56 | + |
| 57 | + |
| 58 | +[main]: https://github.com/swoft-cloud/swoft |
| 59 | +[core]: https://github.com/swoft-cloud/swoft-component |
| 60 | +[ext]: https://github.com/swoft-cloud/swoft-ext |
0 commit comments