Added an analyzer which keeps line breaks LF on every system (#1193)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-11 19:30:00 +01:00
1 parent b1c1f13993
commit 65d50de033
96 files changed
+741 -393

No files matched your search

@@ -227,7 +227,7 @@ public partial class SlideAssistant
if (library.Pictures.Count == 0)
return string.Empty;
var list = string.Join(Environment.NewLine, library.Pictures.Select((picture, index) => $"- Picture {firstNumber + index}: {picture.Name}{(picture.IsIcon ? " (icon)" : string.Empty)}"));
var list = string.Join('\n',library.Pictures.Select((picture, index) => $"- Picture {firstNumber + index}: {picture.Name}{(picture.IsIcon ? " (icon)" : string.Empty)}"));
var sanitizedList = await guardService.SanitizeAsync(list, PromptInjectionSource.FileContent(folderPath), promptInjectionScope);
return $"""
@@ -357,7 +357,7 @@ public partial class SlideAssistant
if (this.SourceImagesOfRequest().Count > 0)
rules.Add(" - Images attached as source material are for reading only. Never place them on a slide.");
return string.Join(Environment.NewLine, rules);
return string.Join('\n',rules);
}
/// <summary>
@@ -376,7 +376,7 @@ public partial class SlideAssistant
if (pictures.Count == 0)
return string.Empty;
var list = string.Join(Environment.NewLine, pictures.Select((picture, index) => $"- Picture {index + 1}: {picture.FileName}"));
var list = string.Join('\n',pictures.Select((picture, index) => $"- Picture {index + 1}: {picture.FileName}"));
var seeing = modelSeesPictures
? "The images attached to this request start with these pictures, in this order."
: "You cannot see these pictures. Place them by what their names say.";
@@ -516,7 +516,7 @@ public partial class SlideAssistant
private static string RepairPromptOf(IReadOnlyList<string> issues)
{
var listedIssues = string.Join(Environment.NewLine, issues.Take(MAX_REPORTED_ISSUES).Select(issue => $"- {issue}"));
var listedIssues = string.Join('\n',issues.Take(MAX_REPORTED_ISSUES).Select(issue => $"- {issue}"));
return $"""
Your JSON does not fit the layouts yet:
{listedIssues}
@@ -542,7 +542,7 @@ public partial class SlideAssistant : AssistantBaseCore<SettingsDialogSlideBuild
if (prompts.Count == 0)
return " - Do not tailor the text to a specific audience.";
return string.Join(Environment.NewLine, prompts.Select(prompt => $" - {prompt}"));
return string.Join('\n',prompts.Select(prompt => $" - {prompt}"));
}
private string GetDocumentTaskDescription()
@@ -577,7 +577,7 @@ public partial class SlideAssistant : AssistantBaseCore<SettingsDialogSlideBuild
if (documents.Count > 0)
{
sb.AppendLine("""
sb.AppendLineLF("""
# DOCUMENTS:
""");
@@ -614,7 +614,7 @@ public partial class SlideAssistant : AssistantBaseCore<SettingsDialogSlideBuild
}
var fileContent = extraction.Content;
sb.AppendLine($"""
sb.AppendLineLF($"""
## DOCUMENT {numDocuments}:
File path: {document.FilePath}
@@ -634,7 +634,7 @@ public partial class SlideAssistant : AssistantBaseCore<SettingsDialogSlideBuild
{
if (documents.Count == 0)
{
sb.AppendLine($"""
sb.AppendLineLF($"""
There are {numImages} image file(s) attached as source material.
Please consider them as documents as well and use them to
@@ -644,7 +644,7 @@ public partial class SlideAssistant : AssistantBaseCore<SettingsDialogSlideBuild
}
else
{
sb.AppendLine($"""
sb.AppendLineLF($"""
Additionally, there are {numImages} image file(s) attached as source material.
Please consider them as documents as well and use them to