mirror of
https://github.com/git-for-windows/git.git
synced 2026-05-09 08:15:34 -05:00
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:
16
AGENTS.md
16
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
|
||||
|
||||
Reference in New Issue
Block a user