Skip to content

Commit 1f61111

Browse files
committed
Add static code analysis to CI
1 parent 05c3552 commit 1f61111

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,25 @@ jobs:
2525
pip install setuptools==69.5.1 wheel
2626
pip install -r requirements.txt
2727
28+
# Static analysis tools
29+
- name: Install static analysis tools
30+
if: runner.os == 'Linux'
31+
run: |
32+
pip install mypy==1.8.0
33+
pip install flake8==7.0.0
34+
pip install black==24.1.1
35+
36+
- name: Run static code analysis
37+
if: runner.os == 'Linux'
38+
run: |
39+
# Critical checks
40+
mypy lean/ --ignore-missing-imports --check-untyped-defs
41+
flake8 lean/ --select=F821 --ignore=ALL
42+
43+
# Warning checks (don't fail the build)
44+
flake8 lean/ --select=F401 --ignore=ALL --exit-zero
45+
black --check lean/ --quiet || true
46+
2847
- name: Run tests
2948
run: python -m pytest -s -rs
3049

0 commit comments

Comments
 (0)