refactor: remove all inline comments from code
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
#!/bin/bash
|
||||
# Pre-commit hook: Validate commit message and check for cache files
|
||||
|
||||
set -e
|
||||
|
||||
# Get commit message file
|
||||
COMMIT_MSG_FILE="$1"
|
||||
if [ -z "$COMMIT_MSG_FILE" ]; then
|
||||
# If called without args, check staged changes for cache files
|
||||
echo "Checking for cache files in staged changes..."
|
||||
|
||||
CACHE_FILES=$(git diff --cached --name-only | grep -E "__pycache__|\.pyc$|\.pyo$" || true)
|
||||
@@ -26,10 +23,8 @@ if [ -z "$COMMIT_MSG_FILE" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Validate commit message format
|
||||
COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")
|
||||
|
||||
# Pattern: type: lowercase description (max 50 chars, no period)
|
||||
if ! echo "$COMMIT_MSG" | grep -qE "^(feat|fix|docs|style|refactor|test|chore): [a-z].{0,49}$"; then
|
||||
echo "❌ Invalid commit message format!"
|
||||
echo ""
|
||||
@@ -60,7 +55,6 @@ if ! echo "$COMMIT_MSG" | grep -qE "^(feat|fix|docs|style|refactor|test|chore):
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for period at end
|
||||
if echo "$COMMIT_MSG" | grep -qE "\.$"; then
|
||||
echo "❌ Commit message should not end with a period"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user