diff options
author | Moritz Vetter <moritz.vetter@gmx.de> | 2021-01-20 18:46:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-20 18:46:26 +0100 |
commit | 527ffbaede6a7b487805beb6b5791bd6f8ed99e2 (patch) | |
tree | 59c90c33aebf2641b4d594e7edee9e7587f7c6e4 /src | |
parent | e437a463ac5c072e90e49b912ed15729650a52d8 (diff) |
fix: Adjust default format strings (#2165)
* fix(dotnet): update dotnet format string
* fix(dotnet): update erlang format string
* fix(dotnet): update golang format string
* fix(dotnet): update helm format string
* fix(dotnet): update julia format string
* fix(dotnet): update nim format string
* fix(dotnet): update ruby format string
* fix(dotnet): update rust format string
* test: update formatted strings in unit tests
* Use suggested format strings
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
Co-authored-by: Moritz Vetter <mv@3yourmind.com>
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/configs/dotnet.rs | 2 | ||||
-rw-r--r-- | src/configs/erlang.rs | 2 | ||||
-rw-r--r-- | src/configs/go.rs | 2 | ||||
-rw-r--r-- | src/configs/helm.rs | 2 | ||||
-rw-r--r-- | src/configs/julia.rs | 2 | ||||
-rw-r--r-- | src/configs/nim.rs | 2 | ||||
-rw-r--r-- | src/configs/ruby.rs | 2 | ||||
-rw-r--r-- | src/configs/rust.rs | 2 | ||||
-rw-r--r-- | src/modules/dotnet.rs | 36 | ||||
-rw-r--r-- | src/modules/erlang.rs | 2 | ||||
-rw-r--r-- | src/modules/golang.rs | 16 | ||||
-rw-r--r-- | src/modules/helm.rs | 4 | ||||
-rw-r--r-- | src/modules/julia.rs | 6 | ||||
-rw-r--r-- | src/modules/nim.rs | 8 | ||||
-rw-r--r-- | src/modules/ruby.rs | 6 |
15 files changed, 47 insertions, 47 deletions
diff --git a/src/configs/dotnet.rs b/src/configs/dotnet.rs index df5018702..b7cfe5c0d 100644 --- a/src/configs/dotnet.rs +++ b/src/configs/dotnet.rs @@ -14,7 +14,7 @@ pub struct DotnetConfig<'a> { impl<'a> RootModuleConfig<'a> for DotnetConfig<'a> {
fn new() -> Self {
DotnetConfig {
- format: "[$symbol$version( 🎯 $tfm)]($style) ",
+ format: "[$symbol($version )(🎯 $tfm )]($style)",
symbol: "•NET ",
style: "blue bold",
heuristic: true,
diff --git a/src/configs/erlang.rs b/src/configs/erlang.rs index 368368a9e..7f4582919 100644 --- a/src/configs/erlang.rs +++ b/src/configs/erlang.rs @@ -13,7 +13,7 @@ pub struct ErlangConfig<'a> { impl<'a> RootModuleConfig<'a> for ErlangConfig<'a> { fn new() -> Self { ErlangConfig { - format: "via [$symbol$version]($style) ", + format: "via [$symbol($version )]($style)", symbol: " ", style: "bold red", disabled: false, diff --git a/src/configs/go.rs b/src/configs/go.rs index e1264f523..7bc77e7ed 100644 --- a/src/configs/go.rs +++ b/src/configs/go.rs @@ -13,7 +13,7 @@ pub struct GoConfig<'a> { impl<'a> RootModuleConfig<'a> for GoConfig<'a> { fn new() -> Self { GoConfig { - format: "via [$symbol$version]($style) ", + format: "via [$symbol($version )]($style)", symbol: "🐹 ", style: "bold cyan", disabled: false, diff --git a/src/configs/helm.rs b/src/configs/helm.rs index 740bdc070..afcf651ae 100644 --- a/src/configs/helm.rs +++ b/src/configs/helm.rs @@ -13,7 +13,7 @@ pub struct HelmConfig<'a> { impl<'a> RootModuleConfig<'a> for HelmConfig<'a> { fn new() -> Self { HelmConfig { - format: "via [$symbol$version]($style) ", + format: "via [$symbol($version )]($style)", symbol: "⎈ ", style: "bold white", disabled: false, diff --git a/src/configs/julia.rs b/src/configs/julia.rs index ca1abbe9e..6d99ad5e8 100644 --- a/src/configs/julia.rs +++ b/src/configs/julia.rs @@ -13,7 +13,7 @@ pub struct JuliaConfig<'a> { impl<'a> RootModuleConfig<'a> for JuliaConfig<'a> { fn new() -> Self { JuliaConfig { - format: "via [$symbol$version]($style) ", + format: "via [$symbol($version )]($style)", symbol: "ஃ ", style: "bold purple", disabled: false, diff --git a/src/configs/nim.rs b/src/configs/nim.rs index 5536a739a..752b01783 100644 --- a/src/configs/nim.rs +++ b/src/configs/nim.rs @@ -13,7 +13,7 @@ pub struct NimConfig<'a> { impl<'a> RootModuleConfig<'a> for NimConfig<'a> { fn new() -> Self { NimConfig { - format: "via [$symbol$version]($style) ", + format: "via [$symbol($version )]($style)", symbol: "👑 ", style: "yellow bold", disabled: false, diff --git a/src/configs/ruby.rs b/src/configs/ruby.rs index 5a1384a8e..af41d5132 100644 --- a/src/configs/ruby.rs +++ b/src/configs/ruby.rs @@ -13,7 +13,7 @@ pub struct RubyConfig<'a> { impl<'a> RootModuleConfig<'a> for RubyConfig<'a> { fn new() -> Self { RubyConfig { - format: "via [$symbol$version]($style) ", + format: "via [$symbol($version )]($style)", symbol: "💎 ", style: "bold red", disabled: false, diff --git a/src/configs/rust.rs b/src/configs/rust.rs index ab39c4349..974c5ede0 100644 --- a/src/configs/rust.rs +++ b/src/configs/rust.rs @@ -13,7 +13,7 @@ pub struct RustConfig<'a> { impl<'a> RootModuleConfig<'a> for RustConfig<'a> { fn new() -> Self { RustConfig { - format: "via [$symbol$version]($style) ", + format: "via [$symbol($version )]($style)", symbol: "🦀 ", style: "bold red", disabled: false, diff --git a/src/modules/dotnet.rs b/src/modules/dotnet.rs index 4fc71de64..eea1bdbc8 100644 --- a/src/modules/dotnet.rs +++ b/src/modules/dotnet.rs @@ -376,7 +376,7 @@ mod tests { touch_path(&workspace, "Directory.Build.props", None)?; expect_output( &workspace.path(), - Some(format!("{} ", Color::Blue.bold().paint("•NET v3.1.103"))), + Some(format!("{}", Color::Blue.bold().paint("•NET v3.1.103 "))), )?; workspace.close() } @@ -387,7 +387,7 @@ mod tests { touch_path(&workspace, "Directory.Build.targets", None)?; expect_output( &workspace.path(), - Some(format!("{} ", Color::Blue.bold().paint("•NET v3.1.103"))), + Some(format!("{}", Color::Blue.bold().paint("•NET v3.1.103 "))), )?; workspace.close() } @@ -398,7 +398,7 @@ mod tests { touch_path(&workspace, "Packages.props", None)?; expect_output( &workspace.path(), - Some(format!("{} ", Color::Blue.bold().paint("•NET v3.1.103"))), + Some(format!("{}", Color::Blue.bold().paint("•NET v3.1.103 "))), )?; workspace.close() } @@ -409,7 +409,7 @@ mod tests { touch_path(&workspace, "solution.sln", None)?; expect_output( &workspace.path(), - Some(format!("{} ", Color::Blue.bold().paint("•NET v3.1.103"))), + Some(format!("{}", Color::Blue.bold().paint("•NET v3.1.103 "))), )?; workspace.close() } @@ -422,8 +422,8 @@ mod tests { expect_output( &workspace.path(), Some(format!( - "{} ", - Color::Blue.bold().paint("•NET v3.1.103 🎯 netstandard2.0") + "{}", + Color::Blue.bold().paint("•NET v3.1.103 🎯 netstandard2.0 ") )), )?; workspace.close() @@ -435,7 +435,7 @@ mod tests { touch_path(&workspace, "project.fsproj", None)?; expect_output( &workspace.path(), - Some(format!("{} ", Color::Blue.bold().paint("•NET v3.1.103"))), + Some(format!("{}", Color::Blue.bold().paint("•NET v3.1.103 "))), )?; workspace.close() } @@ -446,7 +446,7 @@ mod tests { touch_path(&workspace, "project.xproj", None)?; expect_output( &workspace.path(), - Some(format!("{} ", Color::Blue.bold().paint("•NET v3.1.103"))), + Some(format!("{}", Color::Blue.bold().paint("•NET v3.1.103 "))), )?; workspace.close() } @@ -457,7 +457,7 @@ mod tests { touch_path(&workspace, "project.json", None)?; expect_output( &workspace.path(), - Some(format!("{} ", Color::Blue.bold().paint("•NET v3.1.103"))), + Some(format!("{}", Color::Blue.bold().paint("•NET v3.1.103 "))), )?; workspace.close() } @@ -469,7 +469,7 @@ mod tests { touch_path(&workspace, "global.json", Some(&global_json))?; expect_output( &workspace.path(), - Some(format!("{} ", Color::Blue.bold().paint("•NET v1.2.3"))), + Some(format!("{}", Color::Blue.bold().paint("•NET v1.2.3 "))), )?; workspace.close() } @@ -484,8 +484,8 @@ mod tests { expect_output( &workspace.path().join("project"), Some(format!( - "{} ", - Color::Blue.bold().paint("•NET v1.2.3 🎯 netstandard2.0") + "{}", + Color::Blue.bold().paint("•NET v1.2.3 🎯 netstandard2.0 ") )), )?; workspace.close() @@ -505,8 +505,8 @@ mod tests { expect_output( &workspace.path().join("deep/path/to/project"), Some(format!( - "{} ", - Color::Blue.bold().paint("•NET v1.2.3 🎯 netstandard2.0") + "{}", + Color::Blue.bold().paint("•NET v1.2.3 🎯 netstandard2.0 ") )), )?; workspace.close() @@ -520,8 +520,8 @@ mod tests { expect_output( workspace.path(), Some(format!( - "{} ", - Color::Blue.bold().paint("•NET v3.1.103 🎯 netstandard2.0") + "{}", + Color::Blue.bold().paint("•NET v3.1.103 🎯 netstandard2.0 ") )), )?; workspace.close() @@ -535,10 +535,10 @@ mod tests { expect_output( workspace.path(), Some(format!( - "{} ", + "{}", Color::Blue .bold() - .paint("•NET v3.1.103 🎯 netstandard2.0;net461") + .paint("•NET v3.1.103 🎯 netstandard2.0;net461 ") )), )?; workspace.close() diff --git a/src/modules/erlang.rs b/src/modules/erlang.rs index 5b2514c0d..02ddbd885 100644 --- a/src/modules/erlang.rs +++ b/src/modules/erlang.rs @@ -89,7 +89,7 @@ mod tests { let dir = tempfile::tempdir()?; File::create(dir.path().join("rebar.config"))?.sync_all()?; - let expected = Some(format!("via {} ", Color::Red.bold().paint(" 22.1.3"))); + let expected = Some(format!("via {}", Color::Red.bold().paint(" 22.1.3 "))); let output = ModuleRenderer::new("erlang").path(dir.path()).collect(); assert_eq!(output, expected); diff --git a/src/modules/golang.rs b/src/modules/golang.rs index 80ff1b794..58d5e744a 100644 --- a/src/modules/golang.rs +++ b/src/modules/golang.rs @@ -109,7 +109,7 @@ mod tests { let actual = ModuleRenderer::new("golang").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Cyan.bold().paint("🐹 v1.12.1"))); + let expected = Some(format!("via {}", Color::Cyan.bold().paint("🐹 v1.12.1 "))); assert_eq!(expected, actual); dir.close() } @@ -121,7 +121,7 @@ mod tests { let actual = ModuleRenderer::new("golang").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Cyan.bold().paint("🐹 v1.12.1"))); + let expected = Some(format!("via {}", Color::Cyan.bold().paint("🐹 v1.12.1 "))); assert_eq!(expected, actual); dir.close() } @@ -133,7 +133,7 @@ mod tests { let actual = ModuleRenderer::new("golang").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Cyan.bold().paint("🐹 v1.12.1"))); + let expected = Some(format!("via {}", Color::Cyan.bold().paint("🐹 v1.12.1 "))); assert_eq!(expected, actual); dir.close() } @@ -146,7 +146,7 @@ mod tests { let actual = ModuleRenderer::new("golang").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Cyan.bold().paint("🐹 v1.12.1"))); + let expected = Some(format!("via {}", Color::Cyan.bold().paint("🐹 v1.12.1 "))); assert_eq!(expected, actual); dir.close() } @@ -158,7 +158,7 @@ mod tests { let actual = ModuleRenderer::new("golang").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Cyan.bold().paint("🐹 v1.12.1"))); + let expected = Some(format!("via {}", Color::Cyan.bold().paint("🐹 v1.12.1 "))); assert_eq!(expected, actual); dir.close() } @@ -170,7 +170,7 @@ mod tests { let actual = ModuleRenderer::new("golang").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Cyan.bold().paint("🐹 v1.12.1"))); + let expected = Some(format!("via {}", Color::Cyan.bold().paint("🐹 v1.12.1 "))); assert_eq!(expected, actual); dir.close() } @@ -180,7 +180,7 @@ mod tests { File::create(dir.path().join("Gopkg.lock"))?.sync_all()?; let actual = ModuleRenderer::new("golang").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Cyan.bold().paint("🐹 v1.12.1"))); + let expected = Some(format!("via {}", Color::Cyan.bold().paint("🐹 v1.12.1 "))); assert_eq!(expected, actual); dir.close() } @@ -190,7 +190,7 @@ mod tests { File::create(dir.path().join(".go-version"))?.sync_all()?; let actual = ModuleRenderer::new("golang").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Cyan.bold().paint("🐹 v1.12.1"))); + let expected = Some(format!("via {}", Color::Cyan.bold().paint("🐹 v1.12.1 "))); assert_eq!(expected, actual); dir.close() } diff --git a/src/modules/helm.rs b/src/modules/helm.rs index 06cd85da2..9c80b7a91 100644 --- a/src/modules/helm.rs +++ b/src/modules/helm.rs @@ -100,7 +100,7 @@ mod tests { let actual = ModuleRenderer::new("helm").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::White.bold().paint("⎈ v3.1.1"))); + let expected = Some(format!("via {}", Color::White.bold().paint("⎈ v3.1.1 "))); assert_eq!(expected, actual); dir.close() } @@ -112,7 +112,7 @@ mod tests { let actual = ModuleRenderer::new("helm").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::White.bold().paint("⎈ v3.1.1"))); + let expected = Some(format!("via {}", Color::White.bold().paint("⎈ v3.1.1 "))); assert_eq!(expected, actual); dir.close() } diff --git a/src/modules/julia.rs b/src/modules/julia.rs index 11bfe7446..cfd292fa9 100644 --- a/src/modules/julia.rs +++ b/src/modules/julia.rs @@ -95,7 +95,7 @@ mod tests { let actual = ModuleRenderer::new("julia").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Purple.bold().paint("ஃ v1.4.0"))); + let expected = Some(format!("via {}", Color::Purple.bold().paint("ஃ v1.4.0 "))); assert_eq!(expected, actual); dir.close() } @@ -107,7 +107,7 @@ mod tests { let actual = ModuleRenderer::new("julia").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Purple.bold().paint("ஃ v1.4.0"))); + let expected = Some(format!("via {}", Color::Purple.bold().paint("ஃ v1.4.0 "))); assert_eq!(expected, actual); dir.close() } @@ -119,7 +119,7 @@ mod tests { let actual = ModuleRenderer::new("julia").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Purple.bold().paint("ஃ v1.4.0"))); + let expected = Some(format!("via {}", Color::Purple.bold().paint("ஃ v1.4.0 "))); assert_eq!(expected, actual); dir.close() } diff --git a/src/modules/nim.rs b/src/modules/nim.rs index 15482fa7a..ce37711b6 100644 --- a/src/modules/nim.rs +++ b/src/modules/nim.rs @@ -111,7 +111,7 @@ mod tests { let dir = tempfile::tempdir()?; File::create(dir.path().join("main.nimble"))?.sync_all()?; let actual = ModuleRenderer::new("nim").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Yellow.bold().paint("👑 v1.2.0"))); + let expected = Some(format!("via {}", Color::Yellow.bold().paint("👑 v1.2.0 "))); assert_eq!(expected, actual); dir.close() } @@ -121,7 +121,7 @@ mod tests { let dir = tempfile::tempdir()?; File::create(dir.path().join("main.nim"))?.sync_all()?; let actual = ModuleRenderer::new("nim").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Yellow.bold().paint("👑 v1.2.0"))); + let expected = Some(format!("via {}", Color::Yellow.bold().paint("👑 v1.2.0 "))); assert_eq!(expected, actual); dir.close() } @@ -131,7 +131,7 @@ mod tests { let dir = tempfile::tempdir()?; File::create(dir.path().join("main.nims"))?.sync_all()?; let actual = ModuleRenderer::new("nim").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Yellow.bold().paint("👑 v1.2.0"))); + let expected = Some(format!("via {}", Color::Yellow.bold().paint("👑 v1.2.0 "))); assert_eq!(expected, actual); dir.close() } @@ -141,7 +141,7 @@ mod tests { let dir = tempfile::tempdir()?; File::create(dir.path().join("cfg.nim"))?.sync_all()?; let actual = ModuleRenderer::new("nim").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Yellow.bold().paint("👑 v1.2.0"))); + let expected = Some(format!("via {}", Color::Yellow.bold().paint("👑 v1.2.0 "))); assert_eq!(expected, actual); dir.close() } diff --git a/src/modules/ruby.rs b/src/modules/ruby.rs index 477c4952f..7e10dbd00 100644 --- a/src/modules/ruby.rs +++ b/src/modules/ruby.rs @@ -95,7 +95,7 @@ mod tests { let actual = ModuleRenderer::new("ruby").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Red.bold().paint("💎 v2.5.1"))); + let expected = Some(format!("via {}", Color::Red.bold().paint("💎 v2.5.1 "))); assert_eq!(expected, actual); dir.close() } @@ -107,7 +107,7 @@ mod tests { let actual = ModuleRenderer::new("ruby").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Red.bold().paint("💎 v2.5.1"))); + let expected = Some(format!("via {}", Color::Red.bold().paint("💎 v2.5.1 "))); assert_eq!(expected, actual); dir.close() } @@ -119,7 +119,7 @@ mod tests { let actual = ModuleRenderer::new("ruby").path(dir.path()).collect(); - let expected = Some(format!("via {} ", Color::Red.bold().paint("💎 v2.5.1"))); + let expected = Some(format!("via {}", Color::Red.bold().paint("💎 v2.5.1 "))); assert_eq!(expected, actual); dir.close() } |