-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (36 loc) · 1.19 KB
/
python_lint.yml
File metadata and controls
37 lines (36 loc) · 1.19 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
34
35
36
37
name: python_lint
on:
workflow_dispatch:
workflow_call:
inputs:
python_version:
type: string
description: "Python version"
required: true
default: "3.11"
jobs:
lint:
if: github.action != 'closed'
runs-on: ubuntu-latest
concurrency:
group: "pr-trigger ${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
timeout-minutes: 5
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ inputs.python_version }}
id: py_setup
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python_version }}
cache: "pip"
- name: Install ruff
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
ruff check --output-format=github --select=E9,F63,F7,F82 --target-version=py311 .
# default set of ruff rules with GitHub Annotations
ruff check --output-format=github --ignore=E402,E501,E712,E731 --target-version=py311 .