Skip to content

Issues with how Summaries are written #12

@BrianBu02

Description

@BrianBu02

Summaries should potentially be refactored here are a few issues I found

  1. [Bug] Summary sections should be closed

Current output

/// <summary>
/// <summary>

Correct output

/// <summary>
/// </summary>
  1. [Bug] Summaries should use triple backslashes for message

Current output

/// <summary>
//  Lorem Ipsum
/// <summary>

Correct output

/// <summary>
/// Lorem Ipsum
/// </summary>
  1. [Enhancement] Multi-line Summaries are not blocked

Current output

/// <summary>
//  Lorem 
Ipsum
/// <summary>

Correct output

/// <summary>
/// Lorem 
/// Ipsum
/// </summary>
  1. [Feature] Support for other tags in Summaries

Summaries support more tags. These tags can be found in the following documentation:
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/recommended-tags

  1. [Feature] Support for auto-wrap on character length.

A method found in the following block can provide an easy way to auto-wrap on character length

 var words = Regex.Replace(description, @"\s+", " ").Trim().Split(' ');
 var lines = new List<string>();
 var line = string.Empty;
 foreach (var word in words)
 {
     var workingLine = $"{line} {word}";
     if (workingLine.Length > characterWidth)
     {
         lines.Add(line.Trim());
         line = word;
     }
     else
     {
         line = workingLine;
     }
 }
 lines.Add(line.Trim());

 var section = string.Join($"{Indent}/// ", lines);
  1. [Bug] Messages that are put into Summaries should be encoded for xml

Current output

/// <summary>
//  Lorem < Ipsum
/// <summary>

Correct output

/// <summary>
/// Lorem &lt; Ipsum
/// </summary>
Escape Target
&amp; Ampersand – &
&apos; Apostrophe – ‘
&gt; Greater-than sign – >
&lt; Less-than sign – <
&quot; Quotation mark – “

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions