Skip to content

CI: lint, typos, MATLAB syntax, pre-commit hooks #9

Description

@neuromechanist

Goal

Set up cheap CI gates and pre-commit hooks so style/typo/syntax issues are caught before review.

What lands here

GitHub Actions (.github/workflows/lint.yml) - 5 cheap jobs only:

  • typos (crate-ci/typos) with _typos.toml ignoring HBN subject IDs and EEG jargon
  • actionlint (workflow YAML lint)
  • yamllint (.yamllint.yml)
  • markdownlint (.markdownlint.json, excludes derivatives/)
  • matlab-syntax: matlab-actions/setup-matlab + checkcode over src/matlab/**/*.m, fail only on severe

Local CI (scripts/local_ci.sh) - heavy MATLAB only, NOT in GH Actions:

  • mh_style + mh_lint (miss_hit) over src/matlab
  • MATLAB checkcode + runtests('tests/matlab') against local EEGLAB + R3 100 Hz BIDS
  • Env: MATLAB_BIN, EEGLAB_PATH, BIDS_ROOT

Pre-commit (.pre-commit-config.yaml):

  • File hygiene (trailing-ws, EOF, large-file 1 MB, line-endings); skips .set/.fdt/.bdf/.edf/.mat
  • typos, yamllint, markdownlint
  • ruff + ruff-format (only fires on staged .py)
  • mh_style --fix + mh_lint (MATLAB, no MATLAB binary needed)

Why split GH vs local

MATLAB licensing on GH Actions is fine for checkcode (syntax only). Anything that needs EEGLAB plugins on real BDF data must run locally where we have the licensed install and the 100 Hz R3 dataset. Keeps CI minutes cheap and feedback fast.

Out of scope (separate issue)

  • 30-second test fixture from real R3 BDF for runtests in scripts/local_ci.sh. Separate issue tracks that.

Acceptance

  • lint.yml green on PR
  • pre-commit run --all-files clean
  • scripts/local_ci.sh runs locally without MATLAB errors (with empty src/matlab early on, smoke tests added later)

Metadata

Metadata

Assignees

No one assigned

    Labels

    infraBuild, CI, tooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions