-
-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (32 loc) · 990 Bytes
/
flake8-lint.yml
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
34
35
36
37
38
39
40
name: Lint and Fix
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 autopep8
- name: Run flake8
continue-on-error: true
run: |
flake8 .
- name: Run autopep8
run: |
autopep8 --in-place --aggressive --aggressive --recursive . --max-line-length 200
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git diff-index --quiet HEAD || git commit -m 'Automatically fix code style issues with autopep8'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}