-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpull_dogfood.sh
More file actions
executable file
·46 lines (39 loc) · 1.26 KB
/
pull_dogfood.sh
File metadata and controls
executable file
·46 lines (39 loc) · 1.26 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
#!/usr/bin/env bash
set -euo pipefail
# Dogfooding script for ruff-sync
#
# This script "dogfoods" ruff-sync by syncing this project's own pyproject.toml
# with a complex upstream configuration (defaults to Pydantic).
#
# Usage:
# ./scripts/dogfood.sh [upstream_url]
#
# Default upstream:
# https://github.com/pydantic/pydantic
DEFAULT_UPSTREAM="https://github.com/pydantic/pydantic"
UPSTREAM=${1:-$DEFAULT_UPSTREAM}
echo "🐶 Dogfooding ruff-sync..."
echo "🔗 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 "⚠️ Warning: You have uncommitted changes in pyproject.toml."
read -p "Continue anyway? (y/N) " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Aborting."
exit 1
fi
fi
# Run the tool via poetry
uv run python ruff_sync.py "$UPSTREAM" -v
echo ""
echo "✨ Dogfooding run complete!"
echo "--------------------------------------------------"
echo "Next steps:"
echo "1. Inspect the changes: git diff pyproject.toml"
echo "2. Discard when done: git checkout pyproject.toml"
echo "--------------------------------------------------"