#!/bin/bash # Format Python code with Black and isort # Run this script after making manual edits to maintain CI compliance set -e echo "🔧 Formatting Python code..." cd app # Install formatting tools if not present echo "📦 Ensuring formatting tools are installed..." python -m pip install black isort --quiet # Format code with Black echo "🎨 Running Black formatter..." python -m black stiftung core # Sort imports with isort echo "📋 Sorting imports with isort..." python -m isort stiftung core # Verify formatting echo "✅ Verifying formatting..." if python -m black --check stiftung core > /dev/null 2>&1; then echo "✅ Black formatting: PASSED" else echo "❌ Black formatting: FAILED" exit 1 fi if python -m isort --check-only stiftung core > /dev/null 2>&1; then echo "✅ Import sorting: PASSED" else echo "❌ Import sorting: FAILED" exit 1 fi echo "🎉 Code formatting complete! Ready for commit." echo "" echo "Next steps:" echo " git add ." echo " git commit -m 'Your descriptive commit message'" echo " git push origin main"