diff options
-rw-r--r-- | pycadf/identifier.py | 8 | ||||
-rw-r--r-- | test-requirements.txt | 1 | ||||
-rw-r--r-- | tox.ini | 16 |
3 files changed, 19 insertions, 6 deletions
diff --git a/pycadf/identifier.py b/pycadf/identifier.py index c032bd2..5ee6e1c 100644 --- a/pycadf/identifier.py +++ b/pycadf/identifier.py @@ -35,8 +35,7 @@ if CONF.audit.namespace: def generate_uuid(): - """Generate a CADF identifier - """ + """Generate a CADF identifier.""" if AUDIT_NS: return str(uuid.uuid5(AUDIT_NS, str(uuid.uuid4()))) return str(uuid.uuid4()) @@ -44,14 +43,13 @@ def generate_uuid(): @removals.remove def norm_ns(str_id): - """Apply a namespace to the identifier """ + """Apply a namespace to the identifier.""" prefix = CONF.audit.namespace + ':' if CONF.audit.namespace else '' return prefix + str_id def is_valid(value): - """Validation to ensure Identifier is correct. - """ + """Validation to ensure Identifier is correct.""" if value in ['target', 'initiator', 'observer']: return True try: diff --git a/test-requirements.txt b/test-requirements.txt index 963a03c..ba4cab9 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,6 +3,7 @@ # process, which may cause wedges in the gate later. # Hacking already pins down pep8, pyflakes and flake8 hacking<0.11,>=0.10.0 +flake8_docstrings==0.2.1.post1 # MIT coverage>=3.6 # Apache-2.0 discover # BSD @@ -25,7 +25,21 @@ commands = oslo_debug_helper {posargs} show-source = True # H405: Multi line docstrings should start with a one line summary followed by # an empty line. -ignore = H405 +# D100: Missing docstring in public module +# D101: Missing docstring in public class +# D102: Missing docstring in public method +# D103: Missing docstring in public function +# D104: Missing docstring in public package +# D105: Missing docstring in magic method +# D200: One-line docstring should fit on one line with quotes +# D202: No blank lines allowed after function docstring +# D203: 1 blank required before class docstring +# D204: 1 blank line required after class docstring +# D205: 1 blank line required between summary line and description +# D208: Docstring is over-indented +# D400: First line should end with a period +# D401: First line should be in imperative mood +ignore = H405,D100,D101,D102,D103,D104,D105,D200,D202,D203,D204,D205,D208,D400,D401 exclude = .tox,dist,doc,*.egg,build,./pycadf/openstack/common [hacking] |