Skip to content
Closed
Show file tree
Hide file tree
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
48 changes: 48 additions & 0 deletions .github/workflows/auto-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Auto-format with Nox

on:
pull_request:
branches:
- main

permissions:
contents: write

jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.A2A_BOT_PAT }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Nox
run: pip install nox

- name: Run Nox formatting session
run: nox -s format

- name: Check for changes and commit if any
id: commit_changes
run: |
git config user.name "a2a-bot"
git config user.email "a2a-bot@google.com"

# Check if there are any changes after running Nox
if [ -n "$(git status --porcelain)" ]; then
echo "::notice file=./.github/workflows/auto-format.yml::Formatting changes detected. Committing..."
git add .
git commit -m "chore(format): Auto-format code with Nox"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
echo "changes_committed=true" >> "$GITHUB_OUTPUT"
else
echo "No formatting changes detected. Repository is clean."
echo "changes_committed=false" >> "$GITHUB_OUTPUT"
fi
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def format(session):
if format_all:
lint_paths_py = ['.']
else:
target_branch = 'origin/main'
target_branch = 'main'

unstaged_files = subprocess.run(
[
Expand Down
1 change: 1 addition & 0 deletions src/a2a/server/request_handlers/request_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class RequestHandler(ABC):
provide to handle incoming JSON-RPC requests.
"""


@abstractmethod
async def on_get_task(
self,
Expand Down