Skip to content

Commit 33c0627

Browse files
Jonathan D.A. Jewellclaude
andcommitted
fix: integrate third-party excludes in remaining 5 fix scripts
Add shared third-party-excludes.sh sourcing to fix-deno-permissions, fix-dependabot, fix-heredoc-install, fix-unpinned-actions, and fix-unwrap-to-match. Also gitignore shared-context/findings/ and .hypatia/ (runtime outputs). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 04b0cf2 commit 33c0627

6 files changed

Lines changed: 26 additions & 9 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ logs/
3434

3535
# Generated enrollment registry
3636
shared-context/enrollment/repos.json
37+
38+
# Runtime findings output
39+
shared-context/findings/
40+
41+
# Hypatia scan cache
42+
.hypatia/

scripts/fix-deno-permissions.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
set -euo pipefail
1818

19+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
20+
source "$SCRIPT_DIR/lib/third-party-excludes.sh" 2>/dev/null || true
21+
1922
REPO_PATH="${1:?Usage: fix-deno-permissions.sh <repo-path> <finding-json>}"
2023
FINDING_JSON="${2:?Usage: fix-deno-permissions.sh <repo-path> <finding-json>}"
2124

@@ -48,10 +51,8 @@ while IFS= read -r -d '' script_file; do
4851
echo "[fix-deno-permissions] Fixed (short form): ${script_file}"
4952
MODIFIED=$((MODIFIED + 1))
5053
fi
51-
done < <(find "${REPO_PATH}" \
52-
-path "${REPO_PATH}/.git" -prune -o \
53-
-path "${REPO_PATH}/node_modules" -prune -o \
54-
-name '*.sh' -type f -print0 2>/dev/null)
54+
done < <(find "${REPO_PATH}" -name '*.sh' -type f \
55+
-not -path "*/.git/*" "${FIND_THIRD_PARTY_EXCLUDES[@]}" -print0 2>/dev/null)
5556

5657
# --- Fix justfile and Makefile ---
5758
for build_file in "${REPO_PATH}/justfile" "${REPO_PATH}/Justfile" \
@@ -76,11 +77,10 @@ while IFS= read -r -d '' nested_config; do
7677
MODIFIED=$((MODIFIED + 1))
7778
fi
7879
done < <(find "${REPO_PATH}" \
79-
-path "${REPO_PATH}/.git" -prune -o \
80-
-path "${REPO_PATH}/node_modules" -prune -o \
8180
\( -name 'deno.json' -o -name 'deno.jsonc' \) \
8281
-not -path "${REPO_PATH}/deno.json" \
8382
-not -path "${REPO_PATH}/deno.jsonc" \
83+
-not -path "*/.git/*" "${FIND_THIRD_PARTY_EXCLUDES[@]}" \
8484
-type f -print0 2>/dev/null)
8585

8686
if [[ ${MODIFIED} -eq 0 ]]; then

scripts/fix-dependabot.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
set -euo pipefail
1313

14+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
15+
source "$SCRIPT_DIR/lib/third-party-excludes.sh" 2>/dev/null || true
16+
1417
REPO_PATH="${1:?Usage: fix-dependabot.sh <repo-path> <finding-json>}"
1518
FINDING_JSON="${2:?Usage: fix-dependabot.sh <repo-path> <finding-json>}"
1619

scripts/fix-heredoc-install.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
set -euo pipefail
1212

13+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
14+
source "$SCRIPT_DIR/lib/third-party-excludes.sh" 2>/dev/null || true
15+
1316
REPO_PATH="${1:?Usage: $0 <repo-path> <finding-json>}"
1417
FINDING_JSON="${2:?Missing finding JSON file}"
1518

@@ -48,7 +51,7 @@ while IFS= read -r -d '' file; do
4851
if [[ "$changes" -gt 0 ]]; then
4952
((FIXED_COUNT++)) || true
5053
fi
51-
done < <(find "$REPO_PATH" -type f \( -name "*.sh" -o -name "*.bash" \) -not -path "*/\.git/*" -not -path "*/target/*" -print0 2>/dev/null)
54+
done < <(find "$REPO_PATH" -type f \( -name "*.sh" -o -name "*.bash" \) -not -path "*/.git/*" "${FIND_THIRD_PARTY_EXCLUDES[@]}" -print0 2>/dev/null)
5255

5356
echo ""
5457
if [[ "$FIXED_COUNT" -gt 0 ]]; then

scripts/fix-unpinned-actions.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
set -euo pipefail
66

7+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8+
source "$SCRIPT_DIR/lib/third-party-excludes.sh" 2>/dev/null || true
9+
710
REPO_PATH="$1"
811
FINDING_FILE="$2"
912

scripts/fix-unwrap-to-match.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
set -euo pipefail
1919

20+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
21+
source "$SCRIPT_DIR/lib/third-party-excludes.sh" 2>/dev/null || true
22+
2023
REPO_PATH="${1:?Usage: $0 <repo-path> <finding-json>}"
2124
FINDING_JSON="${2:?Missing finding JSON file}"
2225

@@ -89,8 +92,7 @@ while IFS= read -r -d '' file; do
8992
((TOTAL_REPLACEMENTS += count)) || true
9093

9194
done < <(find "$REPO_PATH" -type f -name "*.rs" \
92-
-not -path "*/\.git/*" \
93-
-not -path "*/target/*" \
95+
-not -path "*/.git/*" "${FIND_THIRD_PARTY_EXCLUDES[@]}" \
9496
-print0 2>/dev/null)
9597

9698
echo ""

0 commit comments

Comments
 (0)