Skip to content

ci(antipattern): allowlist legit TS bridge/adapter paths #68

ci(antipattern): allowlist legit TS bridge/adapter paths

ci(antipattern): allowlist legit TS bridge/adapter paths #68

Workflow file for this run

# SPDX-License-Identifier: PMPL-1.0-or-later
name: RSR Language Policy
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
check-banned-patterns:
name: Check for banned languages/patterns
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Check for TypeScript
run: |
# Allowlist (TS legitimate as a bridge/adapter to a non-ReScript ecosystem):
# bindings/ - language bindings (Deno/TS/AssemblyScript FFI to ReScript core)
# *.d.ts - TypeScript type declarations for ReScript FFI
# tests/, test/ - Deno test runners verifying ReScript output
# scripts/ - Deno build scripts (bundle, dev-server, etc.)
# mcp-adapter/ - MCP server adapters (MCP protocol is Deno/TS-typed by spec)
# vscode/ - VSCode extensions (TS is the ecosystem default)
TS_FILES=$(find . \( -name "*.ts" -o -name "*.tsx" \) \
| grep -v node_modules \
| grep -v '/bindings/' \
| grep -v '\.d\.ts$' \
| grep -v '/tests/' \
| grep -v '/test/' \
| grep -v '/scripts/' \
| grep -v '/mcp-adapter/' \
| grep -v '/vscode/' \
|| true)
if [ -n "$TS_FILES" ]; then
echo "❌ TypeScript files detected - use ReScript instead"
echo "$TS_FILES"
exit 1
fi
echo "✅ No TypeScript files outside allowlisted bridge/adapter paths"
- name: Check for Go
run: |
if find . -name "*.go" | grep -q .; then
echo "::error::Go files found! Use Rust instead (per RSR policy)"
exit 1
fi
echo "✓ No Go files found"
- name: Check for npm/Node artifacts
run: |
if [ -f "package-lock.json" ] || [ -d "node_modules" ]; then
echo "::error::npm artifacts found! Use Deno instead (per RSR policy)"
exit 1
fi
echo "✓ No npm artifacts found"
- name: Check for Python (non-SaltStack)
run: |
banned_py=$(find . -name "*.py" | grep -v -E "(salt|pillar|states|_modules|_states)" | head -1)
if [ -n "$banned_py" ]; then
echo "::error::Python files found outside SaltStack! Use ReScript/Rust (per RSR policy)"
exit 1
fi
echo "✓ No banned Python files found"
- name: Check for Makefiles
run: |
if [ -f "Makefile" ] || [ -f "makefile" ] || find . -name "*.mk" | grep -q .; then
echo "::error::Makefile found! Use Justfile or Mustfile instead (per RSR policy)"
exit 1
fi
echo "✓ No Makefiles found"