1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-26 11:42:36 +00:00
starship/src/configs/git_metrics.rs
Colton Donnelly ce01423152
feat(git_metrics): add option to ignore submodules (#5052)
* add docs

* update schema

* ok, actually update schema

* add test

* fix lint

* accidentally included my .devenv directory
2023-04-13 21:04:15 +02:00

31 lines
804 B
Rust

use serde::{Deserialize, Serialize};
#[derive(Clone, Deserialize, Serialize)]
#[cfg_attr(
feature = "config-schema",
derive(schemars::JsonSchema),
schemars(deny_unknown_fields)
)]
#[serde(default)]
pub struct GitMetricsConfig<'a> {
pub added_style: &'a str,
pub deleted_style: &'a str,
pub only_nonzero_diffs: bool,
pub format: &'a str,
pub disabled: bool,
pub ignore_submodules: bool,
}
impl<'a> Default for GitMetricsConfig<'a> {
fn default() -> Self {
GitMetricsConfig {
added_style: "bold green",
deleted_style: "bold red",
only_nonzero_diffs: true,
format: "([+$added]($added_style) )([-$deleted]($deleted_style) )",
disabled: true,
ignore_submodules: false,
}
}
}