From 243d5e906acd435e4966b358b2bff77febbe26d1 Mon Sep 17 00:00:00 2001 From: John Vouvakis Manousakis Date: Fri, 21 Jun 2024 20:53:03 -0700 Subject: [PATCH] Update workflow Can't automatically format code in a PR. Will instead ask contributors to format their code if the workflow fails. For code that is pushed, the auto-formatting workflow works, so we keep it. --- .github/workflows/format_and_lint_pr.yaml | 19 +++++++++++++++++++ ...nd_lint.yaml => format_and_lint_push.yaml} | 1 - 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/format_and_lint_pr.yaml rename .github/workflows/{format_and_lint.yaml => format_and_lint_push.yaml} (98%) diff --git a/.github/workflows/format_and_lint_pr.yaml b/.github/workflows/format_and_lint_pr.yaml new file mode 100644 index 000000000..e3564e376 --- /dev/null +++ b/.github/workflows/format_and_lint_pr.yaml @@ -0,0 +1,19 @@ +name: Format and lint code +on: + pull_request: +permissions: + contents: write +jobs: + format_and_lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Run Black + uses: psf/black@stable + - name: Run Flake8 + run: flake8 . diff --git a/.github/workflows/format_and_lint.yaml b/.github/workflows/format_and_lint_push.yaml similarity index 98% rename from .github/workflows/format_and_lint.yaml rename to .github/workflows/format_and_lint_push.yaml index dc7bce268..6bf9fb380 100644 --- a/.github/workflows/format_and_lint.yaml +++ b/.github/workflows/format_and_lint_push.yaml @@ -1,7 +1,6 @@ name: Format and lint code on: push: - pull_request: permissions: contents: write jobs: