mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-27 18:22:41 -08:00
chore: archive refactor milestones and remove structural quality-gates task
- Remove structural quality gates task and references from task-27 roadmap. - Remove structural-gates-adjacent work from scripts/positioning cleanup context, including check-main-lines adjustments. - Archive completed backlog tasks 11 and 27.7 by moving them to completed directory. - Finish task-27.5 module split by moving/anonymizing anki-integration and renderer positioning files into their dedicated directories and updating paths.
This commit is contained in:
@@ -1,25 +1,71 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
target="${1:-1500}"
|
||||
file="${2:-src/main.ts}"
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage:
|
||||
./scripts/check-main-lines.sh [target-lines] [file]
|
||||
./scripts/check-main-lines.sh --target <target-lines> --file <path>
|
||||
|
||||
target-lines default: 1500
|
||||
file default: src/main.ts
|
||||
EOF
|
||||
}
|
||||
|
||||
target="1500"
|
||||
file="src/main.ts"
|
||||
|
||||
if (($# == 1)) && [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
||||
usage
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $# -ge 1 && "$1" != --* ]]; then
|
||||
target="$1"
|
||||
if [[ $# -ge 2 ]]; then
|
||||
file="$2"
|
||||
fi
|
||||
shift $(($# > 1 ? 2 : 1))
|
||||
fi
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--target)
|
||||
target="$2"
|
||||
shift 2
|
||||
;;
|
||||
--file)
|
||||
file="$2"
|
||||
shift 2
|
||||
;;
|
||||
--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "[ERROR] Unknown argument: $1" >&2
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ ! -f "$file" ]]; then
|
||||
echo "[ERROR] File not found: $file" >&2
|
||||
exit 1
|
||||
echo "[ERROR] File not found: $file" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ "$target" =~ ^[0-9]+$ ]]; then
|
||||
echo "[ERROR] Target line count must be an integer. Got: $target" >&2
|
||||
exit 1
|
||||
echo "[ERROR] Target line count must be an integer. Got: $target" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
actual="$(wc -l < "$file" | tr -d ' ')"
|
||||
actual="$(wc -l <"$file" | tr -d ' ')"
|
||||
|
||||
echo "[INFO] $file lines: $actual (target: <= $target)"
|
||||
if (( actual > target )); then
|
||||
echo "[ERROR] Line gate failed: $actual > $target" >&2
|
||||
exit 1
|
||||
if ((actual > target)); then
|
||||
echo "[ERROR] Line gate failed: $actual > $target" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[OK] Line gate passed"
|
||||
|
||||
Reference in New Issue
Block a user