Files
hermes-agent/lefthook.yml
alt-glitch da72db50e4 feat(compat): generate shims at old module paths for releases that update across a move
Release-channel updaters (v0.21.6 on) keep old code loaded across the checkout swap. After it
they run some files by path and lazily import modules under packages they loaded before the swap,
which Python looks up on the old package's __path__ without asking the compat finder. Each such
name needs a file at its old path once its module moves.

- hermes_agent/compat/required_names.py: the 120 old names supported releases reach, with kind
  (package, module, by-path, exists), built once from the per-release shim audit.
- scripts/move/generate_shims.py: for each name whose module is moved in MOVES, writes a shim
  that installs the finder and becomes the moved module (or runs it as __main__ when run by path
  or with -m). Lists the shims as linguist-generated in .gitattributes. --check fails on drift and
  on stray files in a moved folder.
- The check runs in scripts/check (just check), lint.yml and the lefthook pre-commit hook.
  install_root_lint skips the shims: they are entry points for runs by path.

With MOVES empty the generator writes nothing.
2026-11-13 18:45:32 +00:00

40 lines
903 B
YAML

pre-commit:
jobs:
- name: lint python
glob: "*.py" # glob filter
run: just ruff {staged_files}
- name: move shims
glob: "*.py"
run: just check --only shims
- name: lint web
root: web/
glob: "web/**/*.{js,ts,tsx}"
run: just eslint {staged_files}
- name: lint bootstrap installer
root: apps/bootstrap-installer/
glob: "*.{js,ts,tsx}"
run: just eslint {staged_files}
- name: lint desktop app
root: apps/desktop/
glob: "*.{js,ts,tsx}"
run: just eslint {staged_files}
- name: lint tui
root: ui-tui/
glob: "*.{js,ts,tsx}"
run: just eslint {staged_files}
- name: lint shared
root: apps/shared/
glob: "*.{js,ts,tsx}"
run: just eslint {staged_files}
- name: lint tests
root: tests-js/
glob: "*.{js,ts,tsx}"
run: just eslint {staged_files}