feat: Add the git_metrics module (#2827)

This PR adds a new module named git_metrics. It shows the added/deleted lines in the current git repository following the format: "[+$added_lines]($added_style) [-$deleted_lines]($deleted_style)".
This commit is contained in:
Alexander Gonzalez
2021-07-10 16:54:34 -04:00
committed by GitHub
parent 9126d78d0e
commit 9f337d15e7
8 changed files with 350 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
use crate::config::ModuleConfig;
use serde::Serialize;
use starship_module_config_derive::ModuleConfig;
#[derive(Clone, ModuleConfig, Serialize)]
pub struct GitMetricsConfig<'a> {
pub added_style: &'a str,
pub deleted_style: &'a str,
pub format: &'a str,
pub disabled: bool,
}
impl<'a> Default for GitMetricsConfig<'a> {
fn default() -> Self {
GitMetricsConfig {
added_style: "bold green",
deleted_style: "bold red",
format: "[+$added]($added_style) [-$deleted]($deleted_style) ",
disabled: true,
}
}
}