summaryrefslogtreecommitdiff
path: root/pycadf
diff options
context:
space:
mode:
authorDolph Mathews <dolph.mathews@gmail.com>2015-10-02 03:24:59 +0000
committerSteve Martinelli <stevemar@ca.ibm.com>2016-02-12 15:03:10 +0000
commit9c4100b85d277b558143b1af9dc9ffdc37802e37 (patch)
treefd144be207ec1186cbb9066ff90495f2e8e47b19 /pycadf
parentdc553133d854f31a54d3afd9fbe1b1370adbfaec (diff)
downloadpycadf-9c4100b85d277b558143b1af9dc9ffdc37802e37.tar.gz
Add docstring validation
This introduces a linter for PEP257 to avoid trivial nitpicking of docstrings in code reviews. Because flake8_docstrings simply provides a plugin to add pep257 to flake8, you can run it via `tox -e pep8`. PEP257 checks which we are currently violating are ignored in tox.ini. We can remove them from the ignored list as they are fixed. Related-Bug: 1501544 Change-Id: I01ebad7b70cf61dd80d3c06c6808d8178fbdd634
Diffstat (limited to 'pycadf')
-rw-r--r--pycadf/identifier.py8
1 files changed, 3 insertions, 5 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: