chore: migrate legacy pre-commit hook to .pre-commit-config.yaml
Replaces shell script (.git/hooks/pre-commit.legacy) with ecosystem-managed pre-commit framework: - gitleaks/gitleaks: secret scanning - jumanjihouse/pre-commit-hooks: shellcheck wrapper - pre-commit/pre-commit-hooks: JSON/YAML validation, end-of-file-fixer, trailing-whitespace - local hooks: SKILL.md frontmatter validation Uses pinned versions for reproducibility across environments. Includes auto-fixes from hook runs (formatting, trailing whitespace, JSON beautification). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Sets secure file permissions on ~/.context/config.json.
|
||||
# Run after every `context auth add` to protect stored credentials.
|
||||
# Safe to run when the file does not exist yet.
|
||||
|
||||
CONFIG="${HOME}/.context/config.json"
|
||||
|
||||
if [ ! -f "$CONFIG" ]; then
|
||||
echo "Skipped: ${CONFIG} does not exist — no permissions to set."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
chmod 600 "$CONFIG"
|
||||
echo "Secured: ${CONFIG} set to 600 (owner read/write only)."
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Installs @neuledge/context globally at a pinned version.
|
||||
# Usage: setup-neuledge-context.sh [VERSION]
|
||||
# VERSION — npm version string (default: 1.2.0)
|
||||
# Idempotent: skips install if already at the target version.
|
||||
|
||||
TARGET_VERSION="${1:-1.2.0}"
|
||||
|
||||
current_version() {
|
||||
context --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || echo ""
|
||||
}
|
||||
|
||||
CURRENT="$(current_version)"
|
||||
|
||||
if [ "$CURRENT" = "$TARGET_VERSION" ]; then
|
||||
echo "Already at @neuledge/context@${TARGET_VERSION} — nothing to do."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -n "$CURRENT" ]; then
|
||||
echo "Upgrading @neuledge/context from ${CURRENT} to ${TARGET_VERSION}..."
|
||||
else
|
||||
echo "Installing @neuledge/context@${TARGET_VERSION}..."
|
||||
fi
|
||||
|
||||
npm install -g "@neuledge/context@${TARGET_VERSION}"
|
||||
|
||||
INSTALLED="$(current_version)"
|
||||
if [ "$INSTALLED" = "$TARGET_VERSION" ]; then
|
||||
echo "Done: @neuledge/context@${TARGET_VERSION} installed."
|
||||
else
|
||||
echo "Error: expected version ${TARGET_VERSION} but got '${INSTALLED}'" >&2
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user