-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcheck_dogfood.sh
More file actions
executable file
·48 lines (40 loc) · 1.32 KB
/
check_dogfood.sh
File metadata and controls
executable file
·48 lines (40 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
set -euo pipefail
# Dogfooding script for "check" command of ruff-sync
#
# This script "dogfoods" ruff-sync by checking if this project's own pyproject.toml
# is in sync with the upstream repository.
#
# Usage:
# ./scripts/dogfood_check.sh [upstream_url]
#
# Default upstream:
# https://github.com/Kilo59/ruff-sync
DEFAULT_UPSTREAM="https://github.com/Kilo59/ruff-sync"
UPSTREAM=${1:-$DEFAULT_UPSTREAM}
echo "🐶 Dogfooding ruff-sync check..."
echo "🔗 Comparing with upstream: $UPSTREAM"
echo "📂 Target: ./pyproject.toml"
echo ""
# Ensure we are in the project root
cd "$(dirname "$0")/.."
# Check if we have uncommitted changes in pyproject.toml
if ! git diff --quiet pyproject.toml; then
echo "⚠️ Note: You have uncommitted changes in pyproject.toml. These will be included in the check."
echo ""
fi
# Run the check command via uv
# This will return 0 if in sync, 1 if out of sync
set +e
uv run python ruff_sync.py check "$UPSTREAM" --semantic -v
EXIT_CODE=$?
set -e
echo ""
if [ $EXIT_CODE -eq 0 ]; then
echo "✅ Dogfooding check: Ruff configuration is in sync."
else
echo "❌ Dogfooding check: Ruff configuration is out of sync."
fi
echo "--------------------------------------------------"
echo "✨ Dogfooding check complete!"
echo "--------------------------------------------------"