Skip to content

Commit 7282b2a

Browse files
fix(ci): rsr-antipattern.yml duplicate heredoc (#25)
**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. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 540ab33 commit 7282b2a

1 file changed

Lines changed: 8 additions & 78 deletions

File tree

.github/workflows/rsr-antipattern.yml

Lines changed: 8 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
12
# RSR Anti-Pattern CI Check
2-
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
# SPDX-License-Identifier: PMPL-1.0-or-later
34
#
45
# Enforces: No TypeScript, No Go, No Python (except SaltStack), No npm
56
# Allows: ReScript, Deno, WASM, Rust, OCaml, Haskell, Guile/Scheme
@@ -12,9 +13,15 @@ on:
1213
pull_request:
1314
branches: [main, master, develop]
1415

16+
17+
permissions:
18+
contents: read
19+
1520
jobs:
1621
antipattern-check:
1722
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
1825
steps:
1926
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2027

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

0 commit comments

Comments
 (0)