Skip to content

v1.2.0 - ratchets E/F/G + shared gate runner

Choose a tag to compare

@monk-eee monk-eee released this 15 Jun 04:58
· 3 commits to main since this release
a61658e

What's new in 1.2.0

Three new baseline-gate ratchets, plus an internal refactor that eliminates the duplicated gate control flow the existing hooks carried.

Added

  • Ratchet E — ratchet-no-cross-module-private-import: AST scan blocking imports of a private (_-prefixed) name across module boundaries (from pkg.mod import _foo, import pkg._foo). Relative imports and dunders are ignored.
  • Ratchet F — ratchet-no-print-outside-allowlist: AST scan for print(...) outside allowlisted path prefixes (use logging everywhere else).
  • Ratchet G — ratchet-no-temporary-comments: regex scan for expedient-path comment markers (for now, back-compat, TODO: remove once, HACK: fix later, transitional bridges) with a ratchet-allow: temporary_comments per-line escape marker.

Changed

  • Extracted hooks/gate.py::run_ratchet_gate as the single seed / trip / ratchet-down / equal implementation; ratchets A, D, E, F, and G all dispatch through it.
  • Added shared paths.strip_dot_slash and paths.iter_python_files; strip_dot_slash replaces a str.lstrip("./") character-set misuse that mangled dotfile paths.
  • README, CLI, and .pre-commit-hooks.yaml now advertise seven ratchets.

Fixed

  • print_outside_allowlist.is_allowed matched allow-prefixes by bare string prefix, so pkg/cli wrongly allow-listed pkg/client.py. It now matches only the exact file or a directory boundary. Regression-tested.

Full changelog: v1.1.0...v1.2.0
PyPI: https://pypi.org/project/git-agent-ratchet/1.2.0/