Skip to content

Commit ee4cc06

Browse files
committed
fix(ci): dune fmt + antipattern-check BUILTIN_GLOBS crash
- dune (root): add blank line after comment before (dirs) stanza — dune fmt required it, causing all PR builds to fail the @fmt check - rsr-antipattern.yml: remove orphaned second Python block that leaked into bash after the first PYEOF closed the heredoc; bash was trying to execute BUILTIN_GLOBS as a command (exit 127) on every PR run
1 parent 9c90b63 commit ee4cc06

2 files changed

Lines changed: 1 addition & 77 deletions

File tree

.github/workflows/rsr-antipattern.yml

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

dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
; Exclude vendored/snapshot subtrees that ship their own dune-project so the
22
; outer workspace does not see duplicate package definitions.
3+
34
(dirs :standard \ faces .build)

0 commit comments

Comments
 (0)