|
4 | 4 | REPO_ROOT="$(git rev-parse --show-toplevel)" |
5 | 5 | GITHOOKS_DIR="$REPO_ROOT/.githooks" |
6 | 6 |
|
7 | | -# Check for changes in Python files |
8 | | -python_changed_files=($(git diff --name-only --diff-filter=ACM | grep '^python/' || true)) |
9 | | - |
10 | | -echo "Changed Python files:" |
11 | | -echo " ${python_changed_files[*]}" |
| 7 | +echo "========================================" |
| 8 | +echo " Pre-Push Checks" |
| 9 | +echo "========================================" |
12 | 10 | echo |
13 | 11 |
|
| 12 | +# Check for changes in Python files |
| 13 | +# Compare against the remote branch being pushed to |
| 14 | +python_changed_files=($(git diff --name-only --diff-filter=ACM @{upstream}... | grep '^python/' || true)) |
| 15 | + |
| 16 | +echo "→ Python files changed:" |
14 | 17 | if [[ -n "$python_changed_files" ]]; then |
15 | | - echo "Python files changed, running Python formatting and linting..." |
| 18 | + echo " ${python_changed_files[*]}" |
| 19 | + echo |
| 20 | + echo " [1/3] Formatting and linting..." |
16 | 21 | bash "$GITHOOKS_DIR/pre-push-python/fmt-lint.sh" |
17 | 22 |
|
18 | | - echo "Running Python stub checks..." |
| 23 | + echo " [2/3] Stub generation..." |
19 | 24 | bash "$GITHOOKS_DIR/pre-push-python/stubs.sh" |
20 | 25 |
|
21 | | - echo "Running Python extras checks..." |
| 26 | + echo " [3/3] Extras validation..." |
22 | 27 | bash "$GITHOOKS_DIR/pre-push-python/extras.sh" |
| 28 | + echo |
| 29 | +else |
| 30 | + echo " (none)" |
| 31 | + echo |
23 | 32 | fi |
24 | 33 |
|
25 | 34 | # Check for changes in Rust bindings files |
26 | | -bindings_changed_files=($(git diff --name-only --diff-filter=ACM | grep '^rust/crates/sift_stream_bindings/src/' || true)) |
27 | | - |
28 | | -echo |
29 | | -echo "Changed SiftStream Python bindings files:" |
30 | | -echo " ${bindings_changed_files[*]}" |
31 | | -echo |
| 35 | +bindings_changed_files=($(git diff --name-only --diff-filter=ACM @{upstream}... | grep '^rust/crates/sift_stream_bindings/src/' || true)) |
32 | 36 |
|
| 37 | +echo "→ Rust binding files changed:" |
33 | 38 | if [[ -n "$bindings_changed_files" ]]; then |
34 | | - echo "Rust bindings files changed, running Rust stub checks..." |
| 39 | + echo " ${bindings_changed_files[*]}" |
| 40 | + echo |
| 41 | + echo " [1/1] Stub generation..." |
35 | 42 | bash "$GITHOOKS_DIR/pre-push-rust/stubs.sh" |
| 43 | + echo |
| 44 | +else |
| 45 | + echo " (none)" |
| 46 | + echo |
36 | 47 | fi |
37 | 48 |
|
38 | | -echo "Pre-push checks completed successfully." |
| 49 | +echo "========================================" |
| 50 | +echo " ✓ All checks passed" |
| 51 | +echo "========================================" |
39 | 52 |
|
0 commit comments