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 <johannes.schindelin@gmx.de>
Assisted-by: Claude Opus 4.6
This commit is contained in:
Johannes Schindelin
2026-04-02 15:17:40 +00:00
parent 497ffcd030
commit 46a110b8b3

View File

@@ -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