From a8e0ec0a9592236830384027ccf5dd08ffba85eb Mon Sep 17 00:00:00 2001 From: Travis Halsey Date: Tue, 20 Jan 2026 20:17:25 -0500 Subject: [PATCH 1/3] ci: add black auto-format workflow note: will add configuration to pyproject.toml if needed in later commit. for now set the line for black in format.yml directly. --- .github/workflows/format.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 000000000..a783f72ff --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,36 @@ +name: Auto-format with Black + +on: + push: + branches: [ master, main ] + pull_request: + +jobs: + format: + if: github.actor != 'github-actions[bot]' + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install Black + # Pinned to match pyproject.toml + run: pip install black==25.12.0 + + - name: Run Black + # Enforce 120 char limit per CONTRIBUTING.md + run: black . --line-length 120 + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "style: auto-format with black" + branch: ${{ github.head_ref }} \ No newline at end of file From b856d57d14d9cb8a81fc4b95e4f6412414eb1e44 Mon Sep 17 00:00:00 2001 From: Travis Halsey Date: Tue, 20 Jan 2026 20:41:56 -0500 Subject: [PATCH 2/3] fix: point checkout to fork repository --- .github/workflows/format.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index a783f72ff..22e3ddd0c 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -14,6 +14,8 @@ jobs: steps: - uses: actions/checkout@v4 with: + # TELL THE ROBOT TO LOOK AT THE FORK, NOT THE MAIN REPO + repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.head_ref }} - name: Set up Python From 0fa42a15f65dd914f438a47f5286590c0d7c3bc6 Mon Sep 17 00:00:00 2001 From: Travis Halsey Date: Tue, 20 Jan 2026 20:59:05 -0500 Subject: [PATCH 3/3] fix:exclude generated files --- .github/workflows/format.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 22e3ddd0c..a3633df7e 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -14,7 +14,6 @@ jobs: steps: - uses: actions/checkout@v4 with: - # TELL THE ROBOT TO LOOK AT THE FORK, NOT THE MAIN REPO repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.head_ref }} @@ -24,12 +23,10 @@ jobs: python-version: '3.12' - name: Install Black - # Pinned to match pyproject.toml run: pip install black==25.12.0 - name: Run Black - # Enforce 120 char limit per CONTRIBUTING.md - run: black . --line-length 120 + run: black . --line-length 120 --exclude '.*_pb2.pyi?$' - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v5