Skip to content

Commit

Permalink
Check that each version appears once only
Browse files Browse the repository at this point in the history
Yet another check for merge issues - the combination of empty lines and
dash over- and underlines for titles seems to confuse git regularly.
  • Loading branch information
Zac-HD committed May 10, 2017
1 parent fd84c2f commit c27b104
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/check-changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit c27b104

Please sign in to comment.