Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
38 changes: 38 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Quality

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

jobs:
duplication:
name: Duplication (jscpd)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: >
npx --yes jscpd .
--threshold 3
--reporters consoleFull
--ignore "**/target/**,**/_build/**,**/node_modules/**,**/dist/**,**/*.lock,src/parser.c,src/grammar.json,src/node-types.json"
file-size:
name: File size
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: bash scripts/check-file-size.sh

typos:
name: Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
21 changes: 21 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Security

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

jobs:
secrets:
name: Secret scan (TruffleHog)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: trufflesecurity/trufflehog@main
with:
extra_args: --only-verified
18 changes: 18 additions & 0 deletions scripts/check-file-size.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Fails when a tracked source file exceeds the size ceiling.
# Guideline: target ~300 lines per file; hard ceiling 800 before splitting.
set -euo pipefail
LIMIT="${FILE_SIZE_LIMIT:-800}"
fail=0
while IFS= read -r f; do
[ -f "$f" ] || continue
lines=$(wc -l < "$f")
if [ "$lines" -gt "$LIMIT" ]; then
echo "::error file=$f::$f has $lines lines (limit $LIMIT)"
fail=1
fi
done < <(git ls-files \
'*.ml' '*.mli' '*.rs' '*.ts' '*.js' '*.go' '*.py' '*.java' \
| grep -vE '(^|/)(target|_build|node_modules|dist)/' || true)
[ "$fail" -eq 0 ] && echo "All source files within the $LIMIT-line ceiling."
exit "$fail"
Loading