-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): the invisible-character gate never matched anything #63
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.
+2
−2
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -119,7 +119,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/*' \ | ||||||
|
|
@@ -130,7 +130,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. ⚪ LOW RISK Suggestion: Optimize performance by batching files and removing the redundant recursive flag. The
Suggested change
|
||||||
| 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 | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: hyperpolymath/mylangiser
Length of output: 187
🏁 Script executed:
Repository: hyperpolymath/mylangiser
Length of output: 4009
🏁 Script executed:
Repository: hyperpolymath/mylangiser
Length of output: 419
🌐 Web query:
GNU grep 3.8 -P PCRE2 \x{200b} C.UTF-8 character code point value too large UTF-8 locale documentation💡 Result:
The error message character code point value too large when using grep with Perl-compatible regular expressions (PCRE/PCRE2) typically occurs because the regular expression engine is not operating in UTF-8 mode [1][2]. When using GNU grep with the -P (--perl-regexp) option, the engine interprets the pattern based on the current locale [2]. If your environment is set to the C.UTF-8 locale, but grep is not explicitly told to process the input and pattern as UTF-8, it may fail to handle Unicode escape sequences like \x{200B} (the zero-width space) correctly, treating the value as an invalid or out-of-range byte sequence [3][1]. To resolve this: 1. Enable Unicode/UTF-8 mode: Use the -P option in combination with the -u or --utf-8 flag (if your version of grep supports it), or ensure your environment correctly interprets UTF-8. In many modern versions of GNU grep, -P automatically handles UTF-8 if the locale is set to a UTF-8 locale, but if it fails, you may need to explicitly invoke pcre2grep with the -u (--utf) flag [4][2]. 2. Verify Locale: Ensure your environment variables LC_ALL or LC_CTYPE are set to a UTF-8 compatible locale (e.g., LC_ALL=en_US.UTF-8) [2]. The C.UTF-8 locale is generally effective, but some older tools or specific library configurations may still require explicit UTF-8 flags [2][5]. 3. PCRE2 Syntax: When using \x{...} syntax in PCRE2, ensure you are using the curly brace format for any character beyond the basic ASCII range (255) [3][4][6]. The error specifically indicates that the regex engine is trying to process a multi-byte character using a single-byte (usually 8-bit) interpretation [3][4]. If you are using pcre2grep directly, you can pass the -u (--utf) flag to force UTF-8 mode [2]: pcre2grep -u '\x{200b}' filename If you are using standard grep, verify that your version supports -P and that it is linked against a PCRE library compiled with Unicode support [1]. If the error persists, it is often a sign that the tool is defaulting to a non-Unicode-aware library path or C locale [2].
Citations:
Use a UTF-8-capable matching method for the
grep -Pscan.GNU
grepcan exit withcharacter code point value in \x{} or \o{} is too largefor the code points above0xFF.C.UTF-8alone does not enable PCRE2 UTF mode for this invocation. The workflow suppresses this error and can record zero findings.Use a matcher with explicit PCRE2 UTF support, such as
pcre2grep -u, or replace the Unicode escapes with their UTF-8 byte sequences.🤖 Prompt for AI Agents