no-empty-repository-hook-arrays
Disallow empty repository hook arrays that opt into an event without any hook definitions.
Rule catalog ID: R067
Targeted pattern scopeâ
.github/hooks/**/*.json
What this rule reportsâ
- hook event arrays declared as
[]
Why this rule existsâ
An empty array says the repository opted into a hook event but did not actually configure any hooks. Removing empty event entries keeps the file focused on real behavior and makes the configuration easier to read.
â Incorrectâ
{ "version": 1, "hooks": { "sessionStart": [] } }
â Correctâ
{ "version": 1, "hooks": {} }
or:
{
"version": 1,
"hooks": {
"sessionStart": [{ "type": "command", "bash": "echo ready" }]
}
}