From d6530c48d9c860aeb604c4efddb3ddc58cc24c2c Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Thu, 14 May 2020 16:15:15 -0500 Subject: [PATCH] Add doc linting to pep8 target This adds doc8 to the pep8 job to lint the docs. Also fixes a few issues it highlighted. Change-Id: Id0f4b9bee1f6a0103ec581b20037a9b74201aaca Signed-off-by: Sean McGinnis --- HACKING.rst | 25 ++++++++++++--------- doc/source/contributor/functional_tests.rst | 10 +++++---- doc/source/index.rst | 8 ++++--- lower-constraints.txt | 1 + test-requirements.txt | 1 + tox.ini | 8 ++++++- 6 files changed, 34 insertions(+), 19 deletions(-) diff --git a/HACKING.rst b/HACKING.rst index fed361147..82683e7b0 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -10,7 +10,8 @@ Cinder Client Specific Commandments General ------- -- Use 'raise' instead of 'raise e' to preserve original traceback or exception being reraised:: +- Use 'raise' instead of 'raise e' to preserve original traceback or exception + being reraised:: except Exception as e: ... @@ -22,26 +23,28 @@ General Release Notes ------------- -- Any patch that makes a change significant to the end consumer or deployer of an - OpenStack environment should include a release note (new features, upgrade impacts, - deprecated functionality, significant bug fixes, etc.) +- Any patch that makes a change significant to the end consumer or deployer of + an OpenStack environment should include a release note (new features, upgrade + impacts, deprecated functionality, significant bug fixes, etc.) -- Cinder Client uses Reno for release notes management. See the `Reno Documentation`_ - for more details on its usage. +- Cinder Client uses Reno for release notes management. See the `Reno + Documentation`_ for more details on its usage. .. _Reno Documentation: https://docs.openstack.org/reno/latest/ -- As a quick example, when adding a new shell command for Awesome Storage Feature, one - could perform the following steps to include a release note for the new feature: +- As a quick example, when adding a new shell command for Awesome Storage + Feature, one could perform the following steps to include a release note for + the new feature:: $ tox -e venv -- reno new add-awesome-command $ vi releasenotes/notes/add-awesome-command-bb8bb8bb8bb8bb81.yaml - Remove the extra template text from the release note and update the details so it - looks something like: + Remove the extra template text from the release note and update the details + so it looks something like:: --- features: - Added shell command `cinder be-awesome` for Awesome Storage Feature. -- Include the generated release notes file when submitting your patch for review. +- Include the generated release notes file when submitting your patch for + review. diff --git a/doc/source/contributor/functional_tests.rst b/doc/source/contributor/functional_tests.rst index 9eea42df2..1494f475a 100644 --- a/doc/source/contributor/functional_tests.rst +++ b/doc/source/contributor/functional_tests.rst @@ -40,7 +40,9 @@ For more information on these options and how to run tests, please see the Gotchas ------- -The cinderclient.tests.functional.test_cli.CinderBackupTests.test_backup_create_and_delete -test will fail in Devstack without c-bak service running, which requires Swift. -Make sure Swift is enabled when you stack.sh by putting this in local.conf : -enable_service s-proxy s-object s-container s-account +The cinderclient.tests.functional.test_cli.CinderBackupTests.test_backup_create +and_delete test will fail in Devstack without c-bak service running, which +requires Swift. Make sure Swift is enabled when you stack.sh by putting this in +local.conf:: + + enable_service s-proxy s-object s-container s-account diff --git a/doc/source/index.rst b/doc/source/index.rst index 557bddc9f..2bd01af79 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -221,6 +221,11 @@ The following are kept for historical purposes. * Use Adapter from keystoneclient * Add support for Replication feature * Add pagination for Volume List +* Note Connection refused --> Connection error commit: + c9e7818f3f90ce761ad8ccd09181c705880a4266 +* Note Mask Passwords in log output commit: + 80582f2b860b2dadef7ae07bdbd8395bf03848b1 + .. _1325773: http://bugs.launchpad.net/python-cinderclient/+bug/1325773 .. _1333257: http://bugs.launchpad.net/python-cinderclient/+bug/1333257 @@ -234,9 +239,6 @@ The following are kept for historical purposes. .. _1130572: http://bugs.launchpad.net/python-cinderclient/+bug/1130572 .. _1156994: http://bugs.launchpad.net/python-cinderclient/+bug/1156994 -** Note Connection refused --> Connection error commit: c9e7818f3f90ce761ad8ccd09181c705880a4266 -** Note Mask Passwords in log output commit: 80582f2b860b2dadef7ae07bdbd8395bf03848b1 - 1.0.9 ------ diff --git a/lower-constraints.txt b/lower-constraints.txt index 11e6cd7c2..470edc19f 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -6,6 +6,7 @@ coverage==4.0 cryptography==2.1 ddt==1.0.1 debtcollector==1.2.0 +doc8==0.6.0 extras==1.0.0 fasteners==0.7.0 fixtures==3.0.0 diff --git a/test-requirements.txt b/test-requirements.txt index fdc3d2596..c8e64f2fe 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -13,3 +13,4 @@ tempest>=17.1.0 # Apache-2.0 testtools>=2.2.0 # MIT stestr>=1.0.0 # Apache-2.0 oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0 +doc8>=0.6.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 5aeea014b..40f881c6c 100644 --- a/tox.ini +++ b/tox.ini @@ -30,7 +30,9 @@ commands = find . -type f -name "*.pyc" -delete whitelist_externals = find [testenv:pep8] -commands = flake8 +commands = + flake8 + doc8 [testenv:pylint] deps = @@ -107,6 +109,10 @@ show-source = True ignore = H404,H405,E122,E123,E128,E251,W504 exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build +[doc8] +ignore-path=.tox,*.egg-info,doc/src/api,doc/source/drivers.rst,doc/build,.eggs/*/EGG-INFO/*.txt,doc/so urce/configuration/tables,./*.txt,releasenotes/build,doc/source/cli/details.rst +extension=.txt,.rst,.inc + [testenv:lower-constraints] deps = -c{toxinidir}/lower-constraints.txt