|
38 | 38 |
|
39 | 39 | - name: Validate A2ML manifests |
40 | 40 | if: steps.detect.outputs.count > 0 |
41 | | - uses: hyperpolymath/a2ml-validate-action@f37988274b7a14291908aeb3c89210d77c35740b # main |
| 41 | + uses: hyperpolymath/a2ml-validate-action@main |
42 | 42 | with: |
43 | 43 | path: '.' |
44 | 44 | strict: 'false' |
|
86 | 86 |
|
87 | 87 | - name: Validate K9 contracts |
88 | 88 | if: steps.detect.outputs.k9_count > 0 |
89 | | - uses: hyperpolymath/k9-validate-action@216bbfafd95a2dc534774bba354711843c6ac2d1 # main |
| 89 | + uses: hyperpolymath/k9-validate-action@main |
90 | 90 | with: |
91 | 91 | path: '.' |
92 | 92 | strict: 'false' |
@@ -120,40 +120,39 @@ jobs: |
120 | 120 | - name: Checkout repository |
121 | 121 | uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
122 | 122 |
|
123 | | - - name: Setup Deno |
124 | | - uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2 |
125 | | - with: |
126 | | - deno-version: v2.x |
127 | | - |
128 | | - - name: Clone and run empty-linter |
| 123 | + - name: Scan for invisible characters |
129 | 124 | id: lint |
130 | 125 | run: | |
131 | | - git clone --depth 1 https://github.com/hyperpolymath/empty-linter.git "$HOME/empty-linter" 2>/dev/null || true |
132 | | - if [ -f "$HOME/empty-linter/deno.json" ]; then |
133 | | - cd "$HOME/empty-linter" |
134 | | - # Build ReScript output if needed |
135 | | - if [ -f "rescript.json" ]; then |
136 | | - deno task build 2>/dev/null || true |
137 | | - fi |
138 | | - set +e |
139 | | - deno run --allow-read src/cli/Main.res.js "$GITHUB_WORKSPACE" > /tmp/empty-lint-results.txt 2>&1 |
140 | | - EL_EXIT=$? |
141 | | - set -e |
142 | | - FINDINGS=$(wc -l < /tmp/empty-lint-results.txt) |
143 | | - echo "findings=$FINDINGS" >> "$GITHUB_OUTPUT" |
144 | | - echo "exit_code=$EL_EXIT" >> "$GITHUB_OUTPUT" |
145 | | - echo "ready=true" >> "$GITHUB_OUTPUT" |
146 | | -
|
147 | | - # Emit annotations |
148 | | - while IFS= read -r line; do |
149 | | - if echo "$line" | grep -q ':'; then |
150 | | - echo "::warning::$line" |
151 | | - fi |
152 | | - done < /tmp/empty-lint-results.txt |
153 | | - else |
154 | | - echo "::notice::empty-linter not available — skipping" |
155 | | - echo "ready=false" >> "$GITHUB_OUTPUT" |
156 | | - fi |
| 126 | + # Inline invisible character detection (from empty-linter's core patterns). |
| 127 | + # Checks for: zero-width spaces, zero-width joiners, BOM, soft hyphens, |
| 128 | + # non-breaking spaces, null bytes, and other invisible Unicode in source files. |
| 129 | + set +e |
| 130 | + 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' |
| 131 | + find "$GITHUB_WORKSPACE" \ |
| 132 | + -not -path '*/.git/*' -not -path '*/node_modules/*' \ |
| 133 | + -not -path '*/.deno/*' -not -path '*/target/*' \ |
| 134 | + -not -path '*/_build/*' -not -path '*/deps/*' \ |
| 135 | + -not -path '*/external_corpora/*' -not -path '*/.lake/*' \ |
| 136 | + -type f \( -name '*.rs' -o -name '*.ex' -o -name '*.exs' -o -name '*.res' \ |
| 137 | + -o -name '*.js' -o -name '*.ts' -o -name '*.json' -o -name '*.toml' \ |
| 138 | + -o -name '*.yml' -o -name '*.yaml' -o -name '*.md' -o -name '*.adoc' \ |
| 139 | + -o -name '*.idr' -o -name '*.zig' -o -name '*.v' -o -name '*.jl' \ |
| 140 | + -o -name '*.gleam' -o -name '*.hs' -o -name '*.ml' -o -name '*.sh' \) \ |
| 141 | + -exec grep -Prl "$PATTERNS" {} \; > /tmp/empty-lint-results.txt 2>/dev/null |
| 142 | + EL_EXIT=$? |
| 143 | + set -e |
| 144 | +
|
| 145 | + FINDINGS=$(wc -l < /tmp/empty-lint-results.txt 2>/dev/null || echo 0) |
| 146 | + echo "findings=$FINDINGS" >> "$GITHUB_OUTPUT" |
| 147 | + echo "exit_code=$EL_EXIT" >> "$GITHUB_OUTPUT" |
| 148 | + echo "ready=true" >> "$GITHUB_OUTPUT" |
| 149 | +
|
| 150 | + # Emit annotations for each file with invisible chars |
| 151 | + while IFS= read -r filepath; do |
| 152 | + [ -z "$filepath" ] && continue |
| 153 | + REL_PATH="${filepath#$GITHUB_WORKSPACE/}" |
| 154 | + echo "::warning file=${REL_PATH}::Invisible Unicode characters detected (zero-width space, BOM, NBSP, etc.)" |
| 155 | + done < /tmp/empty-lint-results.txt |
157 | 156 |
|
158 | 157 | - name: Write summary |
159 | 158 | run: | |
|
0 commit comments