Skip to content

Commit eb8afec

Browse files
committed
Add GitHub Actions for black
This GitHub Action checks that code in pull request is formatted with black. See https://black.readthedocs.io/en/stable/github_actions.html
1 parent d114c8c commit eb8afec

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/black.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This is a workflow to format Python code with black formatter
2+
3+
name: black
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
branches: [master]
10+
pull_request:
11+
branches: [master]
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
# This workflow contains a single job called "black"
16+
black:
17+
# The type of runner that the job will run on
18+
runs-on: ubuntu-latest
19+
20+
# Steps represent a sequence of tasks that will be executed as part of the job
21+
steps:
22+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23+
- uses: actions/checkout@v2
24+
# Set up a Python environment for use in actions
25+
- uses: actions/setup-python@v2
26+
27+
# Run black code formatter
28+
- uses: psf/black@stable

0 commit comments

Comments
 (0)