Skip to content

Commit 614f4a4

Browse files
committed
add lint.yml with ruff, ruff-format, ruff-isort, and mypy checks
1 parent 7bb9465 commit 614f4a4

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/lint.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Code Quality
2+
on:
3+
push:
4+
branches: ["master"]
5+
pull_request:
6+
branches: ["master"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
concurrency:
12+
# Cancel previous actions from the same PR or branch except 'master' branch.
13+
# See https://docs.github.com/en/actions/using-jobs/using-concurrency and https://docs.github.com/en/actions/learn-github-actions/contexts for more info.
14+
group: concurrency-group::${{ github.workflow }}::${{ github.event.pull_request.number > 0 && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}${{ github.ref_name == 'master' && format('::{0}', github.run_id) || ''}}
15+
cancel-in-progress: ${{ github.ref_name != 'master' }}
16+
17+
jobs:
18+
ruff-format:
19+
needs: []
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: chartboost/ruff-action@v1
24+
with:
25+
version: 0.3.5
26+
args: 'format --check'
27+
28+
ruff-isort:
29+
needs: [ ]
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: chartboost/ruff-action@v1
34+
with:
35+
version: 0.3.5
36+
args: '--select I'
37+
38+
ruff:
39+
needs: []
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v3
43+
- uses: chartboost/ruff-action@v1
44+
with:
45+
version: 0.3.5
46+
# Only run ruff on changed files
47+
changed-files: 'true'
48+
49+
mypy:
50+
needs: []
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v3
54+
- uses: actions/setup-python@v4
55+
with:
56+
python-version: '3.9'
57+
- run: pip install mypy==1.5.1
58+
- run: mypy

0 commit comments

Comments
 (0)