-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.33 KB
/
reusable-linting.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
41
42
43
44
45
46
47
48
49
50
51
52
name: reusable-linting-pipeline
on:
workflow_call:
inputs:
has_main_file:
required: false
type: boolean
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
checks: write
issues: read
pull-requests: write
jobs:
RuffLinting:
name: Linting with ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Lint with Ruff
run: |
pip install ruff
ruff check --output-format=github .
continue-on-error: false
Flake8Linting:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Check syntax with py_compile
if: ${{ inputs.has_main_file }}
run: python -m py_compile app/main.py
continue-on-error: false
- name: Install linters
run: |
pip install flake8
- name: Check formatting
run: |
python -m flake8
continue-on-error: false