Skip to content

Lint_security_review

FieldValue
TypeSkill Resource
Source~/.copilot/skills/security/scripts/lint_security_review.sh
DescriptionNot specified

Source Content

#!/usr/bin/env bash
# Validate a security-review Markdown doc's structural completeness: every
# finding must carry a severity rating, a reproduction/impact description,
# and a remediation. Pure text parsing (python3 stdlib, no deps) — there is
# no external CLI for "does this review doc have complete findings", so this
# check is 100% custom regex/text parsing, honestly labeled as such below.
#
# Usage:
# lint_security_review.sh [security-review.md]
#
# Example:
# scripts/lint_security_review.sh ./security-review.md
set -uo pipefail
DOC="${1:-./security-review.md}"
fail=0
warn() { printf '⚠️ %s\n' "$1"; }
error() { printf '❌ %s\n' "$1"; fail=1; }
ok() { printf '✅ %s\n' "$1"; }
if [[ ! -f "$DOC" ]]; then
echo "Usage: $0 <security-review.md>" >&2
exit 2
fi
echo "== finding-completeness check (python3 stdlib text parsing — no external CLI exists for this) =="
py_out=$(python3 "$(dirname "$0")/lint_security_review.py" "$DOC")
py_status=$?
while IFS= read -r line; do
case "$line" in
OK::*) ok "${line#OK::}" ;;
ERROR::*) error "${line#ERROR::}" ;;
*) [[ -n "$line" ]] && echo "$line" ;;
esac
done <<< "$py_out"
if [[ "$py_status" -ne 0 ]]; then
fail=1
fi
echo
if [[ "$fail" -eq 0 ]]; then
echo "All checks passed."
else
echo "One or more checks failed — see ❌ lines above."
fi
exit "$fail"