-
-
Notifications
You must be signed in to change notification settings - Fork 14
33 lines (26 loc) · 1.07 KB
/
python-format.yml
File metadata and controls
33 lines (26 loc) · 1.07 KB
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
33
# 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 and lint with flake8
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 flake8
- name: Run black and flake8
uses: wearerequired/lint-action@v1
with:
black: true
flake8: true
black_args: "--line-length 79 --exclude='1_beginner/chapter1/examples/error.py'" # same max line length as flake8
flake8_args: "--max-line-length=88 --ignore=E203,W503 --exclude=1_beginner/chapter1/examples/error.py" # prevent conflicts with black
auto_fix: true # auto commit style fixes