pep8: Permit ".)" at the end of resource docs

When a sentence is wholly contained within parentheses, the period at
the end should appear inside the closing parenthesis. The current pep8
check requires that e.g. resource property descriptions must end with a
period, which makes things awkward when the last sentence is
parenthesised. Allow them to optionally end with ".)" instead.

Change-Id: I489c424136047e57e4649739fd0b0727bc3cc915
This commit is contained in:
Zane Bitter
2019-10-14 21:51:43 -04:00
parent 89ab96176f
commit 36a3eaaa35

View File

@@ -199,7 +199,7 @@ class HeatCustomGuidelines(object):
'with uppercase letter') % error_key.title(),
'snippet': description})
self.print_guideline_error(**error_kwargs)
if not description.endswith('.'):
if not (description.endswith('.') or description.endswith('.)')):
error_kwargs.update(
{'message': _('%s description summary omitted '
'terminator at the end') % error_key.title(),
@@ -250,7 +250,8 @@ class HeatCustomGuidelines(object):
if re.search("^(:param|:type|:returns|:rtype|:raises)",
line):
params = True
if not params and not doclines[-2].endswith('.'):
if not params and not (doclines[-2].endswith('.') or
doclines[-2].endswith('.)')):
error_kwargs.update(
{'message': _('%s description omitted '
'terminator at the end') % error_key.title(),