-
Notifications
You must be signed in to change notification settings - Fork 14
41 lines (34 loc) · 1.05 KB
/
pep8.yaml
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
41
name: PEP8 linter
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
linter:
strategy:
matrix:
python: [ "3.10" ]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: "0"
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install -U pycodestyle
- name: run pep8check @pull_request
if: ${{ github.event_name == 'pull_request' }}
run: |
git diff -U0 origin/${GITHUB_BASE_REF}..${GITHUB_SHA} | pycodestyle --diff --format='::error file=%(path)s,line=%(row)d,col=%(col)d::%(code)s: %(text)s'
- name: run pep8check @push
if: ${{ github.event_name == 'push' }}
run: |
git show -U0 ${GITHUB_SHA} | pycodestyle --diff --format='::error file=%(path)s,line=%(row)d,col=%(col)d::%(code)s: %(text)s'