Validate DOCUMENTATION.author (#48993)
* Validate DOCUMENTATION.author Ensure that author line includes a GitHub accountpull/4420/head
parent
9b44109ba3
commit
75407d3e43
|
@ -17,7 +17,7 @@ module: os_keystone_domain
|
||||||
short_description: Manage OpenStack Identity Domains
|
short_description: Manage OpenStack Identity Domains
|
||||||
author:
|
author:
|
||||||
- Monty Taylor (@emonty)
|
- Monty Taylor (@emonty)
|
||||||
- Haneef Ali
|
- Haneef Ali (@haneefs)
|
||||||
extends_documentation_fragment: openstack
|
extends_documentation_fragment: openstack
|
||||||
version_added: "2.1"
|
version_added: "2.1"
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -13,7 +13,10 @@ DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: cyberark_authentication
|
module: cyberark_authentication
|
||||||
short_description: Module for CyberArk Vault Authentication using PAS Web Services SDK
|
short_description: Module for CyberArk Vault Authentication using PAS Web Services SDK
|
||||||
author: Edward Nunez @ CyberArk BizDev (@enunez-cyberark, @cyberark-bizdev, @erasmix)
|
author:
|
||||||
|
- Edward Nunez (@enunez-cyberark) CyberArk BizDev
|
||||||
|
- Cyberark Bizdev (@cyberark-bizdev)
|
||||||
|
- erasmix (@erasmix)
|
||||||
version_added: 2.4
|
version_added: 2.4
|
||||||
description:
|
description:
|
||||||
- Authenticates to CyberArk Vault using Privileged Account Security Web Services SDK and
|
- Authenticates to CyberArk Vault using Privileged Account Security Web Services SDK and
|
||||||
|
|
|
@ -13,7 +13,10 @@ DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: cyberark_user
|
module: cyberark_user
|
||||||
short_description: Module for CyberArk User Management using PAS Web Services SDK
|
short_description: Module for CyberArk User Management using PAS Web Services SDK
|
||||||
author: Edward Nunez @ CyberArk BizDev (@enunez-cyberark, @cyberark-bizdev, @erasmix)
|
author:
|
||||||
|
- Edward Nunez (@enunez-cyberark) CyberArk BizDev
|
||||||
|
- Cyberark Bizdev (@cyberark-bizdev)
|
||||||
|
- erasmix (@erasmix)
|
||||||
version_added: 2.4
|
version_added: 2.4
|
||||||
description:
|
description:
|
||||||
- CyberArk User Management using PAS Web Services SDK. It currently supports the following
|
- CyberArk User Management using PAS Web Services SDK. It currently supports the following
|
||||||
|
|
|
@ -23,7 +23,7 @@ version_added: "1.2"
|
||||||
author:
|
author:
|
||||||
- "Andrew Newdigate (@suprememoocow)"
|
- "Andrew Newdigate (@suprememoocow)"
|
||||||
- "Dylan Silva (@thaumos)"
|
- "Dylan Silva (@thaumos)"
|
||||||
- "Justin Johns"
|
- "Justin Johns (!UNKNOWN)"
|
||||||
- "Bruce Pennypacker (@bpennypacker)"
|
- "Bruce Pennypacker (@bpennypacker)"
|
||||||
requirements:
|
requirements:
|
||||||
- PagerDuty API access
|
- PagerDuty API access
|
||||||
|
|
|
@ -21,7 +21,7 @@ description:
|
||||||
version_added: "1.2"
|
version_added: "1.2"
|
||||||
author:
|
author:
|
||||||
- "Dylan Silva (@thaumos)"
|
- "Dylan Silva (@thaumos)"
|
||||||
- "Justin Johns"
|
- "Justin Johns (!UNKNOWN)"
|
||||||
requirements:
|
requirements:
|
||||||
- "This pingdom python library: https://github.com/mbabineau/pingdom-python"
|
- "This pingdom python library: https://github.com/mbabineau/pingdom-python"
|
||||||
options:
|
options:
|
||||||
|
|
|
@ -23,7 +23,7 @@ description:
|
||||||
version_added: "1.8"
|
version_added: "1.8"
|
||||||
author:
|
author:
|
||||||
- "Cove (@cove)"
|
- "Cove (@cove)"
|
||||||
- "Tony Minfei Ding"
|
- "Tony Minfei Ding (!UNKNOWN)"
|
||||||
- "Harrison Gu (@harrisongu)"
|
- "Harrison Gu (@harrisongu)"
|
||||||
requirements:
|
requirements:
|
||||||
- "python >= 2.6"
|
- "python >= 2.6"
|
||||||
|
|
|
@ -22,7 +22,7 @@ description:
|
||||||
version_added: "2.0"
|
version_added: "2.0"
|
||||||
author:
|
author:
|
||||||
- "Cove (@cove)"
|
- "Cove (@cove)"
|
||||||
- Tony Minfei Ding
|
- Tony Minfei Ding (!UNKNOWN)
|
||||||
- Harrison Gu (@harrisongu)
|
- Harrison Gu (@harrisongu)
|
||||||
- Werner Dijkerman (@dj-wasabi)
|
- Werner Dijkerman (@dj-wasabi)
|
||||||
- Eike Frost (@eikef)
|
- Eike Frost (@eikef)
|
||||||
|
|
|
@ -22,7 +22,7 @@ description:
|
||||||
version_added: "2.0"
|
version_added: "2.0"
|
||||||
author:
|
author:
|
||||||
- "Cove (@cove)"
|
- "Cove (@cove)"
|
||||||
- Dean Hailin Song
|
- Dean Hailin Song (!UNKNOWN)
|
||||||
requirements:
|
requirements:
|
||||||
- "python >= 2.6"
|
- "python >= 2.6"
|
||||||
- zabbix-api
|
- zabbix-api
|
||||||
|
|
|
@ -22,7 +22,7 @@ description:
|
||||||
version_added: "2.0"
|
version_added: "2.0"
|
||||||
author:
|
author:
|
||||||
- "Cove (@cove)"
|
- "Cove (@cove)"
|
||||||
- "Tony Minfei Ding"
|
- "Tony Minfei Ding (!UNKNOWN)"
|
||||||
- "Harrison Gu (@harrisongu)"
|
- "Harrison Gu (@harrisongu)"
|
||||||
requirements:
|
requirements:
|
||||||
- "python >= 2.6"
|
- "python >= 2.6"
|
||||||
|
|
|
@ -27,7 +27,7 @@ version_added: "2.4"
|
||||||
short_description: Manages configuration of an OSPF VPN instance on HUAWEI CloudEngine switches.
|
short_description: Manages configuration of an OSPF VPN instance on HUAWEI CloudEngine switches.
|
||||||
description:
|
description:
|
||||||
- Manages configuration of an OSPF VPN instance on HUAWEI CloudEngine switches.
|
- Manages configuration of an OSPF VPN instance on HUAWEI CloudEngine switches.
|
||||||
author: Yang yang (@CloudEngine Ansible)
|
author: Yang yang (@QijunPan)
|
||||||
options:
|
options:
|
||||||
ospf:
|
ospf:
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -25,7 +25,7 @@ module: panos_sag
|
||||||
short_description: Create a static address group.
|
short_description: Create a static address group.
|
||||||
description:
|
description:
|
||||||
- Create a static address group object in the firewall used for policy rules.
|
- Create a static address group object in the firewall used for policy rules.
|
||||||
author: "Vinay Venkataraghavan @vinayvenkat"
|
author: "Vinay Venkataraghavan (@vinayvenkat)"
|
||||||
version_added: "2.4"
|
version_added: "2.4"
|
||||||
requirements:
|
requirements:
|
||||||
- pan-python can be obtained from PyPI U(https://pypi.org/project/pan-python/)
|
- pan-python can be obtained from PyPI U(https://pypi.org/project/pan-python/)
|
||||||
|
|
|
@ -23,7 +23,7 @@ description:
|
||||||
version_added: "2.6"
|
version_added: "2.6"
|
||||||
author:
|
author:
|
||||||
- "David Gunter (@verkaufer)"
|
- "David Gunter (@verkaufer)"
|
||||||
- "Chris Hoffman (@chrishoffman, creator of NPM Ansible module)"
|
- "Chris Hoffman (@chrishoffman), creator of NPM Ansible module)"
|
||||||
options:
|
options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -128,7 +128,7 @@ requirements:
|
||||||
- cron
|
- cron
|
||||||
author:
|
author:
|
||||||
- Dane Summers (@dsummersl)
|
- Dane Summers (@dsummersl)
|
||||||
- Mike Grozak
|
- Mike Grozak (@rhaido)
|
||||||
- Patrick Callahan (@dirtyharrycallahan)
|
- Patrick Callahan (@dirtyharrycallahan)
|
||||||
- Evan Kaufman (@EvanK)
|
- Evan Kaufman (@EvanK)
|
||||||
- Luca Berruti (@lberruti)
|
- Luca Berruti (@lberruti)
|
||||||
|
|
|
@ -83,7 +83,7 @@ notes:
|
||||||
author:
|
author:
|
||||||
- "Ansible Core Team"
|
- "Ansible Core Team"
|
||||||
- "Michael DeHaan"
|
- "Michael DeHaan"
|
||||||
- "David O'Brien @david_obrien davidobrien1985"
|
- "David O'Brien (@davidobrien1985)"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
|
|
|
@ -16,11 +16,21 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from voluptuous import ALLOW_EXTRA, PREVENT_EXTRA, All, Any, Length, Required, Schema, Self
|
import re
|
||||||
|
from voluptuous import ALLOW_EXTRA, PREVENT_EXTRA, All, Any, Length, Invalid, Required, Schema, Self
|
||||||
from ansible.module_utils.six import string_types
|
from ansible.module_utils.six import string_types
|
||||||
|
from ansible.module_utils.common.collections import is_iterable
|
||||||
list_string_types = list(string_types)
|
list_string_types = list(string_types)
|
||||||
any_string_types = Any(*string_types)
|
any_string_types = Any(*string_types)
|
||||||
|
|
||||||
|
# Valid DOCUMENTATION.author lines
|
||||||
|
# Based on Ansibulbot's extract_github_id()
|
||||||
|
# author: First Last (@name) [optional anything]
|
||||||
|
# "Ansible Core Team" - Used by the Bot
|
||||||
|
# "Michael DeHaan" - nop
|
||||||
|
# "Name (!UNKNOWN)" - For the few untraceable authors
|
||||||
|
author_line = re.compile(r'^\w.*(\(@([\w-]+)\)|!UNKNOWN)(?![\w.])|^Ansible Core Team$|^Michael DeHaan$')
|
||||||
|
|
||||||
|
|
||||||
def sequence_of_sequences(min=None, max=None):
|
def sequence_of_sequences(min=None, max=None):
|
||||||
return All(
|
return All(
|
||||||
|
@ -140,6 +150,17 @@ deprecation_schema = Schema(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def author(value):
|
||||||
|
|
||||||
|
if not is_iterable(value):
|
||||||
|
value = [value]
|
||||||
|
|
||||||
|
for line in value:
|
||||||
|
m = author_line.search(line)
|
||||||
|
if not m:
|
||||||
|
raise Invalid("Invalid author")
|
||||||
|
|
||||||
|
|
||||||
def doc_schema(module_name):
|
def doc_schema(module_name):
|
||||||
deprecated_module = False
|
deprecated_module = False
|
||||||
|
|
||||||
|
@ -151,7 +172,7 @@ def doc_schema(module_name):
|
||||||
Required('short_description'): Any(*string_types),
|
Required('short_description'): Any(*string_types),
|
||||||
Required('description'): Any(list_string_types, *string_types),
|
Required('description'): Any(list_string_types, *string_types),
|
||||||
Required('version_added'): Any(float, *string_types),
|
Required('version_added'): Any(float, *string_types),
|
||||||
Required('author'): Any(None, list_string_types, *string_types),
|
Required('author'): All(Any(None, list_string_types, *string_types), author),
|
||||||
'notes': Any(None, list_string_types),
|
'notes': Any(None, list_string_types),
|
||||||
'requirements': list_string_types,
|
'requirements': list_string_types,
|
||||||
'todo': Any(None, list_string_types, *string_types),
|
'todo': Any(None, list_string_types, *string_types),
|
||||||
|
|
Loading…
Reference in New Issue