diff options
| author | Konstantin Manna <Konstantin@Manna.uno> | 2018-07-28 20:21:30 +0200 |
|---|---|---|
| committer | Claudiu Popa <pcmanticore@gmail.com> | 2018-08-01 08:40:54 +0200 |
| commit | 9cb0e3aa04de095ab50ec7b54bad46f2f9aa2eb6 (patch) | |
| tree | 034c7dbe744fd92b219b95e4982982d0d86648c4 | |
| parent | d0f13426deafc8c5344a8af05469cab0e0d17d91 (diff) | |
| download | pylint-git-9cb0e3aa04de095ab50ec7b54bad46f2f9aa2eb6.tar.gz | |
check rst files with rst-linter
| -rw-r--r-- | .travis.yml | 1 | ||||
| -rw-r--r-- | doc/check_rst_files.py | 24 | ||||
| -rw-r--r-- | tox.ini | 2 |
3 files changed, 27 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index 2046e3bf9..47e5c688a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,7 @@ install: - pip --version - tox --version - coverage --version + - tox -e docs script: # Test install with current version of setuptools - pip install . diff --git a/doc/check_rst_files.py b/doc/check_rst_files.py new file mode 100644 index 000000000..71ac3e0b2 --- /dev/null +++ b/doc/check_rst_files.py @@ -0,0 +1,24 @@ +import glob +import os + +import restructuredtext_lint + +os.chdir('..') +issues = [] + +print('==Linting reStructuredText files with rst-lint==') + +for file in glob.iglob('**/*.rst', recursive=True): + issues.extend(restructuredtext_lint.lint_file(filepath=file)) + + +if issues: + for issue in issues: + print('{type}:{filename}:{line} {message}'.format( + type=issue.type, + filename=issue.source, + line=issue.line, + message=issue.message.replace('\n', ' '))) + print('reStructuredText linter found {} issues in rst files!'.format( + len(issues))) + exit(1) @@ -64,6 +64,7 @@ whitelist_externals = rm deps = sphinx python-docs-theme + restructuredtext_lint commands = pip install python_docs_theme @@ -72,3 +73,4 @@ commands = rm -f extensions.rst python ./exts/pylint_extensions.py sphinx-build -b html -d _build/doctrees . _build/html + python ./check_rst_files.py |
