Skip to content

Commit 508deaa

Browse files
committed
Add new GitHub workflows
Lintly to submit code reviews for flake8 Lint Action to auto format for black
1 parent f841e3d commit 508deaa

File tree

5 files changed

+60
-67
lines changed

5 files changed

+60
-67
lines changed

.github/disabled-workflows/formatter.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/pull_request.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/push.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Uses (Lint Action): https://github.com/marketplace/actions/lint-action#supported-tools
2+
# Creates annotations from linting problems
3+
# Autofixes problems if possible (it's a black formatter)
4+
name: Python (Lint Action)
5+
6+
on: pull_request
7+
8+
jobs:
9+
format-lint-python:
10+
name: Format Python with black
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Check out Git repository
15+
uses: actions/checkout@v2
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.x'
21+
22+
- name: Install Python dependencies
23+
run: pip install black
24+
25+
- name: Run black
26+
uses: samuelmeuli/lint-action@v1
27+
with:
28+
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
black: true
30+
auto_fix: true # auto commit style fixes

.github/workflows/python-lint.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
# Uses (Lint Action): https://github.com/marketplace/actions/lint-action#supported-tools
3+
# Submits code reviews based on flake8 output
4+
name: Python (Lintly)
5+
6+
on: pull_request
7+
8+
jobs:
9+
lint-python:
10+
name: Lint Python with flake8
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Check out Git repository
15+
uses: actions/checkout@v2
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: '3.x'
21+
22+
# Install flake8 and lintly
23+
- name: Install Python dependencies
24+
run: pip install flake8 lintly
25+
26+
# Run Lintly with flake8
27+
- name: Lint with flake8
28+
run: flake8 | lintly --commit-sha=${{ github.event.pull_request.head.sha }} --format=flake8
29+
env:
30+
LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)