Skip to content

Commit 097dfdf

Browse files
wkdgus1164claude
andcommitted
fix: ruff format 적용 및 pre-commit hook에 format 검사 추가
변경사항: - src/ureca_document_parser/__init__.py: ruff format 적용 - scripts/hooks/pre-commit: ruff format --check 추가 이제 pre-commit hook이 체크하는 항목: 1. ruff check (린트 검사) 2. ruff format --check (포맷 검사) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 4e52df4 commit 097dfdf

2 files changed

Lines changed: 25 additions & 8 deletions

File tree

scripts/hooks/pre-commit

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
2-
# Git pre-commit hook - Runs ruff check before allowing commit
2+
# Git pre-commit hook - Runs ruff check and format before allowing commit
33

4-
echo "🔍 Running ruff check on staged Python files..."
4+
echo "🔍 Running ruff checks on staged Python files..."
55

66
# Get list of staged Python files
77
PYTHON_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.pyi?$' || true)
@@ -13,17 +13,35 @@ fi
1313

1414
echo "Checking files:"
1515
echo "$PYTHON_FILES" | sed 's/^/ - /'
16+
echo ""
1617

1718
# Run ruff check on staged files
18-
if uv run ruff check $PYTHON_FILES; then
19-
echo "✓ Ruff check passed!"
20-
exit 0
21-
else
19+
echo "1️⃣ Running ruff check..."
20+
if ! uv run ruff check $PYTHON_FILES; then
2221
echo ""
2322
echo "❌ Ruff check failed!"
2423
echo ""
2524
echo "Fix the errors above or:"
2625
echo " - Run: uv run ruff check --fix src/"
27-
echo " - Skip check: git commit --no-verify"
26+
echo " - Skip hook: git commit --no-verify"
2827
exit 1
2928
fi
29+
echo "✓ Ruff check passed!"
30+
echo ""
31+
32+
# Run ruff format check on staged files
33+
echo "2️⃣ Running ruff format check..."
34+
if ! uv run ruff format --check $PYTHON_FILES; then
35+
echo ""
36+
echo "❌ Ruff format check failed!"
37+
echo ""
38+
echo "Fix the formatting:"
39+
echo " - Run: uv run ruff format src/"
40+
echo " - Skip hook: git commit --no-verify"
41+
exit 1
42+
fi
43+
echo "✓ Ruff format check passed!"
44+
echo ""
45+
46+
echo "🎉 All checks passed!"
47+
exit 0

src/ureca_document_parser/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
__all__ = [
3232
# Main API
3333
"convert",
34-
3534
# Exceptions
3635
"ParseError",
3736
]

0 commit comments

Comments
 (0)