Shared configurations and reusable workflows for all repositories.
This repo provides a base lefthook configuration that can be extended by other repos.
npm install --save-dev lefthookCreate lefthook.jsonc:
Add postinstall script to package.json:
{
"scripts": {
"postinstall": "lefthook install"
}
}Install lefthook:
brew install lefthookCreate lefthook.jsonc:
{
"remotes": [
{
"git_url": "https://github.com/dmikalova/github-meta",
"ref": "main",
"refetch": true,
"configs": ["lefthook.jsonc"]
}
]
}Add setup task to deno.jsonc:
{
"tasks": {
"setup": "lefthook install"
}
}Run deno task setup after cloning.
Install lefthook:
brew install lefthookCreate lefthook.jsonc in the repo root:
{
"remotes": [
{
"git_url": "https://github.com/dmikalova/github-meta",
"ref": "main",
"refetch": true,
"configs": ["lefthook.jsonc"]
}
]
}Run lefthook install after cloning.
General (all repos):
gitleaks- Secret detectioncheck-merge-conflict- Unresolved merge markersdetect-private-key- Block .pem/.key filescheck-large-files- Block files > 5MBno-shell-scripts- Block .sh files (use TypeScript)typos- Auto-fix typos and stagemarkdownlint- Auto-fix markdown and stage
Deno repos (when deno.json exists):
deno fmt- Auto-fix and stagedeno lint --fix- Auto-fix and stagedeno checkdeno test
Terraform repos (when terramate.tm.hcl exists):
terramate run -- tofu fmt- Auto-fix and stageterramate run -- tofu validate
Commit message:
commitlint- Conventional commit format
For emergency commits, use --no-verify:
git commit --no-verify -m "emergency fix"Run all checks manually on all files:
lefthook run pre-commit --forcePre-commit hooks run the same checks as CI. Running on all files ensures identical behavior between local development and CI pipelines.
{ "remotes": [ { "git_url": "https://github.com/dmikalova/github-meta", "ref": "main", "refetch": true, "configs": ["lefthook.jsonc"] } ] }