-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
137 lines (118 loc) · 4.04 KB
/
Copy pathlinting.yml
File metadata and controls
137 lines (118 loc) · 4.04 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
---
name: Linting
on: [pull_request]
permissions: {}
jobs:
pre-commit:
name: precommit
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0
with:
extra-args: --hook-stage manual --all-files --skip oxipng
# Only run oxipng on the last diff, because we haven't updated all images.
- uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0
with:
extra-args: --hook-stage manual --from-ref origin/${{ github.base_ref }} oxipng
ruff:
name: ruff
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python 3
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
- name: Install ruff
run: pip3 install ruff
- name: Set up reviewdog
uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0
- name: Run ruff
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -o pipefail
ruff check --output-format rdjson | \
reviewdog -f=rdjson \
-tee -reporter=github-check -filter-mode nofilter
mypy:
name: mypy
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python 3
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
- name: Install mypy
run: pip3 install --group build --group typing
- name: Set up reviewdog
uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0
- name: Run mypy
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -o pipefail
mypy --config pyproject.toml | \
reviewdog -f=mypy -name=mypy \
-tee -reporter=github-check -filter-mode nofilter
clang-tidy:
name: clang-tidy (macOS / Objective-C)
runs-on: macos-latest # run on macOS so we can lint the objectiveC file
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python 3
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.14'
- name: Install OS dependencies
run: brew install llvm
- name: Install build dependencies
run: pip3 install meson ninja pybind11 setuptools-scm
- name: Run clang-tidy
run: |
set -o pipefail
LLVM_PREFIX=$(brew --prefix llvm)
export CC=$LLVM_PREFIX/bin/clang
export CXX=$LLVM_PREFIX/bin/clang++
export OBJC=$LLVM_PREFIX/bin/clang
export PATH=$LLVM_PREFIX/bin:$PATH
python tools/run_clang_tidy.py
eslint:
name: eslint
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: eslint
uses: reviewdog/action-eslint@556a3fdaf8b4201d4d74d406013386aa4f7dab96 # v1.34.0
with:
filter_mode: nofilter
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-check
workdir: 'lib/matplotlib/backends/web_backend/'
fail_level: error