forked from code4tomorrow/python
-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (25 loc) · 883 Bytes
/
python-format.yml
File metadata and controls
31 lines (25 loc) · 883 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
# Uses (Lint Action): https://github.com/marketplace/actions/lint-action#supported-tools
# Creates annotations from linting problems
# Autofixes problems if possible (it's a black formatter)
name: Python (Lint Action)
on: pull_request
jobs:
format-lint-python:
name: Format Python with black
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Python dependencies
run: pip install black
- name: Run black
uses: samuelmeuli/lint-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
black: true
black_args: --line-length 79 # same max line length as flake8
auto_fix: true # auto commit style fixes