Whether this settings object disables all hooks at its scope.
(agent: &str, root: &serde_json::Map<String, Value>)
| 136 | |
| 137 | /// Whether this settings object disables all hooks at its scope. |
| 138 | pub fn globally_disabled(agent: &str, root: &serde_json::Map<String, Value>) -> bool { |
| 139 | match agent { |
| 140 | "claude-code" => root.get("disableAllHooks") == Some(&Value::Bool(true)), |
| 141 | "gemini-cli" => { |
| 142 | root.get("hooksConfig").and_then(|v| v.get("enabled")) == Some(&Value::Bool(false)) |
| 143 | || root.get("tools").and_then(|v| v.get("enableHooks")) == Some(&Value::Bool(false)) |
| 144 | } |
| 145 | _ => false, |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | fn disabled(entry: &serde_json::Map<String, Value>) -> Result<bool, &'static str> { |
| 150 | for flag in [entry.get("disabled"), entry.get("enabled")] |
no test coverage detected