v1.2.0 - ratchets E/F/G + shared gate runner
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 forprint(...)outside allowlisted path prefixes (useloggingeverywhere 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 aratchet-allow: temporary_commentsper-line escape marker.
Changed
- Extracted
hooks/gate.py::run_ratchet_gateas the single seed / trip / ratchet-down / equal implementation; ratchets A, D, E, F, and G all dispatch through it. - Added shared
paths.strip_dot_slashandpaths.iter_python_files;strip_dot_slashreplaces astr.lstrip("./")character-set misuse that mangled dotfile paths. - README, CLI, and
.pre-commit-hooks.yamlnow advertise seven ratchets.
Fixed
print_outside_allowlist.is_allowedmatched allow-prefixes by bare string prefix, sopkg/cliwrongly allow-listedpkg/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/