From 4488f274aa339b891f59700efb984773d32f89a1 Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Mon, 26 Dec 2022 16:16:58 -0500 Subject: [PATCH 01/14] feat: Pijul VCS support --- .github/workflows/workflow.yml | 4 + src/configs/mod.rs | 1 + src/configs/pijul.rs | 30 ++++ src/module.rs | 1 + src/modules/mod.rs | 3 + src/modules/pijul.rs | 251 +++++++++++++++++++++++++++++++++ src/test/mod.rs | 12 ++ 7 files changed, 302 insertions(+) create mode 100644 src/configs/pijul.rs create mode 100644 src/modules/pijul.rs diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 234648476f61..ee86e33f5673 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -207,6 +207,10 @@ jobs: if: matrix.os == 'macOS-latest' run: brew install mercurial + # Install Pijul + - name: Setup | Pijul + run: cargo install pijul --version "~1.0.0-beta" + # Run the ignored tests that expect the above setup - name: Build | Test run: "cargo llvm-cov diff --git a/src/configs/mod.rs b/src/configs/mod.rs index 8a712e5fb7e3..74bd8117d5b9 100644 --- a/src/configs/mod.rs +++ b/src/configs/mod.rs @@ -61,6 +61,7 @@ pub mod os; pub mod package; pub mod perl; pub mod php; +pub mod pijul; pub mod pulumi; pub mod purescript; pub mod python; diff --git a/src/configs/pijul.rs b/src/configs/pijul.rs new file mode 100644 index 000000000000..d361c2fda522 --- /dev/null +++ b/src/configs/pijul.rs @@ -0,0 +1,30 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Deserialize, Serialize)] +#[cfg_attr( + feature = "config-schema", + derive(schemars:JsonSchema), + schemars(deny_unknown_fields) +)] +#[serde(default)] +pub struct PijulConfig<'a> { + pub symbol: &'a str, + pub style: &'a str, + pub format: &'a str, + pub truncation_length: i64, + pub truncation_symbol: &'a str, + pub disabled: bool, +} + +impl<'a> Default for PijulConfig<'a> { + fn default() -> Self { + PijulConfig { + symbol: " ", + style: "bold purple", + format: "on [$symbol$channel]($style) ", + truncation_length: std::i64::MAX, + truncation_symbol: "…", + disabled: true, + } + } +} diff --git a/src/module.rs b/src/module.rs index 77508f147b73..3264f302393e 100644 --- a/src/module.rs +++ b/src/module.rs @@ -69,6 +69,7 @@ pub const ALL_MODULES: &[&str] = &[ "package", "perl", "php", + "pijul", "pulumi", "purescript", "python", diff --git a/src/modules/mod.rs b/src/modules/mod.rs index 8c8c5b6bb8d6..1963f0a2c753 100644 --- a/src/modules/mod.rs +++ b/src/modules/mod.rs @@ -58,6 +58,7 @@ mod os; mod package; mod perl; mod php; +mod pijul; mod pulumi; mod purescript; mod python; @@ -159,6 +160,7 @@ pub fn handle<'a>(module: &str, context: &'a Context) -> Option> { "package" => package::module(context), "perl" => perl::module(context), "php" => php::module(context), + "pijul" => pijul::module(context), "pulumi" => pulumi::module(context), "purescript" => purescript::module(context), "python" => python::module(context), @@ -273,6 +275,7 @@ pub fn description(module: &str) -> &'static str { "package" => "The package version of the current directory's project", "perl" => "The currently installed version of Perl", "php" => "The currently installed version of PHP", + "pijul" => "The current channel of the repo in the current directory", "pulumi" => "The current username, stack, and installed version of Pulumi", "purescript" => "The currently installed version of PureScript", "python" => "The currently installed version of Python", diff --git a/src/modules/pijul.rs b/src/modules/pijul.rs new file mode 100644 index 000000000000..54cfdbd36d4e --- /dev/null +++ b/src/modules/pijul.rs @@ -0,0 +1,251 @@ +use unicode_segmentation::UnicodeSegmentation; + +use super::{Context, Module, ModuleConfig}; + +use crate::configs::pijul::PijulConfig; +use crate::formatter::StringFormatter; + +/// Creates a module with the Pijul channel in the current directory +/// +/// Will display the channel lame if the current directory is a pijul repo +pub fn module<'a>(context: &'a Context) -> Option> { + let is_repo = context + .try_begin_scan()? + .set_folders(&[".pijul"]) + .is_match(); + + if !is_repo { + return None; + } + + let mut module = context.new_module("pijul"); + let config: PijulConfig = PijulConfig::try_load(module.config); + + // We default to disabled=true, so we have to check after loading our config module. + if config.disabled { + return None; + }; + + let len = if config.truncation_length <= 0 { + log::warn!( + "\"truncation_length\" should be a positive value, found {}", + config.truncation_length + ); + std::usize::MAX + } else { + config.truncation_length as usize + }; + + let channel_name = get_pijul_current_channel(context)?; + + let truncated_graphemes = get_graphemes(&channel_name, len); + // The truncation symbol should only be added if we truncated. + let truncated_and_symbol = if len < graphemes_len(&channel_name) { + let truncation_symbol = get_graphemes(config.truncation_symbol, 1); + truncated_graphemes + truncation_symbol.as_str() + } else { + truncated_graphemes + }; + + let parsed = StringFormatter::new(config.format).and_then(|formatter| { + formatter + .map_meta(|variable, _| match variable { + "symbol" => Some(config.symbol), + _ => None, + }) + .map_style(|variable| match variable { + "style" => Some(Ok(config.style)), + _ => None, + }) + .map(|variable| match variable { + "channel" => Some(Ok(truncated_and_symbol.as_str())), + _ => None, + }) + .parse(None, Some(context)) + }); + + module.set_segments(match parsed { + Ok(segments) => segments, + Err(error) => { + log::warn!("Error in module `pijul`:\n{}", error); + return None; + } + }); + + Some(module) +} + +fn get_pijul_current_channel(ctx: &Context) -> Option { + let output = ctx.exec_cmd("pijul", &["channel"])?.stdout; + + output + .lines() + .find_map(|l| l.strip_prefix("* ")) + .map(&str::to_owned) +} + +fn get_graphemes(text: &str, length: usize) -> String { + UnicodeSegmentation::graphemes(text, true) + .take(length) + .collect::>() + .concat() +} + +fn graphemes_len(text: &str) -> usize { + UnicodeSegmentation::graphemes(text, true).count() +} + +#[cfg(test)] +mod tests { + use nu_ansi_term::{Color, Style}; + use std::io; + use std::path::Path; + + use crate::test::{fixture_repo, FixtureProvider, ModuleRenderer}; + use crate::utils::create_command; + + enum Expect<'a> { + ChannelName(&'a str), + Empty, + NoTruncation, + Symbol(&'a str), + Style(Style), + TruncationSymbol(&'a str), + } + + #[test] + fn show_nothing_on_empty_dir() -> io::Result<()> { + let repo_dir = tempfile::tempdir()?; + + let actual = ModuleRenderer::new("pijul").path(repo_dir.path()).collect(); + + let expected = None; + assert_eq!(expected, actual); + repo_dir.close() + } + + #[test] + #[ignore] + fn test_pijul_disabled_per_default() -> io::Result<()> { + let tempdir = fixture_repo(FixtureProvider::Pijul)?; + let repo_dir = tempdir.path(); + expect_pijul_with_config( + repo_dir, + Some(toml::toml! { + [pijul] + truncation_length = 14 + }), + &[Expect::Empty], + ); + tempdir.close() + } + + #[test] + #[ignore] + fn test_pijul_autodisabled() -> io::Result<()> { + let tempdir = tempfile::tempdir()?; + expect_pijul_with_config(tempdir.path(), None, &[Expect::Empty]); + tempdir.close() + } + + #[test] + #[ignore] + fn test_pijul_channel() -> io::Result<()> { + let tempdir = fixture_repo(FixtureProvider::Pijul)?; + let repo_dir = tempdir.path(); + run_pijul(&["channel", "new", "tributary"], repo_dir)?; + run_pijul(&["channel", "switch", "tributary"], repo_dir)?; + expect_pijul_with_config( + repo_dir, + None, + &[Expect::ChannelName("tributary"), Expect::NoTruncation], + ); + tempdir.close() + } + + #[test] + #[ignore] + fn test_pijul_configured() -> io::Result<()> { + let tempdir = fixture_repo(FixtureProvider::Pijul)?; + let repo_dir = tempdir.path(); + run_pijul(&["channel", "new", "tributary-48198"], repo_dir)?; + run_pijul(&["channel", "switch", "tributary-48198"], repo_dir)?; + expect_pijul_with_config( + repo_dir, + Some(toml::toml! { + [pijul] + style = "underline blue" + symbol = "P " + truncation_length = 14 + truncation_symbol = "%" + disabled = false + }), + &[ + Expect::ChannelName("tributary-4819"), + Expect::Style(Color::Blue.underline()), + Expect::Symbol("P"), + Expect::TruncationSymbol("%"), + ], + ); + tempdir.close() + } + + fn expect_pijul_with_config( + repo_dir: &Path, + config: Option, + expectations: &[Expect], + ) { + let actual = ModuleRenderer::new("pijul") + .path(repo_dir.to_str().unwrap()) + .config(config.unwrap_or_else(|| { + toml::toml! { + [pijul] + disabled = false + } + })) + .collect(); + + let mut expect_channel_name = "main"; + let mut expect_style = Color::Purple.bold(); + let mut expect_symbol = "\u{e0a0}"; + let mut expect_truncation_symbol = "…"; + + for expect in expectations { + match expect { + Expect::Empty => { + assert_eq!(None, actual); + return; + } + Expect::Symbol(symbol) => { + expect_symbol = symbol; + } + Expect::TruncationSymbol(truncation_symbol) => { + expect_truncation_symbol = truncation_symbol; + } + Expect::NoTruncation => { + expect_truncation_symbol = ""; + } + Expect::ChannelName(channel_name) => { + expect_channel_name = channel_name; + } + Expect::Style(style) => expect_style = *style, + } + } + + let expected = Some(format!( + "on {} ", + expect_style.paint(format!( + "{expect_symbol} {expect_channel_name}{expect_truncation_symbol}" + )), + )); + assert_eq!(expected, actual); + } + + fn run_pijul(args: &[&str], repo_dir: &Path) -> io::Result<()> { + create_command("pijul")? + .args(args) + .current_dir(repo_dir) + .output()?; + Ok(()) + } +} diff --git a/src/test/mod.rs b/src/test/mod.rs index c6320226af6a..cb5e85622ad6 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -165,6 +165,7 @@ impl<'a> ModuleRenderer<'a> { pub enum FixtureProvider { Git, Hg, + Pijul, } pub fn fixture_repo(provider: FixtureProvider) -> io::Result { @@ -223,5 +224,16 @@ pub fn fixture_repo(provider: FixtureProvider) -> io::Result { Ok(path) } + FixtureProvider::Pijul => { + let path = tempfile::tempdir()?; + + create_command("pijul")? + .current_dir(path.path()) + .arg("init") + .arg(path.path()) + .output()?; + + Ok(path) + } } } From 8930b6589178b465ea4971ef90c17f2d7e0fb2b0 Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Mon, 26 Dec 2022 16:33:46 -0500 Subject: [PATCH 02/14] Extra bits needed for new module. --- .github/config-schema.json | 46 +++++++++++++++++++ .../presets/toml/bracketed-segments.toml | 3 ++ .../presets/toml/nerd-font-symbols.toml | 3 ++ .../presets/toml/plain-text-symbols.toml | 3 ++ docs/config/README.md | 16 +++++++ src/configs/mod.rs | 2 + src/configs/pijul.rs | 2 +- src/configs/starship_root.rs | 1 + 8 files changed, 75 insertions(+), 1 deletion(-) diff --git a/.github/config-schema.json b/.github/config-schema.json index e7fb0af122dd..5f55dfc50011 100644 --- a/.github/config-schema.json +++ b/.github/config-schema.json @@ -1213,6 +1213,21 @@ } ] }, + "pijul": { + "default": { + "disabled": true, + "format": "on [$symbol$channel]($style) ", + "style": "bold purple", + "symbol": " ", + "truncation_length": 9223372036854775807, + "truncation_symbol": "…" + }, + "allOf": [ + { + "$ref": "#/definitions/PijulConfig" + } + ] + }, "pulumi": { "default": { "disabled": false, @@ -4481,6 +4496,37 @@ }, "additionalProperties": false }, + "PijulConfig": { + "type": "object", + "properties": { + "symbol": { + "default": " ", + "type": "string" + }, + "style": { + "default": "bold purple", + "type": "string" + }, + "format": { + "default": "on [$symbol$channel]($style) ", + "type": "string" + }, + "truncation_length": { + "default": 9223372036854775807, + "type": "integer", + "format": "int64" + }, + "truncation_symbol": { + "default": "…", + "type": "string" + }, + "disabled": { + "default": true, + "type": "boolean" + } + }, + "additionalProperties": false + }, "PulumiConfig": { "type": "object", "properties": { diff --git a/docs/.vuepress/public/presets/toml/bracketed-segments.toml b/docs/.vuepress/public/presets/toml/bracketed-segments.toml index deaa6ae8cd4d..eda891d36156 100644 --- a/docs/.vuepress/public/presets/toml/bracketed-segments.toml +++ b/docs/.vuepress/public/presets/toml/bracketed-segments.toml @@ -130,6 +130,9 @@ format = '\[[$symbol($version)]($style)\]' [php] format = '\[[$symbol($version)]($style)\]' +[pijul] +format = '\[[$symbol$channel]($style)\]' + [pulumi] format = '\[[$symbol$stack]($style)\]' diff --git a/docs/.vuepress/public/presets/toml/nerd-font-symbols.toml b/docs/.vuepress/public/presets/toml/nerd-font-symbols.toml index 18cb470306e0..433a8151b4cd 100644 --- a/docs/.vuepress/public/presets/toml/nerd-font-symbols.toml +++ b/docs/.vuepress/public/presets/toml/nerd-font-symbols.toml @@ -108,6 +108,9 @@ Windows = " " [package] symbol = " " +[pijul] +symbol = "🪺 " + [python] symbol = " " diff --git a/docs/.vuepress/public/presets/toml/plain-text-symbols.toml b/docs/.vuepress/public/presets/toml/plain-text-symbols.toml index 66eca654dbaa..95322673f662 100644 --- a/docs/.vuepress/public/presets/toml/plain-text-symbols.toml +++ b/docs/.vuepress/public/presets/toml/plain-text-symbols.toml @@ -156,6 +156,9 @@ symbol = "pl " [php] symbol = "php " +[pijul] +symbol = "pijul " + [pulumi] symbol = "pulumi " diff --git a/docs/config/README.md b/docs/config/README.md index 904504b24036..939809494014 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -271,6 +271,7 @@ $git_state\ $git_metrics\ $git_status\ $hg_branch\ +$pijul\ $docker_context\ $package\ $c\ @@ -3162,6 +3163,21 @@ By default the module will be shown if any of the following conditions are met: format = 'via [🔹 $version](147 bold) ' ``` +## Pijul Channel + +The `pijul` module shows the active channel of the repo in your current directory. + +### Options + +| Option | Default | Description | +| ------------------- | --------------------------------- | -------------------------------------------------------------------------------------------- | +| `symbol` | `' '` | The symbol used before the pijul channel name of the repo in your current directory. | +| `style` | `'bold purple'` | The style for the module. | +| `format` | `'on [$symbol$channel]($style) '` | The format for the module. | +| `truncation_length` | `2^63 - 1` | Truncates the pijul channel name to `N` graphemes | +| `truncation_symbol` | `'…'` | The symbol used to indicate a branch name was truncated. | +| `disabled` | `true` | Disables the `pijul` module. | + ## Pulumi The `pulumi` module shows the current username, selected [Pulumi Stack](https://www.pulumi.com/docs/intro/concepts/stack/), and version. diff --git a/src/configs/mod.rs b/src/configs/mod.rs index 74bd8117d5b9..69ee38a076c0 100644 --- a/src/configs/mod.rs +++ b/src/configs/mod.rs @@ -222,6 +222,8 @@ pub struct FullConfig<'a> { #[serde(borrow)] php: php::PhpConfig<'a>, #[serde(borrow)] + pijul: pijul::PijulConfig<'a>, + #[serde(borrow)] pulumi: pulumi::PulumiConfig<'a>, #[serde(borrow)] purescript: purescript::PureScriptConfig<'a>, diff --git a/src/configs/pijul.rs b/src/configs/pijul.rs index d361c2fda522..031bea6c7b2e 100644 --- a/src/configs/pijul.rs +++ b/src/configs/pijul.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Deserialize, Serialize)] #[cfg_attr( feature = "config-schema", - derive(schemars:JsonSchema), + derive(schemars::JsonSchema), schemars(deny_unknown_fields) )] #[serde(default)] diff --git a/src/configs/starship_root.rs b/src/configs/starship_root.rs index 891e90746e3b..fd395dad00b5 100644 --- a/src/configs/starship_root.rs +++ b/src/configs/starship_root.rs @@ -42,6 +42,7 @@ pub const PROMPT_ORDER: &[&str] = &[ "git_metrics", "git_status", "hg_branch", + "pijul", "docker_context", "package", // ↓ Toolchain version modules ↓ From 29d61b002d7f9db528efff403c504e2deba1dc8f Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Mon, 26 Dec 2022 17:38:57 -0500 Subject: [PATCH 03/14] Format Markdown table. --- docs/config/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/config/README.md b/docs/config/README.md index 939809494014..7fef080ea70c 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -3169,14 +3169,14 @@ The `pijul` module shows the active channel of the repo in your current director ### Options -| Option | Default | Description | -| ------------------- | --------------------------------- | -------------------------------------------------------------------------------------------- | +| Option | Default | Description | +| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------ | | `symbol` | `' '` | The symbol used before the pijul channel name of the repo in your current directory. | -| `style` | `'bold purple'` | The style for the module. | -| `format` | `'on [$symbol$channel]($style) '` | The format for the module. | -| `truncation_length` | `2^63 - 1` | Truncates the pijul channel name to `N` graphemes | -| `truncation_symbol` | `'…'` | The symbol used to indicate a branch name was truncated. | -| `disabled` | `true` | Disables the `pijul` module. | +| `style` | `'bold purple'` | The style for the module. | +| `format` | `'on [$symbol$channel]($style) '` | The format for the module. | +| `truncation_length` | `2^63 - 1` | Truncates the pijul channel name to `N` graphemes | +| `truncation_symbol` | `'…'` | The symbol used to indicate a branch name was truncated. | +| `disabled` | `true` | Disables the `pijul` module. | ## Pulumi From 7956a4312548f9afd1d188c819b4365493f325db Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Mon, 26 Dec 2022 19:40:44 -0500 Subject: [PATCH 04/14] Fix lint. --- src/modules/pijul.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/pijul.rs b/src/modules/pijul.rs index 54cfdbd36d4e..25860df296fe 100644 --- a/src/modules/pijul.rs +++ b/src/modules/pijul.rs @@ -81,7 +81,7 @@ fn get_pijul_current_channel(ctx: &Context) -> Option { output .lines() .find_map(|l| l.strip_prefix("* ")) - .map(&str::to_owned) + .map(str::to_owned) } fn get_graphemes(text: &str, length: usize) -> String { From c7737c93905d79a8303f97c508073f22213ad29d Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Wed, 28 Dec 2022 10:46:41 -0500 Subject: [PATCH 05/14] Don't test Pijul module so thoroughly. Installing from source is too expensive, and compiled binaries are only available for Windows (and unofficially as well). Perhaps once Pijul 1.0.0 comes out of beta there will be more binaries available in package repos. --- src/modules/pijul.rs | 180 +++---------------------------------------- src/test/mod.rs | 12 --- 2 files changed, 9 insertions(+), 183 deletions(-) diff --git a/src/modules/pijul.rs b/src/modules/pijul.rs index 25860df296fe..f57c37cf548e 100644 --- a/src/modules/pijul.rs +++ b/src/modules/pijul.rs @@ -1,6 +1,5 @@ -use unicode_segmentation::UnicodeSegmentation; - use super::{Context, Module, ModuleConfig}; +use super::utils::truncate::truncate_text; use crate::configs::pijul::PijulConfig; use crate::formatter::StringFormatter; @@ -26,26 +25,13 @@ pub fn module<'a>(context: &'a Context) -> Option> { return None; }; - let len = if config.truncation_length <= 0 { - log::warn!( - "\"truncation_length\" should be a positive value, found {}", - config.truncation_length - ); - std::usize::MAX - } else { - config.truncation_length as usize - }; - let channel_name = get_pijul_current_channel(context)?; - let truncated_graphemes = get_graphemes(&channel_name, len); - // The truncation symbol should only be added if we truncated. - let truncated_and_symbol = if len < graphemes_len(&channel_name) { - let truncation_symbol = get_graphemes(config.truncation_symbol, 1); - truncated_graphemes + truncation_symbol.as_str() - } else { - truncated_graphemes - }; + let truncated_text = truncate_text( + &channel_name, + config.truncation_length as usize, + config.truncation_symbol, + ); let parsed = StringFormatter::new(config.format).and_then(|formatter| { formatter @@ -58,7 +44,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { _ => None, }) .map(|variable| match variable { - "channel" => Some(Ok(truncated_and_symbol.as_str())), + "channel" => Some(Ok(&truncated_text)), _ => None, }) .parse(None, Some(context)) @@ -84,34 +70,11 @@ fn get_pijul_current_channel(ctx: &Context) -> Option { .map(str::to_owned) } -fn get_graphemes(text: &str, length: usize) -> String { - UnicodeSegmentation::graphemes(text, true) - .take(length) - .collect::>() - .concat() -} - -fn graphemes_len(text: &str) -> usize { - UnicodeSegmentation::graphemes(text, true).count() -} - #[cfg(test)] mod tests { - use nu_ansi_term::{Color, Style}; use std::io; - use std::path::Path; - - use crate::test::{fixture_repo, FixtureProvider, ModuleRenderer}; - use crate::utils::create_command; - - enum Expect<'a> { - ChannelName(&'a str), - Empty, - NoTruncation, - Symbol(&'a str), - Style(Style), - TruncationSymbol(&'a str), - } + + use crate::test::ModuleRenderer; #[test] fn show_nothing_on_empty_dir() -> io::Result<()> { @@ -123,129 +86,4 @@ mod tests { assert_eq!(expected, actual); repo_dir.close() } - - #[test] - #[ignore] - fn test_pijul_disabled_per_default() -> io::Result<()> { - let tempdir = fixture_repo(FixtureProvider::Pijul)?; - let repo_dir = tempdir.path(); - expect_pijul_with_config( - repo_dir, - Some(toml::toml! { - [pijul] - truncation_length = 14 - }), - &[Expect::Empty], - ); - tempdir.close() - } - - #[test] - #[ignore] - fn test_pijul_autodisabled() -> io::Result<()> { - let tempdir = tempfile::tempdir()?; - expect_pijul_with_config(tempdir.path(), None, &[Expect::Empty]); - tempdir.close() - } - - #[test] - #[ignore] - fn test_pijul_channel() -> io::Result<()> { - let tempdir = fixture_repo(FixtureProvider::Pijul)?; - let repo_dir = tempdir.path(); - run_pijul(&["channel", "new", "tributary"], repo_dir)?; - run_pijul(&["channel", "switch", "tributary"], repo_dir)?; - expect_pijul_with_config( - repo_dir, - None, - &[Expect::ChannelName("tributary"), Expect::NoTruncation], - ); - tempdir.close() - } - - #[test] - #[ignore] - fn test_pijul_configured() -> io::Result<()> { - let tempdir = fixture_repo(FixtureProvider::Pijul)?; - let repo_dir = tempdir.path(); - run_pijul(&["channel", "new", "tributary-48198"], repo_dir)?; - run_pijul(&["channel", "switch", "tributary-48198"], repo_dir)?; - expect_pijul_with_config( - repo_dir, - Some(toml::toml! { - [pijul] - style = "underline blue" - symbol = "P " - truncation_length = 14 - truncation_symbol = "%" - disabled = false - }), - &[ - Expect::ChannelName("tributary-4819"), - Expect::Style(Color::Blue.underline()), - Expect::Symbol("P"), - Expect::TruncationSymbol("%"), - ], - ); - tempdir.close() - } - - fn expect_pijul_with_config( - repo_dir: &Path, - config: Option, - expectations: &[Expect], - ) { - let actual = ModuleRenderer::new("pijul") - .path(repo_dir.to_str().unwrap()) - .config(config.unwrap_or_else(|| { - toml::toml! { - [pijul] - disabled = false - } - })) - .collect(); - - let mut expect_channel_name = "main"; - let mut expect_style = Color::Purple.bold(); - let mut expect_symbol = "\u{e0a0}"; - let mut expect_truncation_symbol = "…"; - - for expect in expectations { - match expect { - Expect::Empty => { - assert_eq!(None, actual); - return; - } - Expect::Symbol(symbol) => { - expect_symbol = symbol; - } - Expect::TruncationSymbol(truncation_symbol) => { - expect_truncation_symbol = truncation_symbol; - } - Expect::NoTruncation => { - expect_truncation_symbol = ""; - } - Expect::ChannelName(channel_name) => { - expect_channel_name = channel_name; - } - Expect::Style(style) => expect_style = *style, - } - } - - let expected = Some(format!( - "on {} ", - expect_style.paint(format!( - "{expect_symbol} {expect_channel_name}{expect_truncation_symbol}" - )), - )); - assert_eq!(expected, actual); - } - - fn run_pijul(args: &[&str], repo_dir: &Path) -> io::Result<()> { - create_command("pijul")? - .args(args) - .current_dir(repo_dir) - .output()?; - Ok(()) - } } diff --git a/src/test/mod.rs b/src/test/mod.rs index cb5e85622ad6..c6320226af6a 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -165,7 +165,6 @@ impl<'a> ModuleRenderer<'a> { pub enum FixtureProvider { Git, Hg, - Pijul, } pub fn fixture_repo(provider: FixtureProvider) -> io::Result { @@ -224,16 +223,5 @@ pub fn fixture_repo(provider: FixtureProvider) -> io::Result { Ok(path) } - FixtureProvider::Pijul => { - let path = tempfile::tempdir()?; - - create_command("pijul")? - .current_dir(path.path()) - .arg("init") - .arg(path.path()) - .output()?; - - Ok(path) - } } } From 2e69fd653398f5c753003bdc5ca19627e1519ea8 Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Wed, 28 Dec 2022 10:50:39 -0500 Subject: [PATCH 06/14] Format! --- src/modules/pijul.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/pijul.rs b/src/modules/pijul.rs index f57c37cf548e..0c8d35887445 100644 --- a/src/modules/pijul.rs +++ b/src/modules/pijul.rs @@ -1,5 +1,5 @@ -use super::{Context, Module, ModuleConfig}; use super::utils::truncate::truncate_text; +use super::{Context, Module, ModuleConfig}; use crate::configs::pijul::PijulConfig; use crate::formatter::StringFormatter; From f0da988ad05b1d1c3b843661ab113ec790442543 Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Wed, 28 Dec 2022 10:56:59 -0500 Subject: [PATCH 07/14] Bad rebase, remove Pijul install from workflow. --- .github/workflows/workflow.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ee86e33f5673..234648476f61 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -207,10 +207,6 @@ jobs: if: matrix.os == 'macOS-latest' run: brew install mercurial - # Install Pijul - - name: Setup | Pijul - run: cargo install pijul --version "~1.0.0-beta" - # Run the ignored tests that expect the above setup - name: Build | Test run: "cargo llvm-cov From 9984a9595f66a108b752639273f4132449191a21 Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Wed, 28 Dec 2022 11:20:39 -0500 Subject: [PATCH 08/14] Mock Pijul commands for code coverage. --- src/modules/pijul.rs | 134 +++++++++++++++++++++++++++++++++++++++++++ src/utils.rs | 12 ++++ 2 files changed, 146 insertions(+) diff --git a/src/modules/pijul.rs b/src/modules/pijul.rs index 0c8d35887445..5323ef0607b2 100644 --- a/src/modules/pijul.rs +++ b/src/modules/pijul.rs @@ -72,9 +72,21 @@ fn get_pijul_current_channel(ctx: &Context) -> Option { #[cfg(test)] mod tests { + use nu_ansi_term::{Color, Style}; use std::io; + use std::path::Path; use crate::test::ModuleRenderer; + use crate::utils::create_command; + + enum Expect<'a> { + ChannelName(&'a str), + Empty, + NoTruncation, + Symbol(&'a str), + Style(Style), + TruncationSymbol(&'a str), + } #[test] fn show_nothing_on_empty_dir() -> io::Result<()> { @@ -86,4 +98,126 @@ mod tests { assert_eq!(expected, actual); repo_dir.close() } + + #[test] + #[ignore] + fn test_pijul_disabled_per_default() -> io::Result<()> { + let repo_dir = tempfile::tempdir()?; + expect_pijul_with_config( + repo_dir.path(), + Some(toml::toml! { + [pijul] + truncation_length = 14 + }), + &[Expect::Empty], + ); + repo_dir.close() + } + + #[test] + #[ignore] + fn test_pijul_autodisabled() -> io::Result<()> { + let repo_dir = tempfile::tempdir()?; + expect_pijul_with_config(repo_dir.path(), None, &[Expect::Empty]); + repo_dir.close() + } + + #[test] + #[ignore] + fn test_pijul_channel() -> io::Result<()> { + let repo_dir = tempfile::tempdir()?; + run_pijul(&["channel", "new", "tributary-48198"], repo_dir.path())?; + run_pijul(&["channel", "switch", "tributary-48198"], repo_dir.path())?; + expect_pijul_with_config( + repo_dir.path(), + None, + &[Expect::ChannelName("tributary"), Expect::NoTruncation], + ); + repo_dir.close() + } + + #[test] + #[ignore] + fn test_pijul_configured() -> io::Result<()> { + let repo_dir = tempfile::tempdir()?; + run_pijul(&["channel", "new", "tributary-48198"], repo_dir.path())?; + run_pijul(&["channel", "switch", "tributary-48198"], repo_dir.path())?; + expect_pijul_with_config( + repo_dir.path(), + Some(toml::toml! { + [pijul] + style = "underline blue" + symbol = "P " + truncation_length = 14 + truncation_symbol = "%" + disabled = false + }), + &[ + Expect::ChannelName("tributary-4819"), + Expect::Style(Color::Blue.underline()), + Expect::Symbol("P"), + Expect::TruncationSymbol("%"), + ], + ); + repo_dir.close() + } + + fn expect_pijul_with_config( + repo_dir: &Path, + config: Option, + expectations: &[Expect], + ) { + let actual = ModuleRenderer::new("pijul") + .path(repo_dir.to_str().unwrap()) + .config(config.unwrap_or_else(|| { + toml::toml! { + [pijul] + disabled = false + } + })) + .collect(); + + let mut expect_channel_name = "main"; + let mut expect_style = Color::Purple.bold(); + let mut expect_symbol = "\u{e0a0}"; + let mut expect_truncation_symbol = "…"; + + for expect in expectations { + match expect { + Expect::Empty => { + assert_eq!(None, actual); + return; + } + Expect::Symbol(symbol) => { + expect_symbol = symbol; + } + Expect::TruncationSymbol(truncation_symbol) => { + expect_truncation_symbol = truncation_symbol; + } + Expect::NoTruncation => { + expect_truncation_symbol = ""; + } + Expect::ChannelName(channel_name) => { + expect_channel_name = channel_name; + } + Expect::Style(style) => expect_style = *style, + } + } + + let expected = Some(format!( + "on {} ", + expect_style.paint(format!( + "{expect_symbol} {expect_channel_name}{expect_truncation_symbol}" + )), + )); + assert_eq!(expected, actual); + } + + fn run_pijul(args: &[&str], repo_dir: &Path) -> io::Result<()> { + create_command("pijul")? + .args(args) + .current_dir(repo_dir) + .output()?; + Ok(()) + } } diff --git a/src/utils.rs b/src/utils.rs index 1d035dacad7a..1cbed2e3d7c2 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -337,6 +337,18 @@ WebAssembly: unavailable stderr: String::default(), }) }, + "pijul channel" => Some(CommandOutput{ + stdout: String::from(" main\n* tributary-48198"), + stderr: String::default(), + }), + "pijul channel new tributary-48198" => Some(CommandOutput{ + stdout: String::default(), + stderr: String::default(), + }), + "pijul channel switch tributary-48198" => Some(CommandOutput{ + stdout: String::from("Outputting repository ↖"), + stderr: String::default(), + }), "pulumi version" => Some(CommandOutput{ stdout: String::from("1.2.3-ver.1631311768+e696fb6c"), stderr: String::default(), From eb04584e3d5db4d368babb75c76cb5e3be3d0b67 Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Wed, 28 Dec 2022 12:26:20 -0500 Subject: [PATCH 09/14] Make fake .pijul directory in fixture. --- src/modules/pijul.rs | 43 +++++++++++++++++++++---------------------- src/test/mod.rs | 7 +++++++ 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/modules/pijul.rs b/src/modules/pijul.rs index 5323ef0607b2..acf91df81ff6 100644 --- a/src/modules/pijul.rs +++ b/src/modules/pijul.rs @@ -76,7 +76,7 @@ mod tests { use std::io; use std::path::Path; - use crate::test::ModuleRenderer; + use crate::test::{fixture_repo, FixtureProvider, ModuleRenderer}; use crate::utils::create_command; enum Expect<'a> { @@ -100,50 +100,49 @@ mod tests { } #[test] - #[ignore] fn test_pijul_disabled_per_default() -> io::Result<()> { - let repo_dir = tempfile::tempdir()?; + let tempdir = fixture_repo(FixtureProvider::Pijul)?; + let repo_dir = tempdir.path(); expect_pijul_with_config( - repo_dir.path(), + repo_dir, Some(toml::toml! { [pijul] truncation_length = 14 }), &[Expect::Empty], ); - repo_dir.close() + tempdir.close() } #[test] - #[ignore] fn test_pijul_autodisabled() -> io::Result<()> { - let repo_dir = tempfile::tempdir()?; - expect_pijul_with_config(repo_dir.path(), None, &[Expect::Empty]); - repo_dir.close() + let tempdir = tempfile::tempdir()?; + expect_pijul_with_config(tempdir.path(), None, &[Expect::Empty]); + tempdir.close() } #[test] - #[ignore] fn test_pijul_channel() -> io::Result<()> { - let repo_dir = tempfile::tempdir()?; - run_pijul(&["channel", "new", "tributary-48198"], repo_dir.path())?; - run_pijul(&["channel", "switch", "tributary-48198"], repo_dir.path())?; + let tempdir = fixture_repo(FixtureProvider::Pijul)?; + let repo_dir = tempdir.path(); + run_pijul(&["channel", "new", "tributary-48198"], repo_dir)?; + run_pijul(&["channel", "switch", "tributary-48198"], repo_dir)?; expect_pijul_with_config( - repo_dir.path(), + repo_dir, None, - &[Expect::ChannelName("tributary"), Expect::NoTruncation], + &[Expect::ChannelName("tributary-48198"), Expect::NoTruncation], ); - repo_dir.close() + tempdir.close() } #[test] - #[ignore] fn test_pijul_configured() -> io::Result<()> { - let repo_dir = tempfile::tempdir()?; - run_pijul(&["channel", "new", "tributary-48198"], repo_dir.path())?; - run_pijul(&["channel", "switch", "tributary-48198"], repo_dir.path())?; + let tempdir = fixture_repo(FixtureProvider::Pijul)?; + let repo_dir = tempdir.path(); + run_pijul(&["channel", "new", "tributary-48198"], repo_dir)?; + run_pijul(&["channel", "switch", "tributary-48198"], repo_dir)?; expect_pijul_with_config( - repo_dir.path(), + repo_dir, Some(toml::toml! { [pijul] style = "underline blue" @@ -159,7 +158,7 @@ mod tests { Expect::TruncationSymbol("%"), ], ); - repo_dir.close() + tempdir.close() } fn expect_pijul_with_config( diff --git a/src/test/mod.rs b/src/test/mod.rs index c6320226af6a..c761bb981cb6 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -7,6 +7,7 @@ use crate::{ }; use log::{Level, LevelFilter}; use once_cell::sync::Lazy; +use std::fs; use std::io; use std::path::{Path, PathBuf}; use tempfile::TempDir; @@ -165,6 +166,7 @@ impl<'a> ModuleRenderer<'a> { pub enum FixtureProvider { Git, Hg, + Pijul, } pub fn fixture_repo(provider: FixtureProvider) -> io::Result { @@ -223,5 +225,10 @@ pub fn fixture_repo(provider: FixtureProvider) -> io::Result { Ok(path) } + FixtureProvider::Pijul => { + let path = tempfile::tempdir()?; + fs::create_dir(path.path().join(".pijul"))?; + Ok(path) + } } } From bc951825e11eb5c5955e3db84bf8a31df66e3b1a Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Wed, 28 Dec 2022 22:36:11 -0500 Subject: [PATCH 10/14] Truly mock `pijul` command. --- src/modules/pijul.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/modules/pijul.rs b/src/modules/pijul.rs index acf91df81ff6..1cbfdcc6b409 100644 --- a/src/modules/pijul.rs +++ b/src/modules/pijul.rs @@ -77,7 +77,6 @@ mod tests { use std::path::Path; use crate::test::{fixture_repo, FixtureProvider, ModuleRenderer}; - use crate::utils::create_command; enum Expect<'a> { ChannelName(&'a str), @@ -212,11 +211,8 @@ mod tests { assert_eq!(expected, actual); } - fn run_pijul(args: &[&str], repo_dir: &Path) -> io::Result<()> { - create_command("pijul")? - .args(args) - .current_dir(repo_dir) - .output()?; + fn run_pijul(args: &[&str], _repo_dir: &Path) -> io::Result<()> { + crate::utils::mock_cmd("pijul", args).ok_or(io::ErrorKind::Unsupported)?; Ok(()) } } From 0dc1b2684bef12b97d72c12bbebdbef4999fa2a6 Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Thu, 29 Dec 2022 08:47:55 -0500 Subject: [PATCH 11/14] Rename module from `pijul` to `pijul_channel`. --- docs/config/README.md | 4 ++-- src/configs/mod.rs | 4 ++-- src/configs/{pijul.rs => pijul_channel.rs} | 0 src/configs/starship_root.rs | 2 +- src/module.rs | 2 +- src/modules/mod.rs | 6 +++--- src/modules/{pijul.rs => pijul_channel.rs} | 16 ++++++++-------- 7 files changed, 17 insertions(+), 17 deletions(-) rename src/configs/{pijul.rs => pijul_channel.rs} (100%) rename src/modules/{pijul.rs => pijul_channel.rs} (93%) diff --git a/docs/config/README.md b/docs/config/README.md index 7fef080ea70c..bbd541ba5a9b 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -271,7 +271,7 @@ $git_state\ $git_metrics\ $git_status\ $hg_branch\ -$pijul\ +$pijul_channel\ $docker_context\ $package\ $c\ @@ -3165,7 +3165,7 @@ format = 'via [🔹 $version](147 bold) ' ## Pijul Channel -The `pijul` module shows the active channel of the repo in your current directory. +The `pijul_channel` module shows the active channel of the repo in your current directory. ### Options diff --git a/src/configs/mod.rs b/src/configs/mod.rs index 69ee38a076c0..0aee1fe44e3b 100644 --- a/src/configs/mod.rs +++ b/src/configs/mod.rs @@ -61,7 +61,7 @@ pub mod os; pub mod package; pub mod perl; pub mod php; -pub mod pijul; +pub mod pijul_channel; pub mod pulumi; pub mod purescript; pub mod python; @@ -222,7 +222,7 @@ pub struct FullConfig<'a> { #[serde(borrow)] php: php::PhpConfig<'a>, #[serde(borrow)] - pijul: pijul::PijulConfig<'a>, + pijul_channel: pijul_channel::PijulConfig<'a>, #[serde(borrow)] pulumi: pulumi::PulumiConfig<'a>, #[serde(borrow)] diff --git a/src/configs/pijul.rs b/src/configs/pijul_channel.rs similarity index 100% rename from src/configs/pijul.rs rename to src/configs/pijul_channel.rs diff --git a/src/configs/starship_root.rs b/src/configs/starship_root.rs index fd395dad00b5..d857ae55f892 100644 --- a/src/configs/starship_root.rs +++ b/src/configs/starship_root.rs @@ -42,7 +42,7 @@ pub const PROMPT_ORDER: &[&str] = &[ "git_metrics", "git_status", "hg_branch", - "pijul", + "pijul_channel", "docker_context", "package", // ↓ Toolchain version modules ↓ diff --git a/src/module.rs b/src/module.rs index 3264f302393e..580d53f94cec 100644 --- a/src/module.rs +++ b/src/module.rs @@ -69,7 +69,7 @@ pub const ALL_MODULES: &[&str] = &[ "package", "perl", "php", - "pijul", + "pijul_channel", "pulumi", "purescript", "python", diff --git a/src/modules/mod.rs b/src/modules/mod.rs index 1963f0a2c753..b63352cc479f 100644 --- a/src/modules/mod.rs +++ b/src/modules/mod.rs @@ -58,7 +58,7 @@ mod os; mod package; mod perl; mod php; -mod pijul; +mod pijul_channel; mod pulumi; mod purescript; mod python; @@ -160,7 +160,7 @@ pub fn handle<'a>(module: &str, context: &'a Context) -> Option> { "package" => package::module(context), "perl" => perl::module(context), "php" => php::module(context), - "pijul" => pijul::module(context), + "pijul_channel" => pijul_channel::module(context), "pulumi" => pulumi::module(context), "purescript" => purescript::module(context), "python" => python::module(context), @@ -275,7 +275,7 @@ pub fn description(module: &str) -> &'static str { "package" => "The package version of the current directory's project", "perl" => "The currently installed version of Perl", "php" => "The currently installed version of PHP", - "pijul" => "The current channel of the repo in the current directory", + "pijul_channel" => "The current channel of the repo in the current directory", "pulumi" => "The current username, stack, and installed version of Pulumi", "purescript" => "The currently installed version of PureScript", "python" => "The currently installed version of Python", diff --git a/src/modules/pijul.rs b/src/modules/pijul_channel.rs similarity index 93% rename from src/modules/pijul.rs rename to src/modules/pijul_channel.rs index 1cbfdcc6b409..fce405fab2cf 100644 --- a/src/modules/pijul.rs +++ b/src/modules/pijul_channel.rs @@ -1,7 +1,7 @@ use super::utils::truncate::truncate_text; use super::{Context, Module, ModuleConfig}; -use crate::configs::pijul::PijulConfig; +use crate::configs::pijul_channel::PijulConfig; use crate::formatter::StringFormatter; /// Creates a module with the Pijul channel in the current directory @@ -17,7 +17,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { return None; } - let mut module = context.new_module("pijul"); + let mut module = context.new_module("pijul_channel"); let config: PijulConfig = PijulConfig::try_load(module.config); // We default to disabled=true, so we have to check after loading our config module. @@ -53,7 +53,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { module.set_segments(match parsed { Ok(segments) => segments, Err(error) => { - log::warn!("Error in module `pijul`:\n{}", error); + log::warn!("Error in module `pijul_channel`:\n{}", error); return None; } }); @@ -91,7 +91,7 @@ mod tests { fn show_nothing_on_empty_dir() -> io::Result<()> { let repo_dir = tempfile::tempdir()?; - let actual = ModuleRenderer::new("pijul").path(repo_dir.path()).collect(); + let actual = ModuleRenderer::new("pijul_channel").path(repo_dir.path()).collect(); let expected = None; assert_eq!(expected, actual); @@ -105,7 +105,7 @@ mod tests { expect_pijul_with_config( repo_dir, Some(toml::toml! { - [pijul] + [pijul_channel] truncation_length = 14 }), &[Expect::Empty], @@ -143,7 +143,7 @@ mod tests { expect_pijul_with_config( repo_dir, Some(toml::toml! { - [pijul] + [pijul_channel] style = "underline blue" symbol = "P " truncation_length = 14 @@ -165,11 +165,11 @@ mod tests { config: Option, expectations: &[Expect], ) { - let actual = ModuleRenderer::new("pijul") + let actual = ModuleRenderer::new("pijul_channel") .path(repo_dir.to_str().unwrap()) .config(config.unwrap_or_else(|| { toml::toml! { - [pijul] + [pijul_channel] disabled = false } })) From 9f9b7aced951506f06531816642d947c196ab9e9 Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Thu, 29 Dec 2022 08:50:08 -0500 Subject: [PATCH 12/14] Format! --- src/modules/pijul_channel.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/pijul_channel.rs b/src/modules/pijul_channel.rs index fce405fab2cf..c5af4814b486 100644 --- a/src/modules/pijul_channel.rs +++ b/src/modules/pijul_channel.rs @@ -91,7 +91,9 @@ mod tests { fn show_nothing_on_empty_dir() -> io::Result<()> { let repo_dir = tempfile::tempdir()?; - let actual = ModuleRenderer::new("pijul_channel").path(repo_dir.path()).collect(); + let actual = ModuleRenderer::new("pijul_channel") + .path(repo_dir.path()) + .collect(); let expected = None; assert_eq!(expected, actual); From e28bfe8791aed967487d319c6508ff61a552b535 Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Thu, 29 Dec 2022 08:57:20 -0500 Subject: [PATCH 13/14] Fix config-schema.json. --- .github/config-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/config-schema.json b/.github/config-schema.json index 5f55dfc50011..87af3a711a98 100644 --- a/.github/config-schema.json +++ b/.github/config-schema.json @@ -1213,7 +1213,7 @@ } ] }, - "pijul": { + "pijul_channel": { "default": { "disabled": true, "format": "on [$symbol$channel]($style) ", From e833a6a0c76988488e19bc578afacfa611039b7b Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Thu, 29 Dec 2022 09:18:48 -0500 Subject: [PATCH 14/14] Missed changing module name in docs/ folder. --- docs/.vuepress/public/presets/toml/bracketed-segments.toml | 2 +- docs/.vuepress/public/presets/toml/nerd-font-symbols.toml | 2 +- docs/.vuepress/public/presets/toml/plain-text-symbols.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/.vuepress/public/presets/toml/bracketed-segments.toml b/docs/.vuepress/public/presets/toml/bracketed-segments.toml index eda891d36156..98d3cef2cd63 100644 --- a/docs/.vuepress/public/presets/toml/bracketed-segments.toml +++ b/docs/.vuepress/public/presets/toml/bracketed-segments.toml @@ -130,7 +130,7 @@ format = '\[[$symbol($version)]($style)\]' [php] format = '\[[$symbol($version)]($style)\]' -[pijul] +[pijul_channel] format = '\[[$symbol$channel]($style)\]' [pulumi] diff --git a/docs/.vuepress/public/presets/toml/nerd-font-symbols.toml b/docs/.vuepress/public/presets/toml/nerd-font-symbols.toml index 433a8151b4cd..49945e1ade33 100644 --- a/docs/.vuepress/public/presets/toml/nerd-font-symbols.toml +++ b/docs/.vuepress/public/presets/toml/nerd-font-symbols.toml @@ -108,7 +108,7 @@ Windows = " " [package] symbol = " " -[pijul] +[pijul_channel] symbol = "🪺 " [python] diff --git a/docs/.vuepress/public/presets/toml/plain-text-symbols.toml b/docs/.vuepress/public/presets/toml/plain-text-symbols.toml index 95322673f662..c1cdbde1a635 100644 --- a/docs/.vuepress/public/presets/toml/plain-text-symbols.toml +++ b/docs/.vuepress/public/presets/toml/plain-text-symbols.toml @@ -156,7 +156,7 @@ symbol = "pl " [php] symbol = "php " -[pijul] +[pijul_channel] symbol = "pijul " [pulumi]