Files
2025-11-30 08:56:25 +08:00

18 lines
510 B
JSON

{
"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
}
]
}
]
}
}