Skip to content

Commit

Permalink
Add note on module development about the copyrights
Browse files Browse the repository at this point in the history
This matches what's in CODING_GUIDELINES.md as of July 2017
  • Loading branch information
ryansb committed Jul 17, 2017
1 parent c536f77 commit 0439fa5
Showing 1 changed file with 44 additions and 6 deletions.
50 changes: 44 additions & 6 deletions docs/docsite/rst/dev_guide/developing_modules_documenting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand All @@ -30,6 +31,40 @@ All modules must have the following sections defined in this order:



Copyright
----------------------

The first 3 lines of every module should look the same. The first line is the
shebang, but the next 2 lines are the important bit: copyright statement and
license.

.. code-block:: python
#!/usr/bin/python
# Copyright © 2017 [REPLACE THIS]
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
Every file with a copyright header must include the original author. Major
additions to the module are allowed to add an additional copyright line. This
is especially true of rewrites, but original authorship copyright messages
should be preserved. If applicable, contributors may have their rights assigned
to their employer for example: "Copyright © 2017 Red Hat, Inc."

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 © 2017 [New Contributor(s)]
# Copyright © 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
----------------------

Expand Down Expand Up @@ -116,7 +151,8 @@ Include it in your module file like this:
.. code-block:: python
#!/usr/bin/python
# Copyright header....
# Copyright © 2017 [REPLACE THIS]
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = '''
---
Expand All @@ -126,6 +162,8 @@ Include it in your module file like this:
'''
The following fields can be used and are all required unless specified otherwise:

:module:
Expand Down

0 comments on commit 0439fa5

Please sign in to comment.