Skip to content

Merge pull request #4 from sbryngelson/tracers #52

Merge pull request #4 from sbryngelson/tracers

Merge pull request #4 from sbryngelson/tracers #52

Workflow file for this run

name: MATLAB Code Quality
on:
push:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
name: MATLAB Lint
steps:
- uses: actions/checkout@v4
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2
- name: Run MATLAB Code Analyzer
uses: matlab-actions/run-command@v2
with:
command: addpath('.github/scripts'); lint
- name: Upload lint log
if: always()
uses: actions/upload-artifact@v4
with:
name: matlab-lint-log
path: .github/scripts/lint.log
if-no-files-found: ignore
format:
runs-on: ubuntu-latest
name: MATLAB Format Check
steps:
- uses: actions/checkout@v4
- name: Setup Python for MISS_HIT
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install MISS_HIT formatter
run: |
python -m pip install --upgrade pip
pip install miss_hit
- name: Check MATLAB formatting
run: |
echo "[FORMAT] Checking MATLAB code formatting..."
# Run MISS_HIT and capture output (allow non-zero exit codes)
set +e
output=$(mh_style src/ tests/ config.m simulate.m --brief 2>&1)
exit_code=$?
set -e
echo "$output"
# Check if there are actual style issues (not just warnings)
if echo "$output" | grep -q "style:"; then
echo ""
echo "[ERROR] MATLAB formatting issues found!"
echo ""
echo "[REPORT] Detailed formatting report:"
mh_style src/ tests/ config.m simulate.m || true
echo ""
echo "[FIX] To fix locally, run: ./format.sh"
echo "[INFO] This will automatically fix most formatting issues"
exit 1
else
echo ""
echo "[PASS] All MATLAB files are properly formatted!"
if echo "$output" | grep -q "warning:"; then
echo "[NOTE] Some harmless encoding warnings were detected but can be ignored"
fi
fi