-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (45 loc) · 1.52 KB
/
python_lint.yml
File metadata and controls
53 lines (45 loc) · 1.52 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: python linting
on:
workflow_call:
inputs:
python_version:
required: true
type: string
jobs:
python_linting:
name: python linting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python_version }}
- name: Setup uv
uses: astral-sh/setup-uv@v7
- name: ruff
run: uvx ruff check .
# This is an opinionated list of disabled warnings.
# It potentially makes sense to eventually remove
# this in favor of a per-project configuration but
# a lot of these will be useless in most projects
# that will take advantage of this workflow.
# C0114: missing-module-docstring
# C0115: missing-class-docstring
# C0116: missing-function-docstring
# C0301: line-too-long
# C0302: too-many-lines
# R0801: duplicate-code
# R0902: too-many-instance-attributes
# R0903: too-few-public-methods
# R0911: too-many-returns
# R0912: too-many-branches
# R0913: too-many-arguments
# R0914: too-many-locals
# R0915: too-many-statements
# W1509: subprocess-popen-preexec-fn
- name: pylint
run: uvx pylint --disable C0114,C0115,C0116,C0301,C0302,R0801,R0902,R0903,R0911,R0912,R0913,R0914,R0915,W1509 --jobs $(nproc) $(git ls-files '*.py')
- name: yapf
run: uvx yapf --diff --recursive $GITHUB_WORKSPACE