-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): the invisible-character gate never matched anything #47
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,7 +124,7 @@ jobs: | |
| # Checks for: zero-width spaces, zero-width joiners, BOM, soft hyphens, | ||
| # non-breaking spaces, null bytes, and other invisible Unicode in source files. | ||
| set +e | ||
| PATTERNS='\xc2\xa0|\xe2\x80\x8b|\xe2\x80\x8c|\xe2\x80\x8d|\xef\xbb\xbf|\xc2\xad|\xe2\x80\x8e|\xe2\x80\x8f|\xe2\x80\xaa|\xe2\x80\xab|\xe2\x80\xac|\xe2\x80\xad|\xe2\x80\xae|\x00' | ||
| PATTERNS='\x00|[\x01-\x08\x0B\x0C\x0E-\x1F]|\x{a0}|\x{ad}|\x{200b}|\x{200c}|\x{200d}|\x{200e}|\x{200f}|\x{202a}|\x{202b}|\x{202c}|\x{202d}|\x{202e}|\x{2060}|\x{feff}' | ||
| find "$GITHUB_WORKSPACE" \ | ||
| -not -path '*/.git/*' -not -path '*/node_modules/*' \ | ||
| -not -path '*/.deno/*' -not -path '*/target/*' \ | ||
|
|
@@ -135,7 +135,7 @@ jobs: | |
| -o -name '*.yml' -o -name '*.yaml' -o -name '*.md' -o -name '*.adoc' \ | ||
| -o -name '*.idr' -o -name '*.zig' -o -name '*.v' -o -name '*.jl' \ | ||
| -o -name '*.gleam' -o -name '*.hs' -o -name '*.ml' -o -name '*.sh' \) \ | ||
| -exec grep -Prl "$PATTERNS" {} \; > /tmp/empty-lint-results.txt 2>/dev/null | ||
| -exec grep -aPrl "$PATTERNS" {} \; > /tmp/empty-lint-results.txt 2>/dev/null | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM RISK Suggestion: Optimize the search command for better performance and reliability:
|
||
| EL_EXIT=$? | ||
| set -e | ||
|
|
||
|
|
||
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/kitchenspeak
Length of output: 227
🏁 Script executed:
Repository: hyperpolymath/kitchenspeak
Length of output: 13913
🏁 Script executed:
Repository: hyperpolymath/kitchenspeak
Length of output: 826
🌐 Web query:
GNU grep 3.8 grep -P \x{200b} character code point value in \x{} or \o{} is too large PCRE2 UTF mode💡 Result:
The error "character code point value in \x{} or \o{} is too large" typically occurs when using the -P (--perl-regexp) option in GNU grep (which relies on the PCRE library) while the environment or the pattern is not correctly configured for UTF-8 mode [1]. When you use the \x{...} syntax for a Unicode code point like U+200B (Zero Width Space), the PCRE engine requires the regex to be processed in UTF-8 mode [2][1]. If this mode is not enabled, the engine may attempt to interpret the value using 8-bit characters, which can lead to errors when the value exceeds the byte limit [2][1]. To resolve this: 1. Ensure the environment is using a UTF-8 locale (e.g., check that LC_ALL or LANG is set to something like en_US.UTF-8). 2. GNU grep's -P option generally handles UTF-8 automatically if the locale is set correctly. However, if you are explicitly trying to match a wide Unicode character, ensure you are not accidentally restricting the regex engine to a non-UTF-8 mode [2][1]. 3. If you continue to see the error, verify your input data. The -P option requires that the input files consist of valid UTF-8 strings [3][4]. If the input contains invalid UTF-8 byte sequences, grep -P will fail [4]. Note that \x{200b} is the standard PCRE syntax for the Unicode code point U+200B [2][5]. The error "too large" often indicates that the engine is not in "UTF mode" (which would allow code points > 255) [2][1]. Depending on your version of grep and the underlying PCRE library, you may need to ensure your locale supports UTF-8, as GNU grep typically enables UTF support automatically when it detects a UTF-8 locale [6][4]. If you are working with binary files or files with mixed/invalid encodings, -P might not be suitable; consider using other tools or converting the encoding first [3][4].
Citations:
🌐 Web query:
site:github.com/actions/runner-images Ubuntu 24.04 grep version locale C.UTF-8 ubuntu-latest💡 Result:
As of August 27, 2026, the
ubuntu-latestlabel for GitHub Actions and Azure DevOps runners points to the Ubuntu 24.04 (Noble Numbat) LTS image [1][2]. The standard GNUgreputility included in the Ubuntu 24.04 runner image is the version packaged by Ubuntu for its 24.04 release, which is GNU grep 3.11 [3]. Regarding the locale, theubuntu-latestenvironment is configured by default with the C.UTF-8 locale [4], which provides full UTF-8 support for standard utilities likegrep, ensuring correct behavior for character encoding and processing [5].Citations:
🌐 Web query:
GNU grep manual -P UTF-8 locale PCRE2 \x{feff}💡 Result:
In GNU grep, when using Perl-compatible regular expressions (the -P option), you can match the Unicode Byte Order Mark (BOM) character (U+FEFF) using the PCRE2 hex escape sequence \x{feff} [1]. However, there are important technical nuances regarding its use: 1. UTF-8 Locales: GNU grep determines character encoding based on the environment's locale settings (LC_CTYPE, LC_ALL, or LANG) [2]. When in a UTF-8 locale, grep treats the input as UTF-8 encoded text [2][3]. The BOM character (U+FEFF) in UTF-8 is represented by the three-byte sequence 0xEF, 0xBB, 0xBF [4][5]. 2. Matching the BOM: While \x{feff} is a valid PCRE2 syntax for the character [1], grep's -P mode processes the input as a string. If you are specifically trying to match a UTF-8 BOM at the start of a file, it is often more robust to match the byte sequence directly, as \x{feff} depends on PCRE2 interpreting the input as UTF-8 [6]. You can use shell-based tools to handle this, such as: grep$'\xEF\xBB\xBF' filename 3. Binary File Detection: GNU grep may identify files starting with a UTF-8 BOM as "binary" and skip them depending on the version and configuration, which can interfere with text-based searches [7]. 4. Portability: Because GNU grep's -P option and shell ANSI-C quoting ($ '') are extensions to POSIX, these methods are not portable across all Unix-like systems [3]. For portable scripts, relying on byte-level inspection (using tools like od, hexdump, or printf) is recommended for identifying or stripping the BOM [8][4]. In summary, while \x{feff} is valid syntax within PCRE2 regular expressions [1], it is a logical character match that assumes correct UTF-8 handling. For searching files with a BOM, explicitly targeting the 0xEF 0xBB 0xBF byte sequence is the industry-standard approach to avoid encoding-related ambiguity [4].
Citations:
Allow a leading U+FEFF.
The lexical specification permits U+FEFF only as the first scalar and discards it. The unqualified
\x{feff}ingrep -aPrlalso matches that leading scalar, so-lreports a valid file. Handle U+FEFF at file level: ignore exactly the leading scalar and report later occurrences.🤖 Prompt for AI Agents
Source: MCP tools