summaryrefslogtreecommitdiffstats
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
parentbdac9511682765d62ad6b05ff81bce6ceeef2abc (diff)
fix(dotnet): make default format consistent with other modules (#2853)
Add via prefix to dotnet modules' default format config.
-rw-r--r--docs/config/README.md6
-rw-r--r--src/configs/dotnet.rs2
-rw-r--r--src/modules/dotnet.rs42
3 files changed, 34 insertions, 16 deletions
diff --git a/docs/config/README.md b/docs/config/README.md
index 0c068b786..522b3d9bb 100644
--- a/docs/config/README.md
+++ b/docs/config/README.md
@@ -419,7 +419,7 @@ look at [this example](#with-custom-error-shape).
::: warning
-`vicmd_symbol` is only supported in fish and zsh.
+`vicmd_symbol` is only supported in fish and zsh.
:::
@@ -859,7 +859,7 @@ when there is a csproj file in the current directory.
| Option | Default | Description |
| ------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
-| `format` | `"[$symbol($version )(🎯 $tfm )]($style)"` | The format for the module. |
+| `format` | `"via [$symbol($version )(🎯 $tfm )]($style)"` | The format for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `".NET "` | The symbol used before displaying the version of dotnet. |
| `heuristic` | `true` | Use faster version detection to keep starship snappy. |
@@ -2295,7 +2295,7 @@ python_binary = ["./venv/bin/python", "python", "python3", "python2"]
## R
-The `rlang` module shows the currently installed version of R. The module will be shown if
+The `rlang` module shows the currently installed version of R. The module will be shown if
any of the following conditions are met:
- The current directory contains a file with the `.R` extension.
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 ")