Skip to content

Commit af8f396

Browse files
fix(ci): rsr-antipattern duplicate heredoc + setup-beam ubuntu24 (#15)
**rsr-antipattern.yml**: deletes the orphan duplicate Python script (lines 274-428) that escapes the heredoc and exits 127. Mirrors hyperpolymath/rsr-template-repo#39. **hypatia-scan.yml**: bumps `erlef/setup-beam` SHA from `2f0cc07b…` to `fc68ffb9…` so `ImageOS=ubuntu24` resolves to `ubuntu-24.04` (matches the pin in hyperpolymath/hypatia upstream). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent b2ad142 commit af8f396

2 files changed

Lines changed: 8 additions & 82 deletions

File tree

.github/workflows/hypatia-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
fetch-depth: 0 # Full history for better pattern analysis
3030

3131
- name: Setup Elixir for Hypatia scanner
32-
uses: erlef/setup-beam@2f0cc07b4b9bea248ae098aba9e1a8a1de5ec24c # v1.18.2
32+
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.18.2
3333
with:
3434
elixir-version: '1.19.4'
3535
otp-version: '28.3'

.github/workflows/rsr-antipattern.yml

Lines changed: 7 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
# Enforces: No TypeScript, No Go, No Python (except SaltStack), No npm
66
# Allows: ReScript, Deno, WASM, Rust, OCaml, Haskell, Guile/Scheme
77

8-
permissions:
9-
contents: read
10-
118
name: RSR Anti-Pattern Check
129

1310
on:
@@ -16,11 +13,17 @@ on:
1613
pull_request:
1714
branches: [main, master, develop]
1815

16+
17+
permissions:
18+
contents: read
19+
1920
jobs:
2021
antipattern-check:
2122
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
2225
steps:
23-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
26+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2427

2528
- name: Check for TypeScript
2629
run: |
@@ -135,83 +138,6 @@ jobs:
135138
print(f"✅ No TypeScript files outside allowlist ({len(exemption_patterns)} per-repo exemption(s) parsed).")
136139
PYEOF
137140
138-
# Universal builtin allowlist — bridges that need no per-repo declaration.
139-
# Files matching any of these patterns are always allowed.
140-
BUILTIN_GLOBS = [
141-
'*.d.ts',
142-
'**/bindings/**',
143-
'**/tests/**', '**/test/**',
144-
'**/scripts/**',
145-
'**/mcp-adapter/**',
146-
'**/*vscode*/**',
147-
'**/cli/**',
148-
'**/mod.ts',
149-
'**/lsp-server.ts', '**/lsp_server.ts', '**/lsp.ts', '**/*-lsp.ts',
150-
'**/deno-*/**',
151-
'**/node_modules/**',
152-
'**/vendor/**',
153-
'**/examples/**',
154-
'**/ffi/**',
155-
]
156-
157-
# Per-repo exemptions parsed from .claude/CLAUDE.md "TypeScript Exemptions" table.
158-
# Single source of truth — adding a row here unblocks CI for that path.
159-
# Format expected:
160-
# ### TypeScript Exemptions ...
161-
# | Path | Files | Rationale | Unblock condition |
162-
# |---|---|---|---|
163-
# | `path/to/file.ts` | 1 | ... | ... |
164-
# | `dir/*.ts` | 6 | ... | ... |
165-
exemptions = []
166-
claude_md = pathlib.Path('.claude/CLAUDE.md')
167-
if claude_md.exists():
168-
in_table = False
169-
for line in claude_md.read_text(encoding='utf-8').splitlines():
170-
if re.search(r'TypeScript [Ee]xemptions', line):
171-
in_table = True
172-
continue
173-
if in_table and line.startswith(('### ', '## ', '# ')):
174-
break
175-
if in_table and line.startswith('|'):
176-
m = re.match(r'\|\s*`([^`]+)`', line)
177-
if m:
178-
exemptions.append(m.group(1))
179-
180-
# Find all .ts and .tsx files
181-
found = []
182-
for ext in ('ts', 'tsx'):
183-
found.extend(str(p) for p in pathlib.Path('.').rglob(f'*.{ext}'))
184-
185-
def allowed(path):
186-
p = path.lstrip('./')
187-
for g in BUILTIN_GLOBS + exemptions:
188-
if fnmatch.fnmatchcase(p, g):
189-
return True
190-
# also treat glob ending with / as a directory prefix
191-
base = g.rstrip('/').rstrip('*').rstrip('/')
192-
if base and (p == base or p.startswith(base + '/')):
193-
return True
194-
return False
195-
196-
bad = sorted(f for f in found if not allowed(f))
197-
if bad:
198-
print("❌ TypeScript files detected outside the allowlist.\n")
199-
for f in bad:
200-
print(f" {f}")
201-
print()
202-
print("To resolve, either:")
203-
print(" (a) migrate the file to AffineScript")
204-
print(" (see Human_Programming_Guide.adoc migration chapter), OR")
205-
print(" (b) move it to an allowlisted bridge path")
206-
print(" (bindings/, tests/, scripts/, mcp-adapter/, *vscode*/, cli/, deno-*/, etc.), OR")
207-
print(" (c) add an entry to the 'TypeScript Exemptions' table in .claude/CLAUDE.md")
208-
print(" with rationale + unblock condition.")
209-
if exemptions:
210-
print(f"\n(Currently {len(exemptions)} exemption(s) parsed from .claude/CLAUDE.md.)")
211-
sys.exit(1)
212-
print(f"✅ No TypeScript files outside allowlist ({len(exemptions)} per-repo exemption(s) parsed).")
213-
PYEOF
214-
215141
- name: Check for Go
216142
run: |
217143
if find . -name "*.go" | grep -q .; then

0 commit comments

Comments
 (0)