From 8f33c607f3ab1562ddb17a69397f693c0fb31090 Mon Sep 17 00:00:00 2001 From: Kenneth Yang <82800265+kjy5@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:22:47 -0700 Subject: [PATCH] chore: Disable fmt push on main (#14) * chore: removed fmt from main * Allow linter to run on main, PR changes instead of direct push on main * Fix linter errors --- .github/workflows/autoformat-and-lint.yml | 13 ++++++++++++- src/vbl_aquarium/models/urchin.py | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/autoformat-and-lint.yml b/.github/workflows/autoformat-and-lint.yml index c27baf7..95afab1 100644 --- a/.github/workflows/autoformat-and-lint.yml +++ b/.github/workflows/autoformat-and-lint.yml @@ -35,11 +35,22 @@ jobs: run: hatch fmt -f - name: ✅ Commit code format changes + if: github.ref != 'refs/heads/main' uses: stefanzweifel/git-auto-commit-action@v5 with: - commit_message: "Autoformat code" + commit_message: "chore: Autoformat code" skip_fetch: true skip_checkout: true + - name: 📤 PR code format changes + if: github.ref == 'refs/heads/main' + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.PR_TOKEN }} + commit-message: "Autoformat code" + title: "chore: Autoformat code" + branch: "autoformat-code" + delete-branch: true + - name: 🔍 Lint run: hatch fmt --check \ No newline at end of file diff --git a/src/vbl_aquarium/models/urchin.py b/src/vbl_aquarium/models/urchin.py index 4d428d0..9af6236 100644 --- a/src/vbl_aquarium/models/urchin.py +++ b/src/vbl_aquarium/models/urchin.py @@ -1,6 +1,7 @@ from __future__ import annotations from enum import Enum + from pydantic import Field from vbl_aquarium.models.unity import Color, Vector2, Vector3