Add rstcheck to ansible-test and correct issues. (#23550)

* Add rstcheck to ansible-test.
* Fix rst code-block languages and syntax errors.
* Fix rst inline literals.
* Update python 2 code block to pass tests on py 3.
This commit is contained in:
Matt Clay 2017-04-13 10:28:52 -07:00 committed by GitHub
parent 811eb66703
commit cb1f57d4e5
9 changed files with 86 additions and 10 deletions

View file

@ -130,6 +130,7 @@ to yield text but instead do the conversion explicitly ourselves. For example:
# Handle the exception gracefully -- usually by displaying a good
# user-centric error message that can be traced back to this piece
# of code.
pass
.. note:: Much of Ansible assumes that all encoded text is UTF-8. At some
point, if there is demand for other encodings we may change that, but for
@ -293,7 +294,8 @@ new exception-catching syntax which uses the ``as`` keyword:
Do **not** use the following syntax as it will fail on every version of Python-3:
.. code-block:: python
.. This code block won't highlight because python2 isn't recognized. This is necessary to pass tests under python 3.
.. code-block:: python2
try:
a = 2/0
@ -399,7 +401,6 @@ Python-2 and Python-3. You may still see this used in some modules:
.. code-block:: python
from ansible.module_utils.pycompat24 import get_exception
[...]
try:
a = 2/0