Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions autoformat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you follow this file to update it: https://github.com/google/adk-python/blob/main/autoformat.sh

#
# This script runs the auto-formatters (isort and pyink)
# to fix code style and import order.

set -e

if ! command -v isort &> /dev/null
then
echo "isort not found, refer to CONTRIBUTING.md to set up dev environment first."
exit
fi

if ! command -v pyink &> /dev/null
then
echo "pyink not found, refer to CONTRIBUTING.md to set up dev environment first."
exit
fi


echo '---------------------------------------'
echo '| Organizing imports for src/...'
echo '---------------------------------------'

isort src/
echo 'All done! ✨ 🍰 ✨'

echo '---------------------------------------'
echo '| Organizing imports for tests/...'
echo '---------------------------------------'

isort tests/
echo 'All done! ✨ 🍰 ✨'



echo '---------------------------------------'
echo '| Auto-formatting src/...'
echo '---------------------------------------'

find -L src/ -not -path "*/.*" -type f -name "*.py" -exec pyink --config pyproject.toml {} +

echo '---------------------------------------'
echo '| Auto-formatting tests/...'
echo '---------------------------------------'

find -L tests/ -not -path "*/.*" -type f -name "*.py" -exec pyink --config pyproject.toml {} +


echo "Formatting complete."