Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:56:25 +08:00
commit 1e3e603484
6 changed files with 131 additions and 0 deletions

17
newline/hooks.json Normal file
View File

@@ -0,0 +1,17 @@
{
"description": "Ensure POSIX compliance by adding final newlines to files",
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit|MultiEdit",
"hooks": [
{
"type": "command",
"command": "file_path=$(grep -o '\"file_path\":\"[^\"]*\"' | sed 's/\"file_path\":\"\\(.*\\)\"/\\1/'); if [ -f \"$file_path\" ] && [ -n \"$(tail -c1 \"$file_path\")\" ]; then echo >> \"$file_path\"; fi",
"timeout": 5
}
]
}
]
}
}