forked from hardbyte/python-can
-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (30 loc) · 789 Bytes
/
format-code.yml
File metadata and controls
32 lines (30 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Format Code
on:
push:
paths:
- '**.py'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-lint.txt
- name: Code Format Check with Black
run: |
black --verbose .
- name: Commit Formated Code
uses: EndBug/add-and-commit@v5
env:
# This is necessary in order to push a commit to the repo
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: "Format code with black"
# Ref https://git-scm.com/docs/git-add#_examples
add: './*.py'