From 31be1c5ad3dcb6b0f88dab2e597424baaf6a49c5 Mon Sep 17 00:00:00 2001 From: liuxiaoyang Date: Thu, 24 Aug 2017 09:47:22 +0800 Subject: [PATCH] Add doc8 rule and check doc/source files doc8 is a linter for documents and used in openstack-manuals. It is better to enforce document linters for simple checking. This change is to add doc8 in tox file and fix line too long in some files. The current rules are as bellow: - invalid rst format - D000 - lines should not be longer than 79 characters - D001 - RST exception: line with no whitespace except in the beginning - RST exception: lines with http or https urls - RST exception: literal blocks - RST exception: rst target directives - no trailing whitespace - D002 - no tabulation for indentation - D003 - no carriage returns (use unix newlines) - D004 - no newline at end of file - D005 Change-Id: I01b11619b42eebf13cb17e1b4a2e8464a8ccc797 --- doc/source/middlewarearchitecture.rst | 4 ++-- test-requirements.txt | 1 + tox.ini | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/source/middlewarearchitecture.rst b/doc/source/middlewarearchitecture.rst index bf856612..9e13b972 100644 --- a/doc/source/middlewarearchitecture.rst +++ b/doc/source/middlewarearchitecture.rst @@ -203,8 +203,8 @@ they've been stored in the cache may continue to work. Deployments using `memcached`_ may use the following keystonemiddleware configuration options instead of an in-memory cache. -* ``memcached_servers``: (optional) if defined, the memcached server(s) to use for - caching. It will be ignored if Swift MemcacheRing is used instead. +* ``memcached_servers``: (optional) if defined, the memcached server(s) to use + for caching. It will be ignored if Swift MemcacheRing is used instead. * ``token_cache_time``: (optional, default 300 seconds) Set to -1 to disable caching completely. diff --git a/test-requirements.txt b/test-requirements.txt index 739a411d..af0f0237 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,6 +7,7 @@ flake8-docstrings==0.2.1.post1 # MIT coverage!=4.4,>=4.0 # Apache-2.0 cryptography!=2.0,>=1.6 # BSD/Apache-2.0 +doc8 # Apache-2.0 docutils>=0.11 # OSI-Approved Open Source, Public Domain fixtures>=3.0.0 # Apache-2.0/BSD mock>=2.0 # BSD diff --git a/tox.ini b/tox.ini index e9d9b564..9e3ececf 100644 --- a/tox.ini +++ b/tox.ini @@ -51,6 +51,7 @@ exclude = .venv,.tox,dist,doc,*egg,build [testenv:docs] commands= + doc8 doc/source python setup.py build_sphinx [testenv:releasenotes] @@ -59,3 +60,8 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen [hacking] import_exceptions = keystonemiddleware.i18n + +[doc8] +extensions = .rst, .yaml +# lines should not be longer than 79 characters. +max-line-length = 79