From 0863f04a2673cb92934a509ca689a9b06441286a Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 30 Sep 2019 14:31:30 +0100 Subject: docs: Turn on warning-as-error There were two main issues here. Firstly, a function was being documented as a class, resulting in: WARNING: error while formatting arguments for barbicanclient.client.Client: 'function' object has no attribute '__mro__' Secondly, a docstring for a common function had an incorrect field list format, resulting in: docstring of barbicanclient.v1.acls.SecretACL.get:4: WARNING: Field list ends without a blank line; unexpected unindent docstring of barbicanclient.v1.acls.ContainerACL.get:4: WARNING: Field list ends without a blank line; unexpected unindent Resolve both. Change-Id: I69ef97cb48c6b5a1add4e89c4a53047420d314f4 Signed-off-by: Stephen Finucane --- barbicanclient/v1/acls.py | 6 +++--- doc/source/reference/index.rst | 3 +-- tox.ini | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/barbicanclient/v1/acls.py b/barbicanclient/v1/acls.py index 7724048..2db597a 100644 --- a/barbicanclient/v1/acls.py +++ b/barbicanclient/v1/acls.py @@ -269,14 +269,14 @@ class ACL(object): self._operation_acls.append(new_acl) def _get_operation_acl(self, operation_type): - return next((acl for acl in self._operation_acls - if acl.operation_type == operation_type), None) + return next((acl for acl in self._operation_acls + if acl.operation_type == operation_type), None) def get(self, operation_type): """Get operation specific ACL instance. :param str operation_type: Type indicating which operation's ACL - setting is needed. + setting is needed. """ return self._get_operation_acl(operation_type) diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst index 791d5d1..f84cf77 100644 --- a/doc/source/reference/index.rst +++ b/doc/source/reference/index.rst @@ -5,8 +5,7 @@ Reference Client ====== -.. autoclass:: barbicanclient.client.Client - :members: +.. autofunction:: barbicanclient.client.Client Secrets ======= diff --git a/tox.ini b/tox.ini index 5a46e8c..0210bf3 100644 --- a/tox.ini +++ b/tox.ini @@ -42,7 +42,7 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -r{toxinidir}/requirements.txt -r{toxinidir}/doc/requirements.txt -commands = sphinx-build -b html doc/source doc/build/html +commands = sphinx-build -b html -W doc/source doc/build/html [testenv:functional] # This tox env is purely to make local test development easier -- cgit v1.2.1