You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

CONTRIBUTING.md 5.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # MindSpore contributing guidelines
  2. <!-- TOC -->
  3. - [MindSpore contributing guidelines](#mindspore-contributing-guidelines)
  4. - [Contributor License Agreement](#contributor-license-agreement)
  5. - [Getting Started](#getting-started)
  6. - [Contribution workflow](#contribution-workflow)
  7. - [Code style](#code-style)
  8. - [Fork-Pull development model](#fork-pull-development-model)
  9. - [Report issues](#report-issues)
  10. - [Propose PRs](#propose-prs)
  11. <!-- /TOC -->
  12. ## Contributor License Agreement
  13. It's required to sign CLA before your first code submission to MindSpore community.
  14. For individual contributor, please refer to [ICLA online document](https://www.mindspore.cn/icla) for the detailed information.
  15. ## Getting Started
  16. - Fork the repository on [Github](https://github.com/mindspore-ai/mindspore) or [Gitee](https://gitee.com/mindspore/mindspore).
  17. - Read the [README.md](README.md) and [install page](https://www.mindspore.cn/install/en) for project information and build instructions.
  18. ## Contribution Workflow
  19. ### Code style
  20. Please follow this style to make MindSpore easy to review, maintain and develop.
  21. * Coding guidelines
  22. The *Python* coding style suggested by [Python PEP 8 Coding Style](https://pep8.org/) and *C++* coding style suggested by [Google C++ Coding Guidelines](http://google.github.io/styleguide/cppguide.html) are used in MindSpore community.
  23. * Unittest guidelines
  24. The *Python* unittest style suggested by [pytest](http://www.pytest.org/en/latest/) and *C++* unittest style suggested by [Googletest Primer](https://github.com/google/googletest/blob/master/googletest/docs/primer.md) are used in MindSpore community.
  25. ### Fork-Pull development model
  26. * Fork MindSpore repository
  27. 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.
  28. * Clone the remote repository
  29. If you want to download the code to the local machine, `git` is the best way:
  30. ```shell
  31. # For GitHub
  32. git clone https://github.com/{insert_your_forked_repo}/mindspore.git
  33. git remote add upstream https://github.com/mindspore-ai/mindspore.git
  34. # For Gitee
  35. git clone https://gitee.com/{insert_your_forked_repo}/mindspore.git
  36. git remote add upstream https://gitee.com/mindspore/mindspore.git
  37. ```
  38. * Develop code locally
  39. To avoid inconsistency between multiple branches, checking out to a new branch is `SUGGESTED`:
  40. ```shell
  41. git checkout -b {new_branch_name} origin/master
  42. ```
  43. Then you can change the code arbitrarily.
  44. * Push the code to the remote repository
  45. After updating the code, you should push the update in the formal way:
  46. ```shell
  47. git add .
  48. git status # Check the update status
  49. git commit -m "Your commit title"
  50. git commit -s --amend #Add the concrete description of your commit
  51. git push origin {new_branch_name}
  52. ```
  53. * Pull a request to MindSpore repository
  54. 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.
  55. ### Report issues
  56. 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!
  57. When reporting issues, refer to this format:
  58. - What version of env (mindspore, os, python etc) are you using?
  59. - Is this a BUG REPORT or FEATURE REQUEST?
  60. - What happened?
  61. - What you expected to happen?
  62. - How to reproduce it?(as minimally and precisely as possible)
  63. - Special notes for your reviewers?
  64. **Issues advisory:**
  65. - **If you find an unclosed issue, which is exactly what you are going to solve,** please put some comments on that issue to tell others you would be in charge of it.
  66. - **If an issue is opened for a while,** it's recommended for contributors to precheck before working on solving that issue.
  67. - **If you resolve an issue which is reported by yourself,** it's also required to let others know before closing that issue.
  68. ### Propose PRs
  69. * Raise your idea as an *issue* on [GitHub](https://github.com/mindspore-ai/mindspore/issues) or [Gitee](https://gitee.com/mindspore/mindspore/issues)
  70. * If it is a new feature that needs lots of design details, a design proposal should also be submitted.
  71. * After reaching consensus in the issue discussions and design proposal reviews, complete the development on the forked repo and submit a PR.
  72. * None of PRs is not permitted until it receives **2+ LGTM** from approvers. Please NOTICE that approver is NOT allowed to add *LGTM* on his own PR.
  73. * After PR is sufficiently discussed, it will get merged, abandoned or rejected depending on the outcome of the discussion.
  74. **PRs advisory:**
  75. - Any irrelevant changes should be avoided.
  76. - Make sure your commit history being ordered.
  77. - Always keep your branch up with the master branch.
  78. - For bug-fix PRs, make sure all related issues being linked.