From 2d44cd4893c0bfa8145055aa478533ededc7619c Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 2 Apr 2026 15:17:40 +0000 Subject: [PATCH] fixup! Add an AGENTS.md file to help with AI-assisted debugging/development AGENTS.md: add pre-commit checklist for lint checks Bundle the existing ASCII-only, 80-column, and whitespace validation recipes into a "pre-commit checklist" block that agents should run before every commit. The individual recipes already existed in the Coding Conventions section but were presented as reference material rather than as an actionable workflow step. Signed-off-by: Johannes Schindelin Assisted-by: Claude Opus 4.6 --- AGENTS.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index b11a97ff07..28e8c3574a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -831,6 +831,22 @@ terminal sessions of yore: - **Tabs for indentation**: The codebase uses tabs, not spaces. - **No trailing whitespace**: Clean up your lines. +**Pre-commit checklist.** Run all three checks before every commit: + +```bash +git diff --check && +git diff --no-color | LC_ALL=C grep '[^ -~]' && + echo "ERROR: non-ASCII characters found" && +git diff --no-color | grep '^+' | sed 's/\t/ /g' | + grep '.\{82\}' && + echo "ERROR: lines exceed 80 columns" +``` + +The first command catches whitespace errors. If either of the latter +two produces output, fix the offending lines before committing. Note +that these checks apply to commit messages as well (wrap at 76 columns +for messages, 80 for code). + See `Documentation/CodingGuidelines` for the full set of conventions. ### strbuf patterns