Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Black autoformat

on:
push:
branches:
- "**"
paths:
- "ultraplot/**.py"
- "ultraplot/**.pyi"
- ".github/workflows/black.yml"
- ".pre-commit-config.yaml"
- "pyproject.toml"

permissions:
contents: write

concurrency:
group: black-${{ github.ref }}
cancel-in-progress: false

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.ref_name }}

- uses: actions/setup-python@v7
with:
python-version: "3.14"

- name: Install Black
run: python -m pip install black==26.5.1

- name: Format Python files
run: black ultraplot

- name: Commit formatting changes
run: |
if git diff --quiet -- '*.py' '*.pyi'; then
echo "Black made no changes."
exit 0
fi

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add --update -- '*.py' '*.pyi'
git commit -m "Apply Black formatting"
git push
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ci:
autofix_prs: false
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: monthly
skip: []
skip: [black]
submodules: false

repos:
Expand Down