Skip to content

Commit 6ee4681

Browse files
derek73claude
andcommitted
Anchor the emoji-range CodeQL suppression on the flagged line
py/overly-large-range anchors at the first astral character-range line of the multi-line pattern, not the re.compile line the lgtm[...] comment sat on -- so the suppression never applied. Moved one line down in both keep-in-sync copies (config/regexes.py and _pipeline/_tokenize.py). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 2776fa2 commit 6ee4681

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

nameparser/_pipeline/_tokenize.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
# "bidi") -- layering forbids importing the config package here, so the
3131
# patterns are duplicated by design with this provenance note. When
3232
# editing, keep both copies in sync.
33-
_EMOJI = re.compile('[' # lgtm[py/overly-large-range]
34-
'\U0001F300-\U0001F64F'
33+
_EMOJI = re.compile('['
34+
'\U0001F300-\U0001F64F' # lgtm[py/overly-large-range]
3535
'\U0001F680-\U0001F6FF'
3636
'\u2600-\u26FF\u2700-\u27BF]+')
3737
_BIDI = re.compile('[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]+')

nameparser/config/regexes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import re
22

33
# emoji regex from https://stackoverflow.com/questions/26568722/remove-unicode-emoji-using-re-in-python
4-
re_emoji = re.compile('[' # lgtm[py/overly-large-range]
5-
'\U0001F300-\U0001F64F'
4+
re_emoji = re.compile('['
5+
'\U0001F300-\U0001F64F' # lgtm[py/overly-large-range]
66
'\U0001F680-\U0001F6FF'
77
'\u2600-\u26FF\u2700-\u27BF]+')
88

0 commit comments

Comments
 (0)