From f71444fa857cce6eb225c2d2ecdb899f19860c4b Mon Sep 17 00:00:00 2001 From: ellieayla <1447600+me@users.noreply.github.com> Date: Fri, 3 Apr 2026 13:55:42 -0400 Subject: [PATCH] Add pre-commit framework config. When multiple tools want to use the same .git/hooks/pre-commit script, need a framework to config and run them. --- .pre-commit-hooks.yaml | 9 +++++++++ README.md | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .pre-commit-hooks.yaml diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..bea9637 --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,9 @@ +- id: leash + name: git-leash + description: Block commits based on configurable time windows. Helps you stay focused on what you're supposed to be doing. Overridable when you genuinely need to ship. + entry: leash check + language: unsupported_script + always_run: true + pass_filenames: false + require_serial: true + stages: [pre-commit] diff --git a/README.md b/README.md index e1059e1..7e1731f 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,19 @@ leash install --global `leash install` automatically adds `.leash` and `.leash-slip` to `.git/info/exclude` — no `.gitignore` modifications, nothing tracked, pure stealth. +## Install with [pre-commit](https://pre-commit.com) + +If you're already using https://pre-commit.com, you can add this hook to your repository's `.pre-commit-config.yaml` file. +The existence won't be stealthy in that case, as `.pre-commit-config.yaml` is normally committed to the repo. + +```yaml +repos: +- repo: https://github.com/SiteRelEnby/git-leash + rev: v0.1.3 # see https://github.com/SiteRelEnby/git-leash/releases + hooks: + - id: leash +``` + ## Config Place at `~/.leash` (global) or `.leash` in your repo root (project-local overrides global).