SPB Git

Repository Public

check.sh 1.3 KB 21 lines shellscript

1#!/usr/bin/env bash2# ORIX Sonata3# File: Scripts/check.sh4# Description: Repository hygiene: every first-party source file carries the ORIX Sonata header, no credential or audio file is tracked, no placeholder marker is left in shipped code.5#6# Author: Simon-Pierre Boucher7# Contact: contact@spboucher.ai8set -euo pipefail9cd "$(dirname "$0")/.."10FAIL=011while IFS= read -r f; do12  case "$f" in13    *.json|*.lock|*.png|*.xcstrings|*/Contents.json|Tests/golden/*|*.keep|Apps/ORIXSonata/Info.plist|Cargo.lock) continue ;;14  esac15  if ! head -12 "$f" | grep -q "Simon-Pierre Boucher"; then echo "missing header: $f"; FAIL=1; fi16  if ! head -12 "$f" | grep -q "ORIX Sonata"; then echo "missing project name: $f"; FAIL=1; fi17done < <(git ls-files | grep -E '\.(rs|swift|sh|toml|yml|md|h|ebnf|sonata|py|entitlements)$')18if git ls-files | grep -E '\.(p12|p8|cer|mobileprovision|wav|aiff|flac|mp3|m4a)$|(^|/)\.env'; then echo "tracked file that must not be in the repository"; FAIL=1; fi19if git grep -nE 'todo!\(|unimplemented!\(|fatalError\("TODO|not linked into this build' -- 'crates/*/src' 'Packages/*/Sources' 'Apps' | grep -v 'fatalError("not used")'; then echo "placeholder left in shipped code"; FAIL=1; fi20[[ $FAIL -eq 0 ]] && echo "check: ok ($(git ls-files | wc -l | tr -d ' ') tracked files)" || exit 121
Files main
Menu

Theme