You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/sanity/code-smell/rstcheck-cli.py

20 lines
577 B
Python

"""Wrapper around rstcheck to provide Jinja2 compatibility for Sphinx."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import runpy
import sys
try:
from jinja2.filters import pass_context as _passctx, pass_environment as _passenv
_mod = sys.modules['jinja2']
_mod.contextfunction = _passctx
_mod.environmentfilter = _passenv
except ImportError:
pass
sys.path.remove(os.path.dirname(__file__)) # avoid recursively running sanity test
runpy.run_module('rstcheck', run_name='__main__', alter_sys=True)