-
Notifications
You must be signed in to change notification settings - Fork 60
Small saftey and annoyance updates to bin/update.py #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Because we only use the latest emoji-zwj-sequences.txt for automatic testing purposes, a static change of the URL is performed without "legacy url" support for support of previous versions. From https://unicode.org/Public/emoji/ReadMe.txt > This directory contains data files for versions 1.0 to 16.0 > of Unicode Emoji. > > Starting with Unicode 17.0.0, the data files for Unicode Emoji are published in > https://www.unicode.org/Public/<version>/emoji/ > together with the related files in > https://www.unicode.org/Public/<version>/ucd/emoji/ I checked, and this file does not change in value between 15.1.0 and 17.0.0; and, new code has been added to *verify* that no change is done. This is because we hardcode *all* vs16 tables as a single "version 9.0.0" table,
bin/update-tables.py
Outdated
if (line.startswith('@@') or | ||
line.startswith('---') or | ||
line.startswith('+++') or | ||
(line.startswith('-') and 'This code generated') or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right side inside brackets is always implicit evaluated as True
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right, thanks, I had to re-read it a few times to see the bug thanks
bin/update-tables.py
Outdated
# Check if only the 'This code generated' line is different | ||
significant_changes = False | ||
for line in diff_lines: | ||
if (line.startswith('@@') or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-readed and understood: https://docs.python.org/3/library/stdtypes.html#str.startswith
You can use line.startswith(('@@', '---'))
and list all prefixes in the tuple instead of multiple or
. Code will look cleaner.
reduce code, use tuple in startswith() Co-authored-by: Aleksei Stepanov <[email protected]>
…o jq/bin-update-updates
Do not modify timestamps in code generated files (discard if timestamp is the only "difference". Unless table_vs16.py has changed code; this is significant and would require a code change because of our hardcoded 9.0.0 release.
URL_EMOJI_ZWJ is updated, From https://unicode.org/Public/emoji/ReadMe.txt