From c27b1042085c15029af8fe792da0f6252380dd61 Mon Sep 17 00:00:00 2001 From: Zac-HD Date: Wed, 10 May 2017 23:47:59 +1000 Subject: [PATCH] Check that each version appears once only Yet another check for merge issues - the combination of empty lines and dash over- and underlines for titles seems to confuse git regularly. --- scripts/check-changelog.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/check-changelog.py b/scripts/check-changelog.py index 5a80c68079..08669502ca 100644 --- a/scripts/check-changelog.py +++ b/scripts/check-changelog.py @@ -61,3 +61,11 @@ if all_versions != sorted(all_versions): print('You edited old release notes and changed the ordering!') sys.exit(1) + + v_nums = [v.split(' - ')[0] for v in all_versions] + duplicates = sorted(set(v for v in v_nums if v_nums.count(v) > 1)) + if duplicates: + plural = 's have' if len(duplicates) > 1 else ' has' + print('The following version%s multiple entries in the ' + 'changelog: %s' % (plural, ', '.join(map(repr, duplicates)))) + sys.exit(1)