[Emoji UI Picker] [PART 2 | Djblets] Finished working implementation
Review Request #11880 — Created Nov. 21, 2021 and updated
[Emoji UI Picker] [PART 2 | Djblets] Finished working implementation
=> Local testing
=> Unit tests added for emoji registry methods
Description | From | Last Updated |
---|---|---|
E501 line too long (86 > 79 characters) |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
E261 at least two spaces before inline comment |
reviewbot | |
E501 line too long (91 > 79 characters) |
reviewbot | |
E501 line too long (82 > 79 characters) |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E117 over-indented |
reviewbot | |
E501 line too long (102 > 79 characters) |
reviewbot | |
E501 line too long (91 > 79 characters) |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
E117 over-indented |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E501 line too long (92 > 79 characters) |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
E501 line too long (80 > 79 characters) |
reviewbot | |
E201 whitespace after '{' |
reviewbot | |
E501 line too long (97 > 79 characters) |
reviewbot | |
E202 whitespace before '}' |
reviewbot | |
W292 no newline at end of file |
reviewbot | |
E501 line too long (32480 > 79 characters) |
reviewbot | |
W292 no newline at end of file |
reviewbot | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
E501 line too long (107 > 79 characters) |
reviewbot | |
E501 line too long (80 > 79 characters) |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
This isn't something we need to worry about. Djblets 2.x+ is Django 1.11+ only. |
david | |
A few things here with imports: The first import should always be unicode_literals as well as any other __future__ things … |
david | |
Parens aren't necessary here |
david | |
No need to define the local variable here. Just assign directly into the dict key. |
david | |
This isn't a helpful thing to have here--it's kind of obvious what these are. |
david | |
Combine these lines ("""Add the src attributes...) |
david | |
For docstrings, the first line should be a summary, and additional info should go in other paragraphs. At the very … |
david | |
All identifiers in python (except for class names) should use underscores rather than camelCase. |
david | |
This isn't particularly efficient (.index() has to iterate the list every time it's called). When we're building the sort order, … |
david | |
There's a python syntax trick that lets us avoid defining a method for this: combined_indices = {**i1['emoji'], **i2['emoji']} combined_aliases = … |
david | |
Python style says that this should be named get_unicode_sort_order |
david | |
We really should make this process the .txt file directly from the unicode consortium rather than list it out ourselves. … |
david | |
E501 line too long (32480 > 79 characters) |
reviewbot | |
Same comments about import orders. |
david | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
All string literals should use single quotes unless there's a good reason not to (for example, a single quote within … |
david | |
Comments should use #, not triple-quoted strings. |
david | |
E501 line too long (107 > 79 characters) |
reviewbot | |
Based on my reading of the code, I think this can just be: index = emoji_registry.get_emoji_index(for_extension=True) new_kwargs['emoji_index'] = lambda: index |
david | |
E501 line too long (80 > 79 characters) |
reviewbot | |
Make sure to add info. |
david | |
This needs a "Returns" section. |
david | |
This needs a "Returns" section. |
david | |
E501 line too long (81 > 79 characters) |
reviewbot | |
E501 line too long (84 > 79 characters) |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
E999 SyntaxError: invalid syntax |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W292 no newline at end of file |
reviewbot | |
F401 'kgb.SpyAgency' imported but unused |
reviewbot | |
F401 'djblets.siteconfig.models.SiteConfiguration' imported but unused |
reviewbot | |
F401 'djblets.testing.testcases.TestCase' imported but unused |
reviewbot | |
E303 too many blank lines (3) |
reviewbot | |
W391 blank line at end of file |
reviewbot | |
F401 'collections.OrderedDict' imported but unused |
reviewbot | |
E302 expected 2 blank lines, found 1 |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W292 no newline at end of file |
reviewbot | |
E302 expected 2 blank lines, found 1 |
reviewbot | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
E501 line too long (95 > 79 characters) |
reviewbot | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (80 > 79 characters) |
reviewbot | |
E501 line too long (84 > 79 characters) |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E999 SyntaxError: invalid syntax |
reviewbot | |
E303 too many blank lines (3) |
reviewbot | |
E302 expected 2 blank lines, found 1 |
reviewbot | |
E302 expected 2 blank lines, found 1 |
reviewbot | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
E501 line too long (95 > 79 characters) |
reviewbot | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (80 > 79 characters) |
reviewbot | |
E501 line too long (84 > 79 characters) |
reviewbot | |
E999 SyntaxError: invalid syntax |
reviewbot | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
E501 line too long (95 > 79 characters) |
reviewbot | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (80 > 79 characters) |
reviewbot | |
E501 line too long (84 > 79 characters) |
reviewbot | |
E999 SyntaxError: invalid syntax |
reviewbot | |
E501 line too long (97 > 79 characters) |
reviewbot | |
E303 too many blank lines (3) |
reviewbot | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
E501 line too long (95 > 79 characters) |
reviewbot | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (80 > 79 characters) |
reviewbot | |
E501 line too long (84 > 79 characters) |
reviewbot | |
E999 SyntaxError: invalid syntax |
reviewbot | |
F401 'pytz' imported but unused |
reviewbot | |
E501 line too long (97 > 79 characters) |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
E501 line too long (86 > 79 characters) |
reviewbot | |
E501 line too long (90 > 79 characters) |
reviewbot | |
E501 line too long (92 > 79 characters) |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
E501 line too long (101 > 79 characters) |
reviewbot | |
E501 line too long (101 > 79 characters) |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
E501 line too long (95 > 79 characters) |
reviewbot | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (80 > 79 characters) |
reviewbot | |
E501 line too long (84 > 79 characters) |
reviewbot | |
E999 SyntaxError: invalid syntax |
reviewbot | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
E501 line too long (95 > 79 characters) |
reviewbot | |
E501 line too long (98 > 79 characters) |
reviewbot | |
E501 line too long (80 > 79 characters) |
reviewbot |
- Commit:
-
cbcba6581b831d2e904fd3c7e722074cbff25b52dfb23c9363580d00e0de7a5abf35c14ce26a23cc
Checks run (1 failed, 1 succeeded)
flake8
-
OK, I added a handful of comments (some of these are style things that apply throughout the change and I just marked one instance).
The biggest thing is how we're dealing with the sort order. We really should just take the .txt file from unicode.org and bundle it, and then have our code process that file to build the sort order. That way, when future versions of Unicode come out, we can just drop in a new file.
-
-
A few things here with imports:
The first import should always be
unicode_literals
as well as any other__future__
things that are necessary. After that there are three groups: standard library, third-party, and the same module. Within each group we alphabetize. We also don't use the relative import syntax (yet).from __future__ import unicode_literals import datetime import json from collections import OrderedDict import pytz from djblets.emojis.unicode_sort_order import get_unicode_sort_order from djblets.siteconfig.models import SiteConfiguration
-
-
-
-
-
For docstrings, the first line should be a summary, and additional info should go in other paragraphs. At the very least put a blank line between these two and combine the """ with the summary line.
-
-
This isn't particularly efficient (
.index()
has to iterate the list every time it's called). When we're building the sort order, let's create a dict mapping the codepoint to its index value. -
There's a python syntax trick that lets us avoid defining a method for this:
combined_indices = {**i1['emoji'], **i2['emoji']} combined_aliases = {**i1['aliases'], **i2['aliases']}
-
-
We really should make this process the .txt file directly from the unicode consortium rather than list it out ourselves. That way it's much easier to update.
-
-
All string literals should use single quotes unless there's a good reason not to (for example, a single quote within the string content itself).
-
-
Based on my reading of the code, I think this can just be:
index = emoji_registry.get_emoji_index(for_extension=True) new_kwargs['emoji_index'] = lambda: index
-
-
-
- Change Summary:
-
David's comments + changes to how emoji index is retrieved for optimization
- Commit:
-
addf68d15814eef3b3c01c4b7fc3d6ca463171ec757311866922ce1b6962f4cf40a35a985bf59127
Checks run (1 failed, 1 succeeded)
flake8
- Commit:
-
757311866922ce1b6962f4cf40a35a985bf5912783d8ae7178776605beeff367e6e5bf75588bd371
Checks run (1 failed, 1 succeeded)
flake8
- Commit:
-
83d8ae7178776605beeff367e6e5bf75588bd3715e1a537147aac5e39151b0091d441144525f5f01
Checks run (1 failed, 1 succeeded)
flake8
- Commit:
-
5e1a537147aac5e39151b0091d441144525f5f0133634418a4b43d4aa3f0acda5ddd1a5c3aee395d
Checks run (1 failed, 1 succeeded)
flake8
- Commit:
-
33634418a4b43d4aa3f0acda5ddd1a5c3aee395da5f50f622be37879c7a32741a7889bb57db02cdd
Checks run (1 failed, 1 succeeded)
flake8
- Summary:
-
[WIP | Emoji UI Picker] [PART 2 | Djblets] Working implementation ready for review[Emoji UI Picker] [PART 2 | Djblets] Finished working implementation
- Description:
-
~ [WIP | Emoji UI Picker] [PART 2 | Djblets] Working implementation ready for review
~ [Emoji UI Picker] [PART 2 | Djblets] Finished working implementation
~ => Would like a preliminary review
~ - => Still need to add unit tests - Testing Done:
-
=> Local testing
~ => Unit tests needed ~ => Unit tests added for emoji registry methods - Commit:
-
a5f50f622be37879c7a32741a7889bb57db02cdda864bc5f85b755534984dffe5f122710f64d4432