From 75673eed4378aa9d50f342c4c12c6e989300f5aa Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 1 Jul 2023 10:10:38 -0700 Subject: [PATCH] Add black code formatter to continuous integration --- .github/workflows/black.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/black.yml diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml new file mode 100644 index 0000000..11d0bd2 --- /dev/null +++ b/.github/workflows/black.yml @@ -0,0 +1,23 @@ +name: Black code formatter + +on: + pull_request: + +jobs: + black: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install black + run: pip install black + + - name: Get changed python files + id: changed-files + uses: tj-actions/changed-files@v37 + with: + files: "**/*.py" + + - name: Check changed files + if: steps.changed-files.outputs.any_changed == 'true' + run: black --check --color --diff --quiet ${{ steps.changed-files.outputs.all_changed_files }}