hooked_config/config/
pre_commit.rs

1//! Pre-commit hook definitions.
2
3use serde::{Deserialize, Serialize};
4
5use crate::{ExitAction, Task};
6
7/// A pre-commit hook.
8#[derive(Debug, Deserialize, Serialize)]
9#[serde(deny_unknown_fields)]
10pub struct PreCommit {
11  /// Display name for this hook.
12  pub name: Option<String>,
13
14  /// What to do when the hook exits with a non-zero status code.
15  #[serde(default)]
16  pub on_failure: ExitAction,
17
18  /// Task to perform when this hook is called.
19  #[serde(flatten)]
20  pub task: Task,
21}