summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKid <44045911+kidonng@users.noreply.github.com>2021-07-04 22:32:47 +0800
committerGitHub <noreply@github.com>2021-07-04 10:32:47 -0400
commit196cc8aa3980d67e8ddb0d80bbdd92720adc0aec (patch)
tree3545f1f8d351be37312d4e3aedf323268cdc6dc5 /src
parentbdac9511682765d62ad6b05ff81bce6ceeef2abc (diff)
fix(dotnet): make default format consistent with other modules (#2853)
Add via prefix to dotnet modules' default format config.
Diffstat (limited to 'src')
-rw-r--r--src/configs/dotnet.rs2
-rw-r--r--src/modules/dotnet.rs42
2 files changed, 31 insertions, 13 deletions
diff --git a/src/configs/dotnet.rs b/src/configs/dotnet.rs
index e8558e39b..0d29e178e 100644
--- a/src/configs/dotnet.rs
+++ b/src/configs/dotnet.rs
@@ -19,7 +19,7 @@ pub struct DotnetConfig<'a> {
impl<'a> Default for DotnetConfig<'a> {
fn default() -> Self {
DotnetConfig {
- format: "[$symbol($version )(🎯 $tfm )]($style)",
+ format: "via [$symbol($version )(🎯 $tfm )]($style)",
version_format: "v${raw}",
symbol: ".NET ",
style: "blue bold",
diff --git a/src/modules/dotnet.rs b/src/modules/dotnet.rs
index 3d0347882..68d03ecdc 100644
--- a/src/modules/dotnet.rs
+++ b/src/modules/dotnet.rs
@@ -364,7 +364,10 @@ 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!(
+ "via {}",
+ Color::Blue.bold().paint(".NET v3.1.103 ")
+ )),
);
workspace.close()
}
@@ -375,7 +378,10 @@ 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!(
+ "via {}",
+ Color::Blue.bold().paint(".NET v3.1.103 ")
+ )),
);
workspace.close()
}
@@ -386,7 +392,10 @@ mod tests {
touch_path(&workspace, "Packages.props", None)?;
expect_output(
&workspace.path(),
- Some(format!("{}", Color::Blue.bold().paint(".NET v3.1.103 "))),
+ Some(format!(
+ "via {}",
+ Color::Blue.bold().paint(".NET v3.1.103 ")
+ )),
);
workspace.close()
}
@@ -407,7 +416,7 @@ mod tests {
expect_output(
&workspace.path(),
Some(format!(
- "{}",
+ "via {}",
Color::Blue.bold().paint(".NET v3.1.103 🎯 netstandard2.0 ")
)),
);
@@ -420,7 +429,10 @@ mod tests {
touch_path(&workspace, "project.fsproj", None)?;
expect_output(
&workspace.path(),
- Some(format!("{}", Color::Blue.bold().paint(".NET v3.1.103 "))),
+ Some(format!(
+ "via {}",
+ Color::Blue.bold().paint(".NET v3.1.103 ")
+ )),
);
workspace.close()
}
@@ -431,7 +443,10 @@ mod tests {
touch_path(&workspace, "project.xproj", None)?;
expect_output(
&workspace.path(),
- Some(format!("{}", Color::Blue.bold().paint(".NET v3.1.103 "))),
+ Some(format!(
+ "via {}",
+ Color::Blue.bold().paint(".NET v3.1.103 ")
+ )),
);
workspace.close()
}
@@ -442,7 +457,10 @@ mod tests {
touch_path(&workspace, "project.json", None)?;
expect_output(
&workspace.path(),
- Some(format!("{}", Color::Blue.bold().paint(".NET v3.1.103 "))),
+ Some(format!(
+ "via {}",
+ Color::Blue.bold().paint(".NET v3.1.103 ")
+ )),
);
workspace.close()
}
@@ -454,7 +472,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!("via {}", Color::Blue.bold().paint(".NET v1.2.3 "))),
);
workspace.close()
}
@@ -469,7 +487,7 @@ mod tests {
expect_output(
&workspace.path().join("project"),
Some(format!(
- "{}",
+ "via {}",
Color::Blue.bold().paint(".NET v1.2.3 🎯 netstandard2.0 ")
)),
);
@@ -490,7 +508,7 @@ mod tests {
expect_output(
&workspace.path().join("deep/path/to/project"),
Some(format!(
- "{}",
+ "via {}",
Color::Blue.bold().paint(".NET v1.2.3 🎯 netstandard2.0 ")
)),
);
@@ -505,7 +523,7 @@ mod tests {
expect_output(
workspace.path(),
Some(format!(
- "{}",
+ "via {}",
Color::Blue.bold().paint(".NET v3.1.103 🎯 netstandard2.0 ")
)),
);
@@ -520,7 +538,7 @@ mod tests {
expect_output(
workspace.path(),
Some(format!(
- "{}",
+ "via {}",
Color::Blue
.bold()
.paint(".NET v3.1.103 🎯 netstandard2.0;net461 ")