From 05531b99d08a6a77b13bd05962e561d317f5ed18 Mon Sep 17 00:00:00 2001
From: Matt Clay <matt@mystile.com>
Date: Thu, 13 Oct 2016 12:47:13 -0700
Subject: [PATCH] Restore README.rst, update and fix formatting. (#18012)

* Revert "Update validate-modules README and convert to MD. (#18008)"
* This reverts commit 4916fe9962044eb315e8cc3b3a04423a346ddf82.
* Fix formatting of README.rst.
---
 test/sanity/validate-modules/README.md  | 62 ----------------------
 test/sanity/validate-modules/README.rst | 70 +++++++++++++++++++++++++
 2 files changed, 70 insertions(+), 62 deletions(-)
 delete mode 100644 test/sanity/validate-modules/README.md
 create mode 100644 test/sanity/validate-modules/README.rst

diff --git a/test/sanity/validate-modules/README.md b/test/sanity/validate-modules/README.md
deleted file mode 100644
index a5dcb82e4aa..00000000000
--- a/test/sanity/validate-modules/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-# validate-modules
-
-Python program to help test or validate Ansible modules.
-
-Originally developed by Matt Martz (@sivel)
-
-## Usage
-
-```shell
-cd /path/to/ansible/source
-source hacking/env-setup
-test/sanity/validate-modules/validate-modules /path/to/modules
-```
-
-## Help
-
-```shell
-usage: validate-modules [-h] [-w] [--exclude EXCLUDE] modules
-
-positional arguments:
-  modules            Path to module or module directory
-
-optional arguments:
-  -h, --help         show this help message and exit
-  -w, --warnings     Show warnings
-  --exclude EXCLUDE  RegEx exclusion pattern
-```
-
-# Current Validations
-
-## Modules
-
-### Errors
-
-- Interpreter line is not `#!/usr/bin/python`
-- `main()` not at the bottom of the file
-- Module does not import `ansible.module_utils.basic`
-- Missing `DOCUMENTATION`
-- Documentation is invalid YAML
-- Invalid schema for `DOCUMENTATION`
-- Missing `EXAMPLES`
-- Invalid Python Syntax
-- Tabbed indentation
-- Use of `sys.exit()` instead of `exit_json` or `fail_json`
-- Missing GPLv3 license header in module
-- PowerShell module missing `WANT_JSON`
-- PowerShell module missing `POWERSHELL_COMMON`
-- New modules have the correct `version_added`
-- New arguments have the correct `version_added`
-- Modules should not import requests, instead use `ansible.module_utils.urls`
-- Missing `RETURN` for new modules
-
-### Warnings
-
-- Try/Except `HAS_` expression missing
-- Missing `RETURN` for existing modules
-- `import json` found
-- Module contains duplicate globals from basic.py
-
-## Module Directories (Python Packages)
-
-- Missing `__init__.py`
diff --git a/test/sanity/validate-modules/README.rst b/test/sanity/validate-modules/README.rst
new file mode 100644
index 00000000000..5da1d298320
--- /dev/null
+++ b/test/sanity/validate-modules/README.rst
@@ -0,0 +1,70 @@
+validate-modules
+================
+
+Python program to help test or validate Ansible modules.
+
+Originally developed by Matt Martz (@sivel)
+
+Usage
+~~~~~
+
+.. code:: shell
+
+    cd /path/to/ansible/source
+    source hacking/env-setup
+    test/sanity/validate-modules/validate-modules /path/to/modules
+
+Help
+~~~~
+
+.. code:: shell
+
+    usage: validate-modules [-h] [-w] [--exclude EXCLUDE] modules
+
+    positional arguments:
+      modules            Path to module or module directory
+
+    optional arguments:
+      -h, --help         show this help message and exit
+      -w, --warnings     Show warnings
+      --exclude EXCLUDE  RegEx exclusion pattern
+
+Current Validations
+===================
+
+Modules
+~~~~~~~
+
+Errors
+^^^^^^
+
+#. Interpreter line is not ``#!/usr/bin/python``
+#. ``main()`` not at the bottom of the file
+#. Module does not import ``ansible.module_utils.basic``
+#. Missing ``DOCUMENTATION``
+#. Documentation is invalid YAML
+#. Invalid schema for ``DOCUMENTATION``
+#. Missing ``EXAMPLES``
+#. Invalid Python Syntax
+#. Tabbed indentation
+#. Use of ``sys.exit()`` instead of ``exit_json`` or ``fail_json``
+#. Missing GPLv3 license header in module
+#. PowerShell module missing ``WANT_JSON``
+#. PowerShell module missing ``POWERSHELL_COMMON``
+#. New modules have the correct ``version_added``
+#. New arguments have the correct ``version_added``
+#. Modules should not import requests, instead use ``ansible.module_utils.urls``
+#. Missing ``RETURN`` for new modules
+
+Warnings
+^^^^^^^^
+
+#. Try/Except ``HAS_`` expression missing
+#. Missing ``RETURN`` for existing modules
+#. ``import json`` found
+#. Module contains duplicate globals from basic.py
+
+Module Directories (Python Packages)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#. Missing ``__init__.py``