Skip to content

Commit a37201f

Browse files
committed
Correct placement for changelog entry anchor
1 parent 2c5b618 commit a37201f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

hypothesis-python/docs/changes.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ Hypothesis APIs come in three flavours:
2121
You should generally assume that an API is internal unless you have specific
2222
information to the contrary.
2323

24-
.. _v3.55.3:
25-
2624
.. _v3.55.4:
2725

2826
-------------------
@@ -32,6 +30,8 @@ information to the contrary.
3230
This patch makes a variety of minor improvements to the documentation,
3331
and improves a few validation messages for invalid inputs.
3432

33+
.. _v3.55.3:
34+
3535
-------------------
3636
3.55.3 - 2018-04-12
3737
-------------------

scripts/hypothesistooling.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ def has_release():
215215
return os.path.exists(RELEASE_FILE)
216216

217217

218+
CHANGELOG_ANCHOR = re.compile(r"^\.\. _v\d+\.\d+\.\d+:$")
218219
CHANGELOG_BORDER = re.compile(r"^-+$")
219220
CHANGELOG_HEADER = re.compile(r"^\d+\.\d+\.\d+ - \d\d\d\d-\d\d-\d\d$")
220221
RELEASE_TYPE = re.compile(r"^RELEASE_TYPE: +(major|minor|patch)")
@@ -264,9 +265,10 @@ def update_changelog_and_version():
264265
lines = contents.split('\n')
265266
assert contents == '\n'.join(lines)
266267
for i, l in enumerate(lines):
267-
if CHANGELOG_BORDER.match(l):
268-
assert CHANGELOG_HEADER.match(lines[i + 1]), repr(lines[i + 1])
268+
if CHANGELOG_ANCHOR.match(l):
269269
assert CHANGELOG_BORDER.match(lines[i + 2]), repr(lines[i + 2])
270+
assert CHANGELOG_HEADER.match(lines[i + 3]), repr(lines[i + 3])
271+
assert CHANGELOG_BORDER.match(lines[i + 4]), repr(lines[i + 4])
270272
beginning = '\n'.join(lines[:i])
271273
rest = '\n'.join(lines[i:])
272274
assert '\n'.join((beginning, rest)) == contents

0 commit comments

Comments
 (0)