Skip to content

Commit

Permalink
CI: Auto-apply black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedThree committed Jul 26, 2023
1 parent d1cd1db commit d296804
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 36 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: black

on:
pull_request:
paths:
- '**.py'

defaults:
run:
shell: bash

jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install black
run: |
python -m pip install --upgrade pip
pip install black
- name: Version
run: |
python --version
black --version
- name: Run black
run: |
black xbout
black docs
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Apply black formatting"
18 changes: 0 additions & 18 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,3 @@ jobs:
# run: |
# pip install flake8
# flake8


black:

runs-on: ubuntu-latest
if: always()

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Check formatting with black
run: |
pip install black
black --check .
18 changes: 0 additions & 18 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,3 @@ jobs:
# run: |
# pip install flake8
# flake8


black:

runs-on: ubuntu-latest
if: always()

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Check formatting with black
run: |
pip install black
black --check .

0 comments on commit d296804

Please sign in to comment.