From d8b419c7e0668d64f31c2dbbd76329523f563478 Mon Sep 17 00:00:00 2001 From: costellobot <102549341+costellobot@users.noreply.github.com> Date: Tue, 8 Aug 2023 20:07:35 +0100 Subject: [PATCH] Update .NET SDK to 8.0.100-preview.7.23376.3 (#843) * Update .NET SDK Update .NET SDK to version 8.0.100-preview.7.23376.3. --- updated-dependencies: - dependency-name: Microsoft.NET.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> * Bump .NET NuGet packages Bumps .NET dependencies to their latest versions for the .NET 8.0.100-preview.7.23376.3 SDK. Bumps Microsoft.Extensions.DependencyInjection from 8.0.0-preview.6.23329.7 to 8.0.0-preview.7.23375.6. Bumps Microsoft.Extensions.Http from 8.0.0-preview.6.23329.7 to 8.0.0-preview.7.23375.6. Bumps Microsoft.Extensions.Http.Polly from 8.0.0-preview.6.23329.11 to 8.0.0-preview.7.23375.9. Bumps Microsoft.Extensions.Logging from 8.0.0-preview.6.23329.7 to 8.0.0-preview.7.23375.6. Bumps System.Text.Json from 8.0.0-preview.6.23329.7 to 8.0.0-preview.7.23375.6. --- updated-dependencies: - dependency-name: Microsoft.Extensions.DependencyInjection dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Microsoft.Extensions.Http dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Microsoft.Extensions.Http.Polly dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Microsoft.Extensions.Logging dependency-type: direct:production update-type: version-update:semver-major - dependency-name: System.Text.Json dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> * Fix build Use `CompositeFormat` to fix analyser warning. --------- Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> Co-authored-by: martincostello --- Directory.Packages.props | 10 +++++----- global.json | 2 +- src/LondonTravel.Skill/Intents/CommuteIntent.cs | 4 +++- src/LondonTravel.Skill/Lines.cs | 4 +++- src/LondonTravel.Skill/Verbalizer.cs | 7 +++++-- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 84e5fef63..7a342288d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -13,10 +13,10 @@ - - - - + + + + @@ -27,7 +27,7 @@ - + diff --git a/global.json b/global.json index 4c8324bd1..442b2e334 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100-preview.6.23330.14", + "version": "8.0.100-preview.7.23376.3", "allowPrerelease": false, "rollForward": "latestMajor" } diff --git a/src/LondonTravel.Skill/Intents/CommuteIntent.cs b/src/LondonTravel.Skill/Intents/CommuteIntent.cs index 1a7e7cab8..61e96ffeb 100644 --- a/src/LondonTravel.Skill/Intents/CommuteIntent.cs +++ b/src/LondonTravel.Skill/Intents/CommuteIntent.cs @@ -15,6 +15,8 @@ namespace MartinCostello.LondonTravel.Skill.Intents; /// internal sealed class CommuteIntent : IIntent { + private static readonly CompositeFormat CommuteIntentPrefixFormat = CompositeFormat.Parse(Strings.CommuteIntentPrefixFormat); + /// /// Initializes a new instance of the class. /// @@ -96,7 +98,7 @@ private async Task CommuteAsync(ICollection favoriteLines if (hasMultipleStatuses) { string displayName = Verbalizer.LineName(line.Name, asTitleCase: true); - text = string.Format(CultureInfo.CurrentCulture, Strings.CommuteIntentPrefixFormat, displayName, text); + text = string.Format(CultureInfo.CurrentCulture, CommuteIntentPrefixFormat, displayName, text); } paragraphs.Add(text); diff --git a/src/LondonTravel.Skill/Lines.cs b/src/LondonTravel.Skill/Lines.cs index 4912f000c..85bb3153c 100644 --- a/src/LondonTravel.Skill/Lines.cs +++ b/src/LondonTravel.Skill/Lines.cs @@ -8,6 +8,8 @@ namespace MartinCostello.LondonTravel.Skill; /// internal static class Lines { + private static readonly CompositeFormat StatusIntentCardTitleFormat = CompositeFormat.Parse(Strings.StatusIntentCardTitleFormat); + /// /// Returns whether the specified line name refers to the Docklands Light Railway. /// @@ -148,6 +150,6 @@ public static string ToCardTitle(string name) suffix = Strings.LineSuffixUpper; } - return string.Format(CultureInfo.CurrentCulture, Strings.StatusIntentCardTitleFormat, name, suffix); + return string.Format(CultureInfo.CurrentCulture, StatusIntentCardTitleFormat, name, suffix); } } diff --git a/src/LondonTravel.Skill/Verbalizer.cs b/src/LondonTravel.Skill/Verbalizer.cs index dc1a3084f..2fd9d7257 100644 --- a/src/LondonTravel.Skill/Verbalizer.cs +++ b/src/LondonTravel.Skill/Verbalizer.cs @@ -8,6 +8,9 @@ namespace MartinCostello.LondonTravel.Skill; /// internal static class Verbalizer { + private static readonly CompositeFormat LineNameWithoutPrefixFormat = CompositeFormat.Parse(Strings.LineNameWithoutPrefixFormat); + private static readonly CompositeFormat LineNameWithPrefixFormat = CompositeFormat.Parse(Strings.LineNameWithPrefixFormat); + /// /// Returns the spoken version of the specified line name. /// @@ -49,8 +52,8 @@ internal static string LineName(string name, bool asTitleCase = false) return asTitleCase ? - string.Format(CultureInfo.CurrentCulture, Strings.LineNameWithoutPrefixFormat, spokenName, suffix) : - string.Format(CultureInfo.CurrentCulture, Strings.LineNameWithPrefixFormat, prefix, spokenName, suffix); + string.Format(CultureInfo.CurrentCulture, LineNameWithoutPrefixFormat, spokenName, suffix) : + string.Format(CultureInfo.CurrentCulture, LineNameWithPrefixFormat, prefix, spokenName, suffix); } ///