同步操作将从 MindSpore/mindspore 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
It's required to sign CLA before your first code submission to MindSpore community.
For individual contributor, please refer to ICLA online document for the detailed information.
Please follow this style to make MindSpore easy to review, maintain and develop.
Coding guidelines
The Python coding style suggested by Python PEP 8 Coding Style and C++ coding style suggested by Google C++ Coding Guidelines are used in MindSpore community. The CppLint, CppCheck, CMakeLint, CodeSpell, Lizard, ShellCheck and PyLint are used to check the format of codes, installing these plugins in your IDE is recommended.
Unittest guidelines
The Python unittest style suggested by pytest and C++ unittest style suggested by Googletest Primer are used in MindSpore community. The design intent of a testcase should be reflected by its name of comment.
Refactoring guidelines
We encourage developers to refactor our code to eliminate the code smell. All codes should conform to needs to the coding style and testing style, and refactoring codes are no exception. Lizard threshold for nloc (lines of code without comments) is 100 and for cnc (cyclomatic complexity number) is 20, when you receive a Lizard warning, you have to refactor the code you want to merge.
Document guidelines
We use MarkdownLint to check the format of markdown documents. MindSpore CI modifies the following rules based on the default configuration.
For details, please refer to RULES.
Fork MindSpore repository
Before submitting code to MindSpore project, please make sure that this project have been forked to your own repository. It means that there will be parallel development between MindSpore repository and your own repository, so be careful to avoid the inconsistency between them.
Clone the remote repository
If you want to download the code to the local machine, git
is the best way:
# For GitHub
git clone https://github.com/{insert_your_forked_repo}/mindspore.git
git remote add upstream https://github.com/mindspore-ai/mindspore.git
# For Gitee
git clone https://gitee.com/{insert_your_forked_repo}/mindspore.git
git remote add upstream https://gitee.com/mindspore/mindspore.git
Develop code locally
To avoid inconsistency between multiple branches, checking out to a new branch is SUGGESTED
:
git checkout -b {new_branch_name} origin/master
Taking the master branch as an example, MindSpore may create version branches and downstream development branches as needed, please fix bugs upstream first. Then you can change the code arbitrarily.
Push the code to the remote repository
After updating the code, you should push the update in the formal way:
git add .
git status # Check the update status
git commit -m "Your commit title"
git commit -s --amend #Add the concrete description of your commit
git push origin {new_branch_name}
Pull a request to MindSpore repository
In the last step, your need to pull a compare request between your new branch and MindSpore master
branch. After finishing the pull request, the Jenkins CI will be automatically set up for building test. Your pull request should be merged into the upstream master branch as soon as possible to reduce the risk of merging.
A great way to contribute to the project is to send a detailed report when you encounter an issue. We always appreciate a well-written, thorough bug report, and will thank you for it!
When reporting issues, refer to this format:
Issues advisory:
PRs advisory:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。