diff options
author | chriseth <chris@ethereum.org> | 2017-05-03 20:36:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-03 20:36:32 +0800 |
commit | 68ef5810593e7c8092ed41d5f474dd43141624eb (patch) | |
tree | 36453acfef9495095dc47305d9b40c2cd3b63813 /scripts/update_bugs_by_version.py | |
parent | f0d539ae05739e35336cc9cc8f44bd9798a95c28 (diff) | |
parent | 34b28ed760e8ba9b86f661c819fe489fb8403235 (diff) | |
download | dexon-solidity-68ef5810593e7c8092ed41d5f474dd43141624eb.tar dexon-solidity-68ef5810593e7c8092ed41d5f474dd43141624eb.tar.gz dexon-solidity-68ef5810593e7c8092ed41d5f474dd43141624eb.tar.bz2 dexon-solidity-68ef5810593e7c8092ed41d5f474dd43141624eb.tar.lz dexon-solidity-68ef5810593e7c8092ed41d5f474dd43141624eb.tar.xz dexon-solidity-68ef5810593e7c8092ed41d5f474dd43141624eb.tar.zst dexon-solidity-68ef5810593e7c8092ed41d5f474dd43141624eb.zip |
Merge pull request #2219 from ethereum/develop
Release for version 0.4.11
Diffstat (limited to 'scripts/update_bugs_by_version.py')
-rwxr-xr-x | scripts/update_bugs_by_version.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/scripts/update_bugs_by_version.py b/scripts/update_bugs_by_version.py new file mode 100755 index 00000000..c4bc0c9b --- /dev/null +++ b/scripts/update_bugs_by_version.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python +# +# This script is used to generate the list of bugs per compiler version +# from the list of bugs. +# It updates the list in place and signals failure if there were changes. +# This makes it possible to use this script as part of CI to check +# that the list is up to date. + +import os +import json +import re +import sys + +def comp(version_string): + return [int(c) for c in version_string.split('.')] + +path = os.path.dirname(os.path.realpath(__file__)) +with open(path + '/../docs/bugs.json') as bugsFile: + bugs = json.load(bugsFile) + +versions = {} +with open(path + '/../Changelog.md') as changelog: + for line in changelog: + m = re.search(r'^### (\S+) \((\d+-\d+-\d+)\)$', line) + if m: + versions[m.group(1)] = {} + versions[m.group(1)]['released'] = m.group(2) + +for v in versions: + versions[v]['bugs'] = [] + for bug in bugs: + if 'introduced' in bug and comp(bug['introduced']) > comp(v): + continue + if comp(bug['fixed']) <= comp(v): + continue + versions[v]['bugs'] += [bug['name']] + +with open(path + '/../docs/bugs_by_version.json', 'r+') as bugs_by_version: + old_contents = bugs_by_version.read() + new_contents = json.dumps(versions, sort_keys=True, indent=4) + bugs_by_version.seek(0) + bugs_by_version.write(new_contents) + sys.exit(old_contents != new_contents)
\ No newline at end of file |