Skip to content

Commit a116eb4

Browse files
committed
(maint) Update wording and handling of culture
1 parent 03be84f commit a116eb4

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

src/GitReleaseManager.Core/Commands/AddAssetsCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public async Task<int> ExecuteAsync(AddAssetSubOptions options)
2121

2222
if (vcsOptions?.Provider == Model.VcsProvider.GitLab)
2323
{
24-
_logger.Error("The addasset command is currently not supported when targetting GitLab.");
24+
_logger.Error("The 'addasset' command is currently not supported when targeting GitLab.");
2525
return 1;
2626
}
2727

src/GitReleaseManager.Core/Commands/ExportCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ public ExportCommand(IVcsService vcsService, ILogger logger)
1818

1919
public async Task<int> ExecuteAsync(ExportSubOptions options)
2020
{
21-
if (string.IsNullOrEmpty(options.TagName))
21+
if (string.IsNullOrWhiteSpace(options.TagName))
2222
{
23-
_logger.Information("Exporting all releases");
23+
_logger.Information("Exporting all releases.");
2424
}
2525
else
2626
{
27-
_logger.Information("Exporting release {TagName}", options.TagName);
27+
_logger.Information("Exporting release {TagName}.", options.TagName);
2828
}
2929

3030
var releasesContent = await _vcsService.ExportReleasesAsync(options.RepositoryOwner, options.RepositoryName, options.TagName, options.SkipPrereleases).ConfigureAwait(false);

src/GitReleaseManager.Core/Commands/LabelCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public async Task<int> ExecuteAsync(LabelSubOptions options)
2121

2222
if (vcsOptions?.Provider == Model.VcsProvider.GitLab)
2323
{
24-
_logger.Error("The label command is currently not supported when targetting GitLab.");
24+
_logger.Error("The label command is currently not supported when targeting GitLab.");
2525
return 1;
2626
}
2727

src/GitReleaseManager.Core/Extensions/MilestoneExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ public static Version Version(this Octokit.Milestone ver)
1717
var nameWithoutPrerelease = ver.Title.Split('-')[0];
1818
if (nameWithoutPrerelease.StartsWith("v", StringComparison.OrdinalIgnoreCase))
1919
{
20-
_logger.Debug("Removing version prefix from {Name}", ver.Title);
20+
_logger.Debug("Removing version prefix from {Name}.", ver.Title);
2121
nameWithoutPrerelease = nameWithoutPrerelease.Remove(0, 1);
2222
}
2323

2424
if (!System.Version.TryParse(nameWithoutPrerelease, out Version parsedVersion))
2525
{
26-
_logger.Warning("No valid version was found on {Title}", ver.Title);
26+
_logger.Warning("No valid version was found on {Title}.", ver.Title);
2727
return new Version(0, 0);
2828
}
2929

src/GitReleaseManager.Core/MappingProfiles/GitHubProfile.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using AutoMapper;
23
using GitReleaseManager.Core.Extensions;
34

@@ -10,7 +11,7 @@ public GitHubProfile()
1011
CreateMap<Octokit.Issue, Model.Issue>()
1112
.ForMember(dest => dest.PublicNumber, act => act.MapFrom(src => src.Number))
1213
.ForMember(dest => dest.InternalNumber, act => act.MapFrom(src => src.Id))
13-
.ForMember(dest => dest.IsPullRequest, act => act.MapFrom(src => src.HtmlUrl.Contains("/pull/")))
14+
.ForMember(dest => dest.IsPullRequest, act => act.MapFrom(src => src.HtmlUrl.IndexOf("/pull/", StringComparison.OrdinalIgnoreCase) >= 0))
1415
.ReverseMap();
1516
CreateMap<Model.IssueComment, Octokit.IssueComment>().ReverseMap();
1617
CreateMap<Model.ItemState, Octokit.ItemState>().ReverseMap();

src/GitReleaseManager.Core/ReleaseNotes/ReleaseNotesBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public async Task<string> BuildReleaseNotesAsync(string user, string repository,
6060

6161
if (issues.Count == 0)
6262
{
63-
var logMessage = string.Format(CultureInfo.InvariantCulture, "No closed issues have been found for milestone {0}, or all assigned issues are meant to be excluded from release notes, aborting creation of release.", _milestoneTitle);
63+
var logMessage = string.Format(CultureInfo.CurrentCulture, "No closed issues have been found for milestone {0}, or all assigned issues are meant to be excluded from release notes, aborting release creation.", _milestoneTitle);
6464
throw new InvalidOperationException(logMessage);
6565
}
6666

src/GitReleaseManager.Core/VcsService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ private async Task AddAssetsAsync(string owner, string repository, string tagNam
142142
{
143143
if (!File.Exists(asset))
144144
{
145-
var message = string.Format(CultureInfo.InvariantCulture, "Requested asset to be uploaded doesn't exist: {0}", asset);
145+
var message = string.Format(CultureInfo.CurrentCulture, "The requested asset to be uploaded doesn't exist: {0}", asset);
146146
throw new FileNotFoundException(message);
147147
}
148148

@@ -155,7 +155,7 @@ private async Task AddAssetsAsync(string owner, string repository, string tagNam
155155

156156
if (_vcsProvider is GitLabProvider)
157157
{
158-
_logger.Error("Deleting of assets is not currently supported when targetting GitLab.");
158+
_logger.Error("Deleting assets is not currently supported when targeting GitLab.");
159159
}
160160
else
161161
{
@@ -186,7 +186,7 @@ private async Task AddAssetsAsync(string owner, string repository, string tagNam
186186
if (!release.Body.Contains(_configuration.Create.ShaSectionHeading))
187187
{
188188
_logger.Debug("Creating SHA section header");
189-
stringBuilder.AppendLine(string.Format(CultureInfo.InvariantCulture, "### {0}", _configuration.Create.ShaSectionHeading));
189+
stringBuilder.AppendFormat(CultureInfo.InvariantCulture, "### {0}", _configuration.Create.ShaSectionHeading).AppendLine();
190190
}
191191

192192
foreach (var asset in assets)
@@ -405,7 +405,7 @@ private async Task AddIssueCommentsAsync(string owner, string repository, Milest
405405
}
406406
catch (ForbiddenException)
407407
{
408-
_logger.Error("Unable to add comment to issue #{IssueNumber}. Insufficient permissions.", issue.PublicNumber);
408+
_logger.Error("Unable to add a comment to issue #{IssueNumber}. Insufficient permissions.", issue.PublicNumber);
409409
break;
410410
}
411411
}

0 commit comments

Comments
 (0)