2022-03-26 09:42:19 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2021-07-10 20:54:34 +00:00
|
|
|
|
2022-03-26 09:42:19 +00:00
|
|
|
#[derive(Clone, Deserialize, Serialize)]
|
2022-09-09 12:59:38 +00:00
|
|
|
#[cfg_attr(
|
|
|
|
feature = "config-schema",
|
|
|
|
derive(schemars::JsonSchema),
|
|
|
|
schemars(deny_unknown_fields)
|
|
|
|
)]
|
2022-03-26 09:42:19 +00:00
|
|
|
#[serde(default)]
|
2021-07-10 20:54:34 +00:00
|
|
|
pub struct GitMetricsConfig<'a> {
|
|
|
|
pub added_style: &'a str,
|
|
|
|
pub deleted_style: &'a str,
|
2021-08-27 14:38:46 +00:00
|
|
|
pub only_nonzero_diffs: bool,
|
2021-07-10 20:54:34 +00:00
|
|
|
pub format: &'a str,
|
|
|
|
pub disabled: bool,
|
2023-04-13 19:04:15 +00:00
|
|
|
pub ignore_submodules: bool,
|
2021-07-10 20:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> Default for GitMetricsConfig<'a> {
|
|
|
|
fn default() -> Self {
|
|
|
|
GitMetricsConfig {
|
|
|
|
added_style: "bold green",
|
|
|
|
deleted_style: "bold red",
|
2021-08-27 14:38:46 +00:00
|
|
|
only_nonzero_diffs: true,
|
|
|
|
format: "([+$added]($added_style) )([-$deleted]($deleted_style) )",
|
2021-07-10 20:54:34 +00:00
|
|
|
disabled: true,
|
2023-04-13 19:04:15 +00:00
|
|
|
ignore_submodules: false,
|
2021-07-10 20:54:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|