kayobe/tools/sphinx8
Mark Goddard b9d76f6ef5 Remove support for CentOS 7 and Python 2
* Always use Python 3
* Drop code paths for CentOS 7
* Drop support for Yum
* Remove support for host NTP daemon, always use chrony
* Switch references from 'yum_install_epel' to 'dnf_install_epel'
* Remove overcloud host image workaround for tagged VLAN admin network
* Remove the kayobe.utils.yum_install function, which is unused

Change-Id: I368f6edafed9779658798fc342116b4c1b3ffd48
Story: 2006574
Task: 39481
2020-05-28 10:25:51 +01:00

36 lines
887 B
Python
Executable File

#!/usr/bin/env python3
"""
Sphinx documentation style checker.
This is a very thin wrapper around doc8, that adds support for sphinx-specific
RST directives.
NOTE: We require sphinx>1.5 in order to avoid automatically registering all
directives when any of the directives modules are imported.
"""
import sys
from unittest import mock
import doc8.main
import sphinx.directives
import sphinx.directives.code
import sphinx.directives.patches
def main():
# NOTE: Registering sphinx.directives.other causes a failure in parsing
# later.
# Sphinx expects an 'app' argument to these functions. Use a mock since we
# don't need to use the application object.
app = mock.Mock()
sphinx.directives.setup(app)
sphinx.directives.code.setup(app)
sphinx.directives.patches.setup(app)
return doc8.main.main()
if __name__ == "__main__":
sys.exit(main())