From beca565c79235fc180d50ffba1edfb77919d82dc Mon Sep 17 00:00:00 2001 From: Ryan Brown Date: Wed, 19 Jul 2017 06:58:52 -0400 Subject: [PATCH] [Docs] Add note on module development about the copyrights (#26812) * Add note on module development about the copyrights This matches what's in CODING_GUIDELINES.md as of July 2017 * Add recommendation for standardizing on `Copyright (c) 2017 Ansible Project` * s/with/should have/ * Fix more unicode --- .../developing_modules_documenting.rst | 51 ++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/docs/docsite/rst/dev_guide/developing_modules_documenting.rst b/docs/docsite/rst/dev_guide/developing_modules_documenting.rst index 4507624fd4..4667ff6e8a 100644 --- a/docs/docsite/rst/dev_guide/developing_modules_documenting.rst +++ b/docs/docsite/rst/dev_guide/developing_modules_documenting.rst @@ -14,11 +14,12 @@ syntax highlighting before you include it in your Python file. All modules must have the following sections defined in this order: -1. ANSIBLE_METADATA -2. DOCUMENTATION -3. EXAMPLES -4. RETURNS -5. Python imports +1. Copyright +2. ANSIBLE_METADATA +3. DOCUMENTATION +4. EXAMPLES +5. RETURNS +6. Python imports .. note:: Why don't the imports go first? @@ -30,6 +31,41 @@ All modules must have the following sections defined in this order: +Copyright +---------------------- + +The beginning of every module should look about the same. After the shebang, +there should be at least two lines covering copyright and licensing of the +code. + +.. code-block:: python + + #!/usr/bin/python + # Copyright (c) 2017 Ansible Project + # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +Every file should have a copyright line with the original copyright holder. +Major additions to the module (for instance, rewrites) may add additional +copyright lines. Code from the Ansible community should typically be assigned +as "Copyright (c) 2017 Ansible Project" which covers all contributors. Any +legal questions need to review the source control history, so an exhaustive +copyright header is not necessary. + +The license declaration should be ONLY one line, not the full GPL prefix. If +you notice a module with the full prefix, feel free to switch it to the +one-line declaration instead. + +When adding a copyright line after completing a significant feature or rewrite, +add the newer line above the older one, like so: + +.. code-block:: python + + #!/usr/bin/python + # Copyright (c) 2017 [New Contributor(s)] + # Copyright (c) 2015 [Original Contributor(s)] + # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + + ANSIBLE_METADATA Block ---------------------- @@ -116,7 +152,8 @@ Include it in your module file like this: .. code-block:: python #!/usr/bin/python - # Copyright header.... + # Copyright (c) 2017 [REPLACE THIS] + # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) DOCUMENTATION = ''' --- @@ -126,6 +163,8 @@ Include it in your module file like this: ''' + + The following fields can be used and are all required unless specified otherwise: :module: