From e59516531851e4a2cf8dc209179df547afb50a38 Mon Sep 17 00:00:00 2001 From: "Henry J. Webster" Date: Thu, 29 Oct 2026 22:02:47 -0500 Subject: add README validator --- .githooks/pre-commit | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 .githooks/pre-commit (limited to '.githooks/pre-commit') diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..7381a81 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Validate READMEs for this repo, which must have an

describing how to +# reload the configuration. +# +# This helps remember how to see the changes reflect. Every application does it +# differently and it's annoying to figure out. Rebooting or logging out slows +# iteration. +# +# If no README.md, ignore that directory. + +failed=0 + +while IFS= read -r -d '' file; do + if ! grep -q '^## How to Reload' "$file"; then + printf 'File missing reloading section: %s\n' "$file" + failed=1 + fi +done < <(find . -mindepth 2 -maxdepth 2 -type f ! -path './.git/*' \ + -name 'README.md' -print0) + +exit "$failed" -- cgit v1.3