1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Ensure that a deprecated module has DOCUMENTATION.deprecated (#22090)

This commit is contained in:
Matt Martz 2017-02-28 10:43:43 -06:00 committed by John R Barker
parent e0975602d1
commit f761949cca
2 changed files with 9 additions and 0 deletions

View file

@ -117,6 +117,8 @@ Errors
+---------+--------------------------------------------------------------------------------------------------------------------------------------------+
| 317 | option is marked as required but specifies a default. Arguments with a default should not be marked as required |
+---------+--------------------------------------------------------------------------------------------------------------------------------------------+
| 318 | Module deprecated, but DOCUMENTATION.deprecated is missing |
+---------+--------------------------------------------------------------------------------------------------------------------------------------------+
+---------+--------------------------------------------------------------------------------------------------------------------------------------------+
| **4xx** | **Syntax** |
+---------+--------------------------------------------------------------------------------------------------------------------------------------------+

View file

@ -646,6 +646,13 @@ class ModuleValidator(Validator):
'with DOCUMENTATION.extends_documentation_fragment')
))
if self.object_name.startswith('_') and not os.path.islink(self.object_path):
if 'deprecated' not in doc or not doc.get('deprecated'):
self.errors.append((
318,
'Module deprecated, but DOCUMENTATION.deprecated is missing'
))
self._validate_docs_schema(doc, doc_schema, 'DOCUMENTATION', 305)
self._check_version_added(doc)
self._check_for_new_args(doc)