Last active
February 9, 2019 22:57
-
-
Save mega-arbuz/a3a87ed7ed1a8e7d6ba3df4f6d04d680 to your computer and use it in GitHub Desktop.
Extract latest changes from changelog file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_changes(change_log_path): | |
with(open(change_log_path)) as change_log_file: | |
change_log = change_log_file.read() | |
# Split by '##' and remove lines starting with '#' | |
latest_version_changes = change_log.split('##')[0][:-1] | |
latest_version_changes = re.sub('^#.*\n?', '', latest_version_changes, flags=re.MULTILINE) | |
return latest_version_changes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment