1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-04 19:03:38 +00:00

fix(direnv): replace nonexistent "orange" color with "bright-yellow" (#5969)

* Fix direnv config: change style from nonexistent "bold orange" to "bold bright-yellow"

* generate config-schema.json

* fix tests
This commit is contained in:
DerRockWolf 2024-06-02 13:24:12 +00:00 committed by GitHub
parent 5c2a4affbd
commit 478d5cccb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 60 additions and 52 deletions

View File

@ -367,7 +367,7 @@
"format": "[$symbol$loaded/$allowed]($style) ",
"loaded_msg": "loaded",
"not_allowed_msg": "not allowed",
"style": "bold orange",
"style": "bold bright-yellow",
"symbol": "direnv ",
"unloaded_msg": "not loaded"
},
@ -2821,7 +2821,7 @@
"type": "string"
},
"style": {
"default": "bold orange",
"default": "bold bright-yellow",
"type": "string"
},
"disabled": {

View File

@ -27,7 +27,7 @@ impl<'a> Default for DirenvConfig<'a> {
Self {
format: "[$symbol$loaded/$allowed]($style) ",
symbol: "direnv ",
style: "bold orange",
style: "bold bright-yellow",
disabled: true,
detect_extensions: vec![],
detect_files: vec![".envrc"],

View File

@ -184,6 +184,7 @@ mod tests {
use crate::test::ModuleRenderer;
use crate::utils::CommandOutput;
use nu_ansi_term::Color;
use std::io;
use std::path::Path;
#[test]
@ -227,7 +228,7 @@ mod tests {
std::fs::File::create(rc_path)?.sync_all()?;
let renderer = ModuleRenderer::new("direnv")
let actual = ModuleRenderer::new("direnv")
.config(toml::toml! {
[direnv]
disabled = false
@ -239,13 +240,14 @@ mod tests {
stdout: status_cmd_output_with_rc(dir.path(), false, "0", true),
stderr: String::default(),
}),
);
assert_eq!(
Some("direnv not loaded/allowed ".to_string()),
renderer.collect()
);
)
.collect();
let expected = Some(format!(
"{} ",
Color::LightYellow.bold().paint("direnv not loaded/allowed")
));
assert_eq!(expected, actual);
dir.close()
}
#[test]
@ -255,7 +257,7 @@ mod tests {
std::fs::File::create(rc_path)?.sync_all()?;
let renderer = ModuleRenderer::new("direnv")
let actual = ModuleRenderer::new("direnv")
.config(toml::toml! {
[direnv]
disabled = false
@ -267,13 +269,14 @@ mod tests {
stdout: status_cmd_output_with_rc_json(dir.path(), 1, 0),
stderr: String::default(),
}),
);
assert_eq!(
Some("direnv not loaded/allowed ".to_string()),
renderer.collect()
);
)
.collect();
let expected = Some(format!(
"{} ",
Color::LightYellow.bold().paint("direnv not loaded/allowed")
));
assert_eq!(expected, actual);
dir.close()
}
#[test]
@ -283,7 +286,7 @@ mod tests {
std::fs::File::create(rc_path)?.sync_all()?;
let renderer = ModuleRenderer::new("direnv")
let actual = ModuleRenderer::new("direnv")
.config(toml::toml! {
[direnv]
disabled = false
@ -295,13 +298,14 @@ mod tests {
stdout: status_cmd_output_with_rc(dir.path(), true, "0", true),
stderr: String::default(),
}),
);
assert_eq!(
Some("direnv loaded/allowed ".to_string()),
renderer.collect()
);
)
.collect();
let expected = Some(format!(
"{} ",
Color::LightYellow.bold().paint("direnv loaded/allowed")
));
assert_eq!(expected, actual);
dir.close()
}
#[test]
@ -311,7 +315,7 @@ mod tests {
std::fs::File::create(rc_path)?.sync_all()?;
let renderer = ModuleRenderer::new("direnv")
let actual = ModuleRenderer::new("direnv")
.config(toml::toml! {
[direnv]
disabled = false
@ -323,13 +327,14 @@ mod tests {
stdout: status_cmd_output_with_rc_json(dir.path(), 0, 0),
stderr: String::default(),
}),
);
assert_eq!(
Some("direnv loaded/allowed ".to_string()),
renderer.collect()
);
)
.collect();
let expected = Some(format!(
"{} ",
Color::LightYellow.bold().paint("direnv loaded/allowed")
));
assert_eq!(expected, actual);
dir.close()
}
#[test]
@ -339,7 +344,7 @@ mod tests {
std::fs::File::create(rc_path)?.sync_all()?;
let renderer = ModuleRenderer::new("direnv")
let actual = ModuleRenderer::new("direnv")
.config(toml::toml! {
[direnv]
disabled = false
@ -351,13 +356,14 @@ mod tests {
stdout: status_cmd_output_with_rc(dir.path(), true, "2", true),
stderr: String::default(),
}),
);
assert_eq!(
Some("direnv loaded/denied ".to_string()),
renderer.collect()
);
)
.collect();
let expected = Some(format!(
"{} ",
Color::LightYellow.bold().paint("direnv loaded/denied")
));
assert_eq!(expected, actual);
dir.close()
}
#[test]
@ -367,7 +373,7 @@ mod tests {
std::fs::File::create(rc_path)?.sync_all()?;
let renderer = ModuleRenderer::new("direnv")
let actual = ModuleRenderer::new("direnv")
.config(toml::toml! {
[direnv]
disabled = false
@ -379,13 +385,14 @@ mod tests {
stdout: status_cmd_output_with_rc_json(dir.path(), 0, 1),
stderr: String::default(),
}),
);
assert_eq!(
Some("direnv loaded/not allowed ".to_string()),
renderer.collect()
);
)
.collect();
let expected = Some(format!(
"{} ",
Color::LightYellow.bold().paint("direnv loaded/not allowed")
));
assert_eq!(expected, actual);
dir.close()
}
#[test]
@ -395,7 +402,7 @@ mod tests {
std::fs::File::create(rc_path)?.sync_all()?;
let renderer = ModuleRenderer::new("direnv")
let actual = ModuleRenderer::new("direnv")
.config(toml::toml! {
[direnv]
disabled = false
@ -407,13 +414,14 @@ mod tests {
stdout: status_cmd_output_with_rc_json(dir.path(), 0, 2),
stderr: String::default(),
}),
);
assert_eq!(
Some("direnv loaded/denied ".to_string()),
renderer.collect()
);
)
.collect();
let expected = Some(format!(
"{} ",
Color::LightYellow.bold().paint("direnv loaded/denied")
));
assert_eq!(expected, actual);
dir.close()
}
fn status_cmd_output_without_rc() -> String {