From f761949ccacd85d8344d1a7454c8af0bdcd5d7ec Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 28 Feb 2017 10:43:43 -0600 Subject: [PATCH] Ensure that a deprecated module has DOCUMENTATION.deprecated (#22090) --- test/sanity/validate-modules/README.rst | 2 ++ test/sanity/validate-modules/validate-modules | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/test/sanity/validate-modules/README.rst b/test/sanity/validate-modules/README.rst index 3f93478232..9d9d6f3946 100644 --- a/test/sanity/validate-modules/README.rst +++ b/test/sanity/validate-modules/README.rst @@ -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** | +---------+--------------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/test/sanity/validate-modules/validate-modules b/test/sanity/validate-modules/validate-modules index 021730939f..edd4e96ebb 100755 --- a/test/sanity/validate-modules/validate-modules +++ b/test/sanity/validate-modules/validate-modules @@ -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)