User Tools

Site Tools


developer:contribution_guidelines

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
developer:contribution_guidelines [2015/03/01 13:33]
Juan Osorio Robles
developer:contribution_guidelines [2016/02/05 20:43] (current)
Christopher Price
Line 15: Line 15:
   * Provide a detailed description of the change in the following lines. Use breaking paragraphs where needed.   * Provide a detailed description of the change in the following lines. Use breaking paragraphs where needed.
   * The first line should be limited to 50 characters; should be written in present tense; and should not end with a period.   * The first line should be limited to 50 characters; should be written in present tense; and should not end with a period.
-  * Subsequent lines should be wrapped at 70 characters.+  * Subsequent lines should be wrapped at 72 characters
 + 
 +=== Commit message content === 
 + 
 +The commit message must contain all the information required to fully understand & review the patch for correctness. Less is not more. More is more. 
 + 
 +=== Please submit small commits === 
 + 
 +Ensure there is only one "​logical change"​ per commit. There are many reasons why this is an important rule: 
 + 
 +  * The lesat amount of code being changed, the quicker and easier it is to review and identify potential flaws. 
 +  * If a change is found to be flawed later, it may be necessary to revert the broken commit. This is much easier to do if there are not other unrelated code changes entangled with the original commit. 
 +  * When troubleshooting problems using Git's bisect capability; small well-defined changes will aid in isolating exactly where the code problem was introduced. 
 +  * When browsing history using Git's annotate/​blame,​ small well defined changes also aid in isolating exactly where a piece of code came from and why.
  
 === General Code headers === === General Code headers ===
  
-Headers must be applied to all contributed code.  These should provide a copyright notice identifying the individual, and company where affiliated, of origin for the contribution and the licence ​under which the contribution was made.  In OPNFV we use the Apache 2.0 license, some templates for code headers follow. ​+Headers must be applied to all contributed code.  These should provide a copyright notice identifying the individual, and company where affiliated, of origin for the contribution and the license ​under which the contribution was made.  In OPNFV we use the Apache 2.0 license, some templates for code headers follow.
  
 == C/C++/Java == == C/C++/Java ==
Line 52: Line 65:
 %%  which accompanies this distribution,​ and is available at%%\\ %%  which accompanies this distribution,​ and is available at%%\\
 %%  http://​www.apache.org/​licenses/​LICENSE-2.0-->​%%\\ %%  http://​www.apache.org/​licenses/​LICENSE-2.0-->​%%\\
 +
 +== Documentation == 
 +
 +Per [[https://​www.opnfv.org/​about/​bylaws-and-policies/​ip-policy|OPNFV IP Policy]], all documentation will be received and made available by the OPNFV Project under the Creative Commons Attribution 4.0 International License. ​
 +
 +All documentation files need to be licensed using the creative commons licence. ​ The following example may be applied in the first lines of all contributed RST files:
 +
 +  .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 +  .. http://​creativecommons.org/​licenses/​by/​4.0
 +  .. (c) <​optionally add copywriters name>
 +
 +These lines will not be rendered in the html and pdf files.
 +
  
 === General Code Style === === General Code Style ===
  
-120 character line length+Depends on the upstream project to which we intend to contribute to. If it's OPNFV specific ​120 character line length ​would suffice. Yet, for OpenStack, a lot of projects enforce an 80 character length limit.
  
 == Java == == Java ==
Line 69: Line 95:
 PEP8 is the Python standard that should be followed when coding any Python code with the following exceptions. PEP8 is the Python standard that should be followed when coding any Python code with the following exceptions.
  
-120 character line length+80 character line length
  
 +The usage of tools such as [[https://​pypi.python.org/​pypi/​flake8|flake8]] is encouraged.
developer/contribution_guidelines.1425216794.txt.gz · Last modified: 2015/03/01 13:33 by Juan Osorio Robles