When participating in open source projects, submit code What is the process?


table of Contents

1, submit the code

2, the Pull the Request merge code

3, code specification


Github is commonly used code hosting platform, to enhance the efficiency of teamwork , functional development, code merger, the test publisher, branches and tags with the use of clear and efficient.


Common open source development project, submit the merger process is as follows:

image.png

First, the development and testing, submit code

In the actual development work, the code needs to be submitted and issue associate, convenient code inspection and functional testing. Github provides automatic correlation, need only contain the issue number in the comment when commit submit code, # issue_id:

image.png

Two, the Pull the Request merge code

Pull Request is submitted consolidation process used code symbols , the process is as follows:


1.  Create a Pull Request

1)  After submission of the code, click on the page New pull request button

image.png

2)  Select the combined branch and code

image.png

3)  Click the button Create pull request, enter descriptive information necessary


2.  Merge PR or fight back

Administrators received after PR, according to case:

1)  merge code, if there is a conflict, need to be resolved before the merger.

2)  If you have questions, you can turn off without any treatment, and then notify the developer to fix the problem. 

image.png

Third, the code specification

What kind of code is good code? There are general rules, there are also detailed specification.

1, general rules

Achieve functional, robust, simple, easy to read, easy to maintain.

2, detailed rules

A matter of opinion, referring to some of the industry's common rules.

1)  "Ali Java Development Manual" https://yq.aliyun.com/articles/69327

2)  "Huawei Python code Specification" https://bbs.huaweicloud.com/blogs/136797

3)  " Google code specifications" http://google.github.io/styleguide/


3, a negative

"Junk Code 19 rule" https://developer.51cto.com/art/202002/611456.htm


Guess you like

Origin blog.51cto.com/13851865/2476496