Add black code formatter to continuous integration

This commit is contained in:
Zach Borboa
2023-07-01 10:10:38 -07:00
parent efe4f69683
commit 75673eed43
+23
View File
@@ -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 }}