Skip to content

Commit e5343b9

Browse files
authored
ci: Add ruff, mypy, clang-format lints (#4)
1 parent 7bb5cd3 commit e5343b9

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/lint.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
10+
jobs:
11+
ruff:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 20
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Ruff check
17+
uses: astral-sh/ruff-action@v2
18+
with:
19+
version: 0.9.7
20+
args: "check --verbose"
21+
- name: Ruff format
22+
uses: astral-sh/ruff-action@v2
23+
with:
24+
version: 0.9.7
25+
args: "format --check --verbose"
26+
27+
mypy:
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 20
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Mypy
33+
run: |
34+
python3 -m pip install torch==2.6.0 --index-url https://download.pytorch.org/whl/cpu
35+
python3 -m pip install mypy==1.15.0 pytest==8.3.4 numpy
36+
python3 -m mypy src/ tests/
37+
38+
clang-format:
39+
runs-on: ubuntu-latest
40+
timeout-minutes: 20
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Clang format
44+
run: |
45+
find csrc -type f -regex '.*\.\(h\|cpp\|cuh\|cu\)' -exec clang-format-16 --dry-run -Werror {} +

0 commit comments

Comments
 (0)