-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): the invisible-character gate never matched anything #193
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
Open
hyperpolymath
wants to merge
1
commit into
main
Choose a base branch
from
fix/empty-linter-pattern-never-matched
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: hyperpolymath/verisimiser
Length of output: 5095
🏁 Script executed:
Repository: hyperpolymath/verisimiser
Length of output: 496
🏁 Script executed:
Repository: hyperpolymath/verisimiser
Length of output: 222
🏁 Script executed:
Repository: hyperpolymath/verisimiser
Length of output: 750
🌐 Web query:
GNU grep -P "\x{feff}" "character code point value in" PCRE2 UTF support💡 Result:
The character code point value for the Byte Order Mark (BOM) in Unicode is U+FEFF [1][2]. In the context of PCRE2 and tools that utilize it—such as GNU grep (when using the -P or --perl-regexp flag) or pcre2grep—the handling of this character follows standard Unicode and regular expression rules: 1. Code Point Value: U+FEFF represents the "ZERO WIDTH NO-BREAK SPACE" character, which is repurposed as a Byte Order Mark (BOM) when placed at the beginning of a text stream [1][2]. 2. Representation in PCRE2: In regular expressions, this code point is commonly represented using the escape sequence \x{feff} [2]. 3. Behavior with PCRE2: When PCRE2 is in UTF mode (which is typically enabled in GNU grep and pcre2grep when processing UTF-8 data), \x{feff} is treated as a literal character matching the Unicode code point U+FEFF [1]. 4. UTF-8 BOM vs. Literal Character: It is important to distinguish between the file-level BOM (which is a sequence of bytes, EF BB BF in UTF-8) and the character U+FEFF within a string [2]. Most grep implementations do not automatically ignore or strip the BOM from the input stream; if a file starts with a UTF-8 BOM, that BOM is present as the first three bytes of the file [3]. If you search for \x{feff} in a file containing a UTF-8 BOM, the regex engine will generally not match it unless the regex engine is specifically configured to interpret those bytes as the U+FEFF character, which is usually not the case with raw byte-stream grep operations [4]. In practice, if you need to match a UTF-8 BOM at the start of a file using regex, it is often more reliable to match the raw byte sequence (\xEF\xBB\xBF) rather than relying on the U+FEFF character interpretation, as the latter depends on the engine's encoding awareness and the presence of the BOM in the input [4][5].
Citations:
Make the
grep -Ppattern byte-compatible.grep -aPrl "$PATTERNS"can reject the\x{a0}–\x{feff}escapes withcharacter code point value in \x{} or \o{} is too large. Becauseset +epermits the scan to continue, it can produce no result paths. Replace these escapes with UTF-8 byte sequences, including\xEF\xBB\xBFfor U+FEFF.🤖 Prompt for AI Agents
Source: MCP tools