Pre-commit hook fixed to check staged translation files, not working tree

The author's Locale Guard tool, a GitHub Action and CLI for translation files, added a pre-commit hook in version 1.3.0. The first version of that hook checked files on disk, so it approved a commit that held an English key but lacked matching entries in other language files. The fix makes the check read staged content directly from git, so incomplete commits are now blocked. A pre-push hook and the pull request check were also added to catch anything skipped with --no-verify. Demo repositories for Husky and Lefthook are available for testing.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in