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:
@@ -199,7 +199,7 @@ class HeatCustomGuidelines(object):
|
|||||||
'with uppercase letter') % error_key.title(),
|
'with uppercase letter') % error_key.title(),
|
||||||
'snippet': description})
|
'snippet': description})
|
||||||
self.print_guideline_error(**error_kwargs)
|
self.print_guideline_error(**error_kwargs)
|
||||||
if not description.endswith('.'):
|
if not (description.endswith('.') or description.endswith('.)')):
|
||||||
error_kwargs.update(
|
error_kwargs.update(
|
||||||
{'message': _('%s description summary omitted '
|
{'message': _('%s description summary omitted '
|
||||||
'terminator at the end') % error_key.title(),
|
'terminator at the end') % error_key.title(),
|
||||||
@@ -250,7 +250,8 @@ class HeatCustomGuidelines(object):
|
|||||||
if re.search("^(:param|:type|:returns|:rtype|:raises)",
|
if re.search("^(:param|:type|:returns|:rtype|:raises)",
|
||||||
line):
|
line):
|
||||||
params = True
|
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(
|
error_kwargs.update(
|
||||||
{'message': _('%s description omitted '
|
{'message': _('%s description omitted '
|
||||||
'terminator at the end') % error_key.title(),
|
'terminator at the end') % error_key.title(),
|
||||||
|
Reference in New Issue
Block a user