From 57e14d627a3621c042763eedfc0493a24808c1af Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 10 Aug 2013 13:57:45 +0200 Subject: [PATCH] Reword H404 description to match check The check only checks that a multiline docstring starts without a newline. The message "should start with a summary" is misleading reviewers, as can be seen in e.g. https://review.openstack.org/#/c/40114/ The "check for summary at beginning being less than 80 chars and end with punctation" needs to be moved to a new hacking check to preserve compatibility. Change-Id: I694b0dc55706ccf8ada9bb132cc7efb3c49cd0d6 --- hacking/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hacking/core.py b/hacking/core.py index b8b176d0..fe712385 100755 --- a/hacking/core.py +++ b/hacking/core.py @@ -584,10 +584,10 @@ def hacking_docstring_multiline_end(physical_line, previous_logical, tokens): @flake8ext def hacking_docstring_multiline_start(physical_line, previous_logical, tokens): - r"""Check multi line docstring start with summary. + r"""Check multi line docstring starts immediately with summary. OpenStack HACKING guide recommendation for docstring: - Docstring should start with A multi line docstring has a one-line summary + Docstring should start with a one-line summary, less than 80 characters. Okay: '''foobar\nfoo\nbar\n''' Okay: def foo():\n a = '''\nnot\na docstring\n''' @@ -599,7 +599,7 @@ def hacking_docstring_multiline_start(physical_line, previous_logical, tokens): if len(tokens) == 0 and pos != -1 and len(physical_line) == pos + 4: if physical_line.strip() in START_DOCSTRING_TRIPLE: return (pos, "H404: multi line docstring " - "should start with a summary") + "should start without a leading new line") @flake8ext