From 1a33a163b4d9caa667d377875efae5c9ea29528b Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 9 Nov 2026 22:54:07 +0000 Subject: [PATCH] Add CI that catches syntax errors and undefined names The code here needs hardware or large models, so there are no tests to run. The workflow compiles every Python file and runs flake8 with only the checks for errors that crash at run time (E9, F63, F7, F821-F823). --isolated keeps flake8 from reading any [flake8] section in setup.cfg. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XLsKTxhmmkjAUN94rK6Kps --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0afc1f9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: CI + +# This code drives hardware or needs large models, so there is nothing to run +# here. The check catches what would crash when the code runs: syntax errors +# and names that are used but never defined (flake8 E9, F63, F7, F821-F823). +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-python@v7 + with: + python-version: "3.13" + - run: python -m pip install flake8==7.5.0 + - name: Every Python file compiles + run: python -m compileall -q . + - name: No syntax errors or undefined names + # --isolated ignores any [flake8] section in setup.cfg or tox.ini. + run: >- + flake8 --isolated --show-source --statistics + --select=E9,F63,F7,F821,F822,F823 + .