cc-safe-setup 28.4.8 → 28.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/auto-approve-docker.sh +1 -0
- package/examples/auto-approve-test.sh +1 -0
- package/examples/auto-compact-prep.sh +19 -8
- package/examples/auto-git-checkpoint.sh +1 -0
- package/examples/backup-before-refactor.sh +1 -0
- package/examples/branch-naming-convention.sh +1 -0
- package/examples/check-accessibility.sh +1 -0
- package/examples/check-aria-labels.sh +1 -0
- package/examples/check-charset-meta.sh +1 -0
- package/examples/check-cookie-flags.sh +1 -0
- package/examples/check-cors-config.sh +1 -0
- package/examples/check-csp-headers.sh +1 -0
- package/examples/check-csrf-protection.sh +1 -0
- package/examples/check-dependency-age.sh +1 -0
- package/examples/check-dependency-license.sh +1 -0
- package/examples/check-dockerfile-best-practice.sh +1 -0
- package/examples/check-error-boundaries.sh +1 -0
- package/examples/check-error-handling.sh +1 -0
- package/examples/check-error-message.sh +1 -0
- package/examples/check-error-stack.sh +1 -0
- package/examples/check-favicon.sh +1 -0
- package/examples/check-git-hooks-compat.sh +1 -0
- package/examples/check-gitattributes.sh +1 -0
- package/examples/check-https-redirect.sh +1 -0
- package/examples/check-input-validation.sh +1 -0
- package/examples/check-lang-attribute.sh +1 -0
- package/examples/check-npm-scripts-exist.sh +1 -0
- package/examples/check-package-size.sh +1 -0
- package/examples/check-port-availability.sh +1 -0
- package/examples/check-rate-limiting.sh +1 -0
- package/examples/check-return-types.sh +1 -0
- package/examples/check-semantic-versioning.sh +1 -0
- package/examples/check-test-naming.sh +1 -0
- package/examples/check-tls-version.sh +1 -0
- package/examples/check-viewport-meta.sh +1 -0
- package/examples/claudemd-enforcer.sh +1 -0
- package/examples/cors-star-warn.sh +1 -0
- package/examples/docker-volume-guard.sh +1 -0
- package/examples/edit-verify.sh +1 -0
- package/examples/env-naming-convention.sh +1 -0
- package/examples/env-prod-guard.sh +1 -0
- package/examples/env-required-check.sh +1 -0
- package/examples/file-size-limit.sh +1 -0
- package/examples/git-hook-bypass-guard.sh +1 -0
- package/examples/git-merge-conflict-prevent.sh +1 -0
- package/examples/git-message-length.sh +1 -0
- package/examples/git-submodule-guard.sh +1 -0
- package/examples/git-tag-guard.sh +1 -0
- package/examples/gitignore-check.sh +1 -0
- package/examples/log-level-guard.sh +1 -0
- package/examples/max-file-count-guard.sh +1 -0
- package/examples/max-file-delete-count.sh +1 -0
- package/examples/max-function-length.sh +1 -0
- package/examples/max-import-count.sh +1 -0
- package/examples/max-subagent-count.sh +1 -0
- package/examples/mcp-tool-guard.sh +1 -0
- package/examples/no-absolute-import.sh +1 -0
- package/examples/no-alert-confirm-prompt.sh +1 -0
- package/examples/no-anonymous-default-export.sh +1 -0
- package/examples/no-any-type.sh +1 -0
- package/examples/no-assignment-in-condition.sh +1 -0
- package/examples/no-callback-hell.sh +1 -0
- package/examples/no-circular-dependency.sh +1 -0
- package/examples/no-cleartext-storage.sh +1 -0
- package/examples/no-commented-code.sh +1 -0
- package/examples/no-commit-fixup.sh +1 -0
- package/examples/no-console-assert.sh +1 -0
- package/examples/no-console-error-swallow.sh +1 -0
- package/examples/no-console-in-prod.sh +1 -0
- package/examples/no-console-log.sh +1 -0
- package/examples/no-console-time.sh +1 -0
- package/examples/no-curl-upload.sh +1 -0
- package/examples/no-dangerouslySetInnerHTML.sh +1 -0
- package/examples/no-debug-in-commit.sh +1 -0
- package/examples/no-deep-nesting.sh +1 -0
- package/examples/no-default-credentials.sh +1 -0
- package/examples/no-disabled-test.sh +1 -0
- package/examples/no-document-write.sh +1 -0
- package/examples/no-empty-function.sh +1 -0
- package/examples/no-eval-in-template.sh +1 -0
- package/examples/no-eval.sh +1 -0
- package/examples/no-exec-user-input.sh +1 -0
- package/examples/no-floating-promises.sh +1 -0
- package/examples/no-force-install.sh +1 -0
- package/examples/no-git-rebase-public.sh +1 -0
- package/examples/no-global-state.sh +1 -0
- package/examples/no-hardcoded-port.sh +1 -0
- package/examples/no-hardcoded-url.sh +1 -0
- package/examples/no-helmet-missing.sh +1 -0
- package/examples/no-http-without-https.sh +1 -0
- package/examples/no-inline-style.sh +1 -0
- package/examples/no-innerhtml.sh +1 -0
- package/examples/no-install-global.sh +1 -0
- package/examples/no-jwt-in-url.sh +1 -0
- package/examples/no-large-commit.sh +1 -0
- package/examples/no-localhost-expose.sh +1 -0
- package/examples/no-magic-number.sh +1 -0
- package/examples/no-md5-sha1.sh +1 -0
- package/examples/no-mixed-line-endings.sh +1 -0
- package/examples/no-mutation-in-reducer.sh +1 -0
- package/examples/no-nested-ternary.sh +1 -0
- package/examples/no-network-exfil.sh +1 -0
- package/examples/no-open-redirect.sh +1 -0
- package/examples/no-package-downgrade.sh +1 -0
- package/examples/no-package-lock-edit.sh +1 -0
- package/examples/no-path-join-user-input.sh +1 -0
- package/examples/no-port-bind.sh +1 -0
- package/examples/no-process-exit.sh +1 -0
- package/examples/no-prototype-pollution.sh +1 -0
- package/examples/no-push-without-ci.sh +1 -0
- package/examples/no-raw-password-in-url.sh +1 -0
- package/examples/no-root-write.sh +1 -0
- package/examples/no-secrets-in-logs.sh +1 -0
- package/examples/no-sensitive-log.sh +1 -0
- package/examples/no-sleep-in-hooks.sh +1 -0
- package/examples/no-string-concat-sql.sh +1 -0
- package/examples/no-sudo-guard.sh +1 -0
- package/examples/no-sync-fs.sh +1 -0
- package/examples/no-todo-in-merge.sh +1 -0
- package/examples/no-todo-without-issue.sh +1 -0
- package/examples/no-unused-import.sh +1 -0
- package/examples/no-var-keyword.sh +1 -0
- package/examples/no-wildcard-cors.sh +1 -0
- package/examples/no-wildcard-delete.sh +1 -0
- package/examples/no-wildcard-import.sh +1 -0
- package/examples/no-with-statement.sh +1 -0
- package/examples/no-write-outside-src.sh +1 -0
- package/examples/no-xml-external-entity.sh +1 -0
- package/examples/npm-audit-warn.sh +1 -0
- package/examples/npm-publish-guard.sh +1 -0
- package/examples/npm-script-injection.sh +1 -0
- package/examples/package-json-guard.sh +1 -0
- package/examples/pr-description-check.sh +1 -0
- package/examples/prefer-const.sh +1 -0
- package/examples/prefer-optional-chaining.sh +1 -0
- package/examples/rate-limit-guard.sh +1 -0
- package/examples/readme-exists-check.sh +1 -0
- package/examples/session-state-saver.sh +1 -0
- package/examples/session-summary.sh +1 -0
- package/examples/skill-gate.sh +1 -0
- package/examples/sql-injection-detect.sh +1 -0
- package/examples/subagent-budget-guard.sh +1 -0
- package/examples/test-before-commit.sh +1 -0
- package/examples/timezone-guard.sh +1 -0
- package/examples/usage-warn.sh +1 -0
- package/examples/write-test-ratio.sh +1 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
COMMAND=$(cat | jq -r '.tool_input.command // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$COMMAND" ] && exit 0
|
|
3
4
|
if echo "$COMMAND" | grep -qE '^\s*(npm\s+test|npm\s+run\s+test|npx\s+(jest|vitest|mocha|ava|tap|playwright\s+test|cypress\s+run)|yarn\s+test|pnpm\s+test|bun\s+test)\b'; then
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# ================================================================
|
|
3
|
+
# auto-compact-prep.sh — Save checkpoint before context compaction
|
|
4
|
+
# ================================================================
|
|
5
|
+
# PURPOSE:
|
|
6
|
+
# Tracks tool call count per session. When threshold is reached,
|
|
7
|
+
# saves a checkpoint file with git state so Claude can recover
|
|
8
|
+
# context after automatic compaction.
|
|
9
|
+
#
|
|
10
|
+
# TRIGGER: PreToolUse MATCHER: ""
|
|
11
|
+
#
|
|
12
|
+
# CONFIG:
|
|
13
|
+
# CC_COMPACT_PREP_THRESHOLD=200 (save checkpoint after N tool calls)
|
|
14
|
+
# ================================================================
|
|
15
|
+
|
|
1
16
|
INPUT=$(cat)
|
|
2
17
|
STATE_DIR="${HOME}/.claude"
|
|
3
18
|
COUNTER_FILE="${STATE_DIR}/session-call-count"
|
|
@@ -5,15 +20,11 @@ PREP_FLAG="${STATE_DIR}/compact-prep-done"
|
|
|
5
20
|
CHECKPOINT=".claude/pre-compact-checkpoint.md"
|
|
6
21
|
COUNT=0
|
|
7
22
|
[ -f "$COUNTER_FILE" ] && COUNT=$(cat "$COUNTER_FILE" 2>/dev/null || echo 0)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
else
|
|
12
|
-
COUNT=$((COUNT + 1))
|
|
13
|
-
echo "$COUNT" > "$COUNTER_FILE"
|
|
14
|
-
fi
|
|
23
|
+
COUNT=$((COUNT + 1))
|
|
24
|
+
echo "$COUNT" > "$COUNTER_FILE"
|
|
25
|
+
|
|
15
26
|
THRESHOLD=${CC_COMPACT_PREP_THRESHOLD:-200}
|
|
16
|
-
if
|
|
27
|
+
if [ "$COUNT" -ge "$THRESHOLD" ] && [ ! -f "$PREP_FLAG" ]; then
|
|
17
28
|
mkdir -p "$(dirname "$CHECKPOINT")" 2>/dev/null
|
|
18
29
|
BRANCH=$(git branch --show-current 2>/dev/null || echo "?")
|
|
19
30
|
DIRTY=$(git status --porcelain 2>/dev/null | wc -l)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
echo "$CONTENT" | grep -qE "<(button|a|input)[^>]*>" && ! echo "$CONTENT" | grep -q "aria-" && echo "NOTE: Interactive element without ARIA" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
echo "$CONTENT" | grep -qE "setCookie|res\.cookie" && ! echo "$CONTENT" | grep -q "secure" && echo "NOTE: Cookie without secure flag" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
echo "$CONTENT" | grep -qE "Content-Security-Policy" || (echo "$CONTENT" | grep -q "helmet" && echo "NOTE: Consider adding CSP headers" >&2)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
echo "$CONTENT" | grep -qE "<form.*method.*POST" && ! echo "$CONTENT" | grep -qE "csrf|_token|csrfmiddleware" && echo "NOTE: Form without CSRF protection" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
COMMAND=$(cat | jq -r ".tool_input.command // empty" 2>/dev/null); echo "$COMMAND" | grep -qE "npm\s+install\s+\w" && echo "NOTE: Check dependency license before adding" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
echo "$CONTENT" | grep -qE "class.*extends.*Component|function.*\(\)" && echo "$CONTENT" | grep -q "render" && ! echo "$CONTENT" | grep -q "ErrorBoundary" && echo "NOTE: Consider adding ErrorBoundary" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
echo "$CONTENT" | grep -qE "throw new Error\(['\"](error|Error|something went wrong)" && echo "NOTE: Generic error message — be specific" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
# TRIGGER: PreToolUse MATCHER: "Bash"
|
|
2
3
|
COMMAND=$(cat | jq -r ".tool_input.command // empty" 2>/dev/null)
|
|
3
4
|
echo "$COMMAND" | grep -qE "git\s+add.*\.(zip|tar|bin|exe)" && [ ! -f ".gitattributes" ] && echo "NOTE: Binary file without .gitattributes LFS config" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
echo "$CONTENT" | grep -qE "http://" && echo "$CONTENT" | grep -q "redirect" && ! echo "$CONTENT" | grep -q "https" && echo "NOTE: HTTP redirect without HTTPS" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
echo "$CONTENT" | grep -qE "req\.(body|query|params)\.\w+" && ! echo "$CONTENT" | grep -qE "validate|sanitize|Joi|zod|yup" && echo "NOTE: User input without validation" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
FILE=$(cat | jq -r ".tool_input.file_path // empty" 2>/dev/null); case "$FILE" in *package.json) ;; *) exit 0;; esac; echo "$CONTENT" | grep -qE "npm run [a-z]+" && echo "NOTE: Verify referenced npm scripts exist" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
COMMAND=$(cat | jq -r ".tool_input.command // empty" 2>/dev/null); echo "$COMMAND" | grep -qE "listen\(|--port|:3000|:8080" && echo "NOTE: Check port availability before starting server" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
echo "$CONTENT" | grep -qE "app\.(get|post|put|delete)\(" && ! echo "$CONTENT" | grep -q "rateLimit" && echo "NOTE: API endpoint without rate limiting" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
echo "$CONTENT" | grep -qE "function\s+\w+\([^)]*\)\s*{" && ! echo "$CONTENT" | grep -q ": " && echo "NOTE: Missing return type annotation" >&2
|
package/examples/edit-verify.sh
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
echo "$CONTENT" | grep -qE "process\.env\.\w+\s*\|\|" || echo "$CONTENT" | grep -qE "process\.env\.\w+!" && echo "NOTE: Env var without default — add fallback" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
COMMAND=$(cat | jq -r '.tool_input.command // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$COMMAND" ] && exit 0
|
|
3
4
|
echo "$COMMAND" | grep -qE "git\s+commit\s+-m" || exit 0; MSG=$(echo "$COMMAND" | grep -oP "(?<=-m\s[\x27\x22])[^\x27\x22]+"); [ ${#MSG} -lt 10 ] && echo "WARNING: Commit message too short (${#MSG} chars)" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
COMMAND=$(cat | jq -r '.tool_input.command // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$COMMAND" ] && exit 0
|
|
3
4
|
if echo "$COMMAND" | grep -qE "^\s*rm\b"; then COUNT=$(echo "$COMMAND" | tr " " "\n" | grep -cvE "^-" | head -1); [ "$COUNT" -gt 5 ] && echo "WARNING: Deleting $COUNT files at once" >&2; fi
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
IMPORTS=$(echo "$CONTENT" | grep -cE "^(import|from|require)" || echo 0); [ "$IMPORTS" -gt 20 ] && echo "NOTE: $IMPORTS imports — consider splitting module" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
COMMAND=$(cat | jq -r '.tool_input.command // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$COMMAND" ] && exit 0
|
|
3
4
|
STATE="/tmp/cc-subagent-count"; C=$(cat "$STATE" 2>/dev/null || echo 0); echo $((C+1)) > "$STATE"; [ "$C" -gt 5 ] && echo "WARNING: $C subagents spawned this session" >&2
|
package/examples/no-any-type.sh
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
echo "$CONTENT" | grep -qE "localStorage\.setItem.*password|sessionStorage.*token" && echo "WARNING: Storing secrets in browser storage" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
COMMENTED=$(echo "$CONTENT" | grep -cE "^\s*(//|#)\s*(if|for|while|function|const|let|var|import|class)" || echo 0); [ "$COMMENTED" -gt 5 ] && echo "NOTE: Large block of commented code — delete or uncomment" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
if echo "$CONTENT" | grep -qE "catch\s*\([^)]*\)\s*\{[\s\n]*\}|except:[\s\n]*pass"; then echo "WARNING: Empty catch/except block swallows errors" >&2; fi
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
FILE=$(cat | jq -r ".tool_input.file_path // empty" 2>/dev/null); case "$FILE" in *test*|*spec*) exit 0;; esac; echo "$CONTENT" | grep -qE "console\.(log|warn)" && echo "NOTE: console statement in non-test file" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
DEPTH=$(echo "$CONTENT" | awk "{n=0; for(i=1;i<=length;i++) if(substr(\$0,i,1)==\"{\") n++; if(n>m) m=n} END{print m}"); [ "$DEPTH" -gt 4 ] && echo "NOTE: Deep nesting ($DEPTH levels)" >&2
|
package/examples/no-eval.sh
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$CONTENT" ] && exit 0
|
|
3
4
|
echo "$CONTENT" | grep -qE "^\s+\w+\.\w+\(" && echo "$CONTENT" | grep -q "await\|\.then\|\.catch" || echo "$CONTENT" | grep -qE "async" && echo "NOTE: Check for unhandled promises" >&2
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/bin/bash
|
|
1
2
|
COMMAND=$(cat | jq -r '.tool_input.command // empty' 2>/dev/null)
|
|
2
3
|
[ -z "$COMMAND" ] && exit 0
|
|
3
4
|
if echo "$COMMAND" | grep -qE "git\s+rebase" && git log --oneline origin/$(git branch --show-current 2>/dev/null) 2>/dev/null | head -1 | grep -q .; then echo "WARNING: Rebasing pushed branch" >&2; fi
|