|
| 1 | +# SPDX-License-Identifier: AGPL-3.0-or-later |
1 | 2 | # RSR Anti-Pattern CI Check |
2 | | -# SPDX-License-Identifier: MPL-2.0 |
| 3 | +# SPDX-License-Identifier: AGPL-3.0-or-later |
3 | 4 | # |
4 | 5 | # Enforces: No TypeScript, No Go, No Python (except SaltStack), No npm |
5 | 6 | # Allows: ReScript, Deno, WASM, Rust, OCaml, Haskell, Guile/Scheme |
6 | 7 |
|
7 | 8 | name: RSR Anti-Pattern Check |
8 | | -permissions: read-all |
9 | 9 |
|
10 | 10 | on: |
11 | 11 | push: |
12 | 12 | branches: [main, master, develop] |
13 | 13 | pull_request: |
14 | 14 | branches: [main, master, develop] |
15 | 15 |
|
| 16 | + |
| 17 | +permissions: read-all |
| 18 | + |
16 | 19 | jobs: |
17 | 20 | antipattern-check: |
18 | 21 | runs-on: ubuntu-latest |
| 22 | + permissions: |
| 23 | + contents: read |
19 | 24 | steps: |
20 | | - - uses: actions/checkout@v6 |
| 25 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
21 | 26 |
|
22 | 27 | - name: Check for TypeScript |
23 | 28 | run: | |
24 | | - if find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules | grep -q .; then |
| 29 | + # Exclude bindings/deno/ - those are Deno FFI files using Deno.dlopen, not plain TypeScript |
| 30 | + # Exclude .d.ts files - those are TypeScript type declarations for ReScript FFI |
| 31 | + TS_FILES=$(find . \( -name "*.ts" -o -name "*.tsx" \) | grep -v node_modules | grep -v 'bindings/deno' | grep -v '\.d\.ts$' || true) |
| 32 | + if [ -n "$TS_FILES" ]; then |
25 | 33 | echo "❌ TypeScript files detected - use ReScript instead" |
26 | | - find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules |
| 34 | + echo "$TS_FILES" |
27 | 35 | exit 1 |
28 | 36 | fi |
29 | | - echo "✅ No TypeScript files" |
| 37 | + echo "✅ No TypeScript files (Deno FFI bindings excluded)" |
30 | 38 |
|
31 | 39 | - name: Check for Go |
32 | 40 | run: | |
|
0 commit comments