diff options
author | Zane Bitter <zbitter@redhat.com> | 2019-10-14 21:51:43 -0400 |
---|---|---|
committer | Zane Bitter <zbitter@redhat.com> | 2019-10-14 21:51:43 -0400 |
commit | 36a3eaaa351e378f1ba48518ecf6341f66b7bc3d (patch) | |
tree | 047478af385b2a1809506608919707ebed93699b | |
parent | 89ab96176fb7a0a25e7839ac21027640e9c5aaaf (diff) | |
download | heat-36a3eaaa351e378f1ba48518ecf6341f66b7bc3d.tar.gz |
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
-rw-r--r-- | tools/custom_guidelines.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/custom_guidelines.py b/tools/custom_guidelines.py index ce0defc80..3e8f4e2c7 100644 --- a/tools/custom_guidelines.py +++ b/tools/custom_guidelines.py @@ -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(), |