diff --git a/src/Cake.Issues.GitRepository/GitRepositoryIssuesProvider.cs b/src/Cake.Issues.GitRepository/GitRepositoryIssuesProvider.cs index 80a1d9f2b..f03325180 100644 --- a/src/Cake.Issues.GitRepository/GitRepositoryIssuesProvider.cs +++ b/src/Cake.Issues.GitRepository/GitRepositoryIssuesProvider.cs @@ -58,7 +58,7 @@ protected override IEnumerable InternalReadIssues(IssueCommentFormat for if (this.IssueProviderSettings.CheckBinaryFilesTrackedByLfs) { - result.AddRange(this.CheckForBinaryFilesNotTrackedByLfs()); + result.AddRange(this.CheckForBinaryFilesNotTrackedByLfs(format)); } return result; @@ -67,8 +67,9 @@ protected override IEnumerable InternalReadIssues(IssueCommentFormat for /// /// Checks for binary files which are not tracked by LFS. /// + /// Preferred format of the messages. /// List of issues for binary files which are not tracked by LFS. - private IEnumerable CheckForBinaryFilesNotTrackedByLfs() + private IEnumerable CheckForBinaryFilesNotTrackedByLfs(IssueCommentFormat format) { var allFiles = this.GetAllFilesFromRepository(); if (!allFiles.Any()) @@ -102,10 +103,23 @@ private IEnumerable CheckForBinaryFilesNotTrackedByLfs() var result = new List(); foreach (var file in binaryFilesNotTrackedByLfs) { + string message = null; + switch (format) + { + case IssueCommentFormat.Markdown: + message = $"The binary file `{file}` is not tracked by Git LFS"; + break; + case IssueCommentFormat.Html: + message = $"The binary file
{file}
is not tracked by Git LFS"; + break; + default: + message = $"The binary file \"{file}\" is not tracked by Git LFS"; + break; + } + result.Add( IssueBuilder - .NewIssue( - $"File '{file}' is a binary file but not tracked by LFS.", this) + .NewIssue(message, this) .InFile(file) .OfRule("BinaryFileNotTrackedByLfs") .WithPriority(IssuePriority.Warning)