V8.03.512.2025.06.06
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -126,12 +126,14 @@ jobs:
|
||||
# STEP 1: Find target files.
|
||||
#
|
||||
# We capture:
|
||||
# - All files '*.sh', '*.zsh', '*.chroot'
|
||||
# - All files whose first line begins with “#!” (shebang)
|
||||
# - All files '*.sh', '*.zsh', '*.chroot', '*.yaml', '*.yml'
|
||||
# - All files whose first line begins with "#!" (shebang)
|
||||
# -------------------------------
|
||||
mapfile -t files_to_check < <(
|
||||
find . -type f \( \
|
||||
-iname '*.sh' -o \
|
||||
-iname '*.yml' -o \
|
||||
-iname '*.yaml' -o \
|
||||
-iname '*.zsh' -o \
|
||||
-iname '*.chroot' -o \
|
||||
-exec grep -Iq '^#!' {} \; \
|
||||
@@ -170,7 +172,7 @@ jobs:
|
||||
for file in "${files_to_check[@]}"; do
|
||||
#
|
||||
# 4.1: CRLF detection
|
||||
# grep -nP returns “lineno:<line with CR>”
|
||||
# grep -nP returns "lineno:<line with CR>"
|
||||
# -------------------------------
|
||||
while IFS=: read -r lineno _rest; do
|
||||
findings+="${file}: CRLF-found at line ${lineno}: <CR>"$'\n'
|
||||
@@ -178,7 +180,7 @@ jobs:
|
||||
|
||||
#
|
||||
# 4.2: Unallowed control characters
|
||||
# grep -nP -o returns “lineno:<matched-char>”
|
||||
# grep -nP -o returns "lineno:<matched-char>"
|
||||
# -------------------------------
|
||||
while IFS=: read -r lineno char; do
|
||||
findings+="${file}: control-char at line ${lineno}: ${char}"$'\n'
|
||||
@@ -186,7 +188,7 @@ jobs:
|
||||
|
||||
#
|
||||
# 4.3: Non-ASCII characters with emoji exception
|
||||
# grep -nP -o returns “lineno:<matched-char>”
|
||||
# grep -nP -o returns "lineno:<matched-char>"
|
||||
# -------------------------------
|
||||
while IFS=: read -r lineno char; do
|
||||
findings+="${file}: non-ascii at line ${lineno}: ${char}"$'\n'
|
||||
|
||||
Reference in New Issue
Block a user