Python/.github/workflows/pre-commit.yml
Christian Clauss b8a19ccfea
GitHub Actions: fast-fail on black formatting issues (#4268)
* GitHub Actions: fast-fail on black formatting issues

Give fast feedback to contributors https://github.com/psf/black#github-actions

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-03-20 10:39:56 +05:30

23 lines
632 B
YAML

name: pre-commit
on: [push, pull_request]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cache/pre-commit
~/.cache/pip
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- uses: actions/setup-python@v2
- uses: psf/black@stable
- name: Install pre-commit
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pre-commit
- run: pre-commit run --verbose --all-files --show-diff-on-failure