mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
workflows: Add check for common LLM targeted unicode characters (#1974)
* workflows: Add check for zero width unicode characters * refactor: exclude .git directory in zero width unicode character check * Include additional zero width unicode character in check * refactor: update zero width unicode check to include format characters
This commit is contained in:
12
.github/workflows/misc.yml
vendored
12
.github/workflows/misc.yml
vendored
@@ -51,3 +51,15 @@ jobs:
|
||||
echo "::error::Replace !errors.Is(err, target) with testify equivalents"
|
||||
exit 1
|
||||
|
||||
- name: Check for LLM targeted invisible Unicode
|
||||
run: |
|
||||
WHITELIST=''
|
||||
if [[ -z "$WHITELIST" ]]; then
|
||||
PATTERN='(?!\x20)[\p{Cf}\p{Z}\p{M}]'
|
||||
else
|
||||
PATTERN="(?![\x20$WHITELIST])[\p{Cf}\p{Z}\p{M}]"
|
||||
fi
|
||||
grep -r -n -I --color=always --exclude-dir=.git -P "$PATTERN" . || exit 0
|
||||
echo "::error::Remove zero-width/format, separator or combining-mark characters"
|
||||
exit 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user