Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,39 @@ jobs:
pip install setuptools==69.5.1 wheel
pip install -r requirements.txt

# Static analysis tools
- name: Install static analysis tools
if: runner.os == 'Linux'
run: |
pip install mypy==1.8.0
pip install flake8==7.0.0
pip install black==24.1.1

- name: Run static code analysis
if: runner.os == 'Linux'
run: |
# Critical checks
mypy_output=$(mypy lean/ \
--ignore-missing-imports \
--check-untyped-defs \
--show-error-codes \
--no-error-summary 2>&1 || true)

if echo "$mypy_output" | grep -q -E "Missing positional argument|\[call-arg\]"; then
echo "ERROR: Missing function arguments detected:"
echo ""
echo "$mypy_output" | grep -E "Missing positional argument|\[call-arg\]"
echo ""
echo "When adding/removing parameters from methods, ensure all call sites are updated."
exit 1
fi

flake8 lean/ --select=F821 --ignore=ALL

# Warning checks (don't fail the build)
flake8 lean/ --select=F401 --ignore=ALL --exit-zero
black --check lean/ --quiet || true

- name: Run tests
run: python -m pytest -s -rs

Expand Down
Loading