@financebuddha/standards 0.1.2 → 0.1.3

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.
Files changed (2) hide show
  1. package/husky/pre-commit +9 -8
  2. package/package.json +1 -1
package/husky/pre-commit CHANGED
@@ -10,15 +10,16 @@ if [ ! -f "$PATTERNS" ]; then
10
10
  PATTERNS="$ROOT/node_modules/@financebuddha/standards/secrets-patterns.txt"
11
11
  fi
12
12
 
13
- # Secrets scan on staged changes. Strip comment/blank lines from the patterns
14
- # file first grep -f treats every line (including '# AWS') as a regex, which
15
- # would otherwise match the comments themselves.
13
+ # Secrets scan on staged changes. Build a cleaned patterns file (drop comment/
14
+ # blank lines) and match with `grep -Ef` so each line stays its own regex
15
+ # more robust than inlining patterns into a single `-E` argument. `|| true`
16
+ # guards grep's exit-1-on-no-match from aborting the hook under husky's `set -e`.
16
17
  if [ -f "$PATTERNS" ]; then
17
- # `|| true` guards grep's exit-1-on-no-match from aborting the hook under
18
- # husky's `set -e`.
19
- CLEAN=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$PATTERNS" || true)
20
- if [ -n "$CLEAN" ]; then
21
- SECRETS=$(git diff --cached -U0 | grep -E "$CLEAN" 2>/dev/null || true)
18
+ CLEAN_FILE=$(mktemp)
19
+ trap 'rm -f "$CLEAN_FILE"' EXIT
20
+ grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$PATTERNS" > "$CLEAN_FILE" || true
21
+ if [ -s "$CLEAN_FILE" ]; then
22
+ SECRETS=$(git diff --cached -U0 | grep -Ef "$CLEAN_FILE" 2>/dev/null || true)
22
23
  if [ -n "$SECRETS" ]; then
23
24
  echo "❌ Possible secrets detected in staged changes:"
24
25
  echo "$SECRETS"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financebuddha/standards",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Shared engineering standards: ESLint, TypeScript, Prettier, commitlint, secrets scanning, and Claude skills",
5
5
  "type": "module",
6
6
  "license": "MIT",