Skip to content

Commit 84573bf

Browse files
CopilotMalcolmnixon
andcommitted
Convert change/bug/known-issue tables to bullet lists
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
1 parent 6159c23 commit 84573bf

File tree

2 files changed

+29
-33
lines changed

2 files changed

+29
-33
lines changed

src/DemaConsulting.BuildMark/BuildInformation.cs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,21 @@ private void AppendVersionInformation(System.Text.StringBuilder markdown, string
119119
/// <param name="subHeading">Sub-heading prefix.</param>
120120
private void AppendChangesSection(System.Text.StringBuilder markdown, string subHeading)
121121
{
122-
// Add changes section header and table structure
122+
// Add changes section header
123123
markdown.AppendLine($"{subHeading} Changes");
124124
markdown.AppendLine();
125-
markdown.AppendLine("| Issue | Title |");
126-
markdown.AppendLine("| :-: | :---------- |");
127125

128126
// Add change items or N/A if no changes exist
129127
if (Changes.Count > 0)
130128
{
131129
foreach (var issue in Changes)
132130
{
133-
markdown.AppendLine($"| [{issue.Id}]({issue.Url}) | {issue.Title} |");
131+
markdown.AppendLine($"- [{issue.Id}]({issue.Url}) - {issue.Title}");
134132
}
135133
}
136134
else
137135
{
138-
markdown.AppendLine("| N/A | N/A |");
136+
markdown.AppendLine("- N/A");
139137
}
140138

141139
// Add blank line after section
@@ -149,23 +147,21 @@ private void AppendChangesSection(System.Text.StringBuilder markdown, string sub
149147
/// <param name="subHeading">Sub-heading prefix.</param>
150148
private void AppendBugsFixedSection(System.Text.StringBuilder markdown, string subHeading)
151149
{
152-
// Add bugs fixed section header and table structure
150+
// Add bugs fixed section header
153151
markdown.AppendLine($"{subHeading} Bugs Fixed");
154152
markdown.AppendLine();
155-
markdown.AppendLine("| Issue | Title |");
156-
markdown.AppendLine("| :-: | :---------- |");
157153

158154
// Add bug items or N/A if no bugs were fixed
159155
if (Bugs.Count > 0)
160156
{
161157
foreach (var issue in Bugs)
162158
{
163-
markdown.AppendLine($"| [{issue.Id}]({issue.Url}) | {issue.Title} |");
159+
markdown.AppendLine($"- [{issue.Id}]({issue.Url}) - {issue.Title}");
164160
}
165161
}
166162
else
167163
{
168-
markdown.AppendLine("| N/A | N/A |");
164+
markdown.AppendLine("- N/A");
169165
}
170166

171167
// Add blank line after section
@@ -179,23 +175,21 @@ private void AppendBugsFixedSection(System.Text.StringBuilder markdown, string s
179175
/// <param name="subHeading">Sub-heading prefix.</param>
180176
private void AppendKnownIssuesSection(System.Text.StringBuilder markdown, string subHeading)
181177
{
182-
// Add known issues section header and table structure
178+
// Add known issues section header
183179
markdown.AppendLine($"{subHeading} Known Issues");
184180
markdown.AppendLine();
185-
markdown.AppendLine("| Issue | Title |");
186-
markdown.AppendLine("| :-: | :---------- |");
187181

188182
// Add known issue items or N/A if no known issues exist
189183
if (KnownIssues.Count > 0)
190184
{
191185
foreach (var issue in KnownIssues)
192186
{
193-
markdown.AppendLine($"| [{issue.Id}]({issue.Url}) | {issue.Title} |");
187+
markdown.AppendLine($"- [{issue.Id}]({issue.Url}) - {issue.Title}");
194188
}
195189
}
196190
else
197191
{
198-
markdown.AppendLine("| N/A | N/A |");
192+
markdown.AppendLine("- N/A");
199193
}
200194

201195
// Add blank line after section

test/DemaConsulting.BuildMark.Tests/BuildInformationTests.cs

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ [new ItemInfo("2", "Bug fix", "https://example.com/2", "bug")],
323323
var changesSectionStart = markdown.IndexOf("## Changes", StringComparison.Ordinal);
324324
var bugsSectionStart = markdown.IndexOf("## Bugs Fixed", StringComparison.Ordinal);
325325
var changesSection = markdown.Substring(changesSectionStart, bugsSectionStart - changesSectionStart);
326-
Assert.Contains("| N/A | N/A |", changesSection);
326+
Assert.Contains("- N/A", changesSection);
327327
}
328328

329329
/// <summary>
@@ -347,11 +347,11 @@ [new ItemInfo("1", "Feature", "https://example.com/1", "feature")],
347347
// Assert - Check that Bugs Fixed section contains N/A
348348
var bugsSectionStart = markdown.IndexOf("## Bugs Fixed", StringComparison.Ordinal);
349349
var bugsSection = markdown.Substring(bugsSectionStart);
350-
Assert.Contains("| N/A | N/A |", bugsSection);
350+
Assert.Contains("- N/A", bugsSection);
351351
}
352352

353353
/// <summary>
354-
/// Test that ToMarkdown includes issue links in tables.
354+
/// Test that ToMarkdown includes issue links in bullet lists.
355355
/// </summary>
356356
[TestMethod]
357357
public async Task BuildInformation_ToMarkdown_IncludesIssueLinks()
@@ -364,8 +364,8 @@ public async Task BuildInformation_ToMarkdown_IncludesIssueLinks()
364364
var markdown = buildInfo.ToMarkdown();
365365

366366
// Assert - verify issue links are properly formatted
367-
Assert.Contains("[3](https://github.com/example/repo/issues/3)", markdown);
368-
Assert.Contains("[2](https://github.com/example/repo/issues/2)", markdown);
367+
Assert.Contains("- [3](https://github.com/example/repo/issues/3)", markdown);
368+
Assert.Contains("- [2](https://github.com/example/repo/issues/2)", markdown);
369369
}
370370

371371
/// <summary>
@@ -427,10 +427,10 @@ public async Task BuildInformation_ToMarkdown_ExcludesFullChangelogWhenNoBaselin
427427
}
428428

429429
/// <summary>
430-
/// Test that ToMarkdown uses correct table widths with centered Issue column.
430+
/// Test that ToMarkdown uses bullet lists for changes, bugs, and known issues.
431431
/// </summary>
432432
[TestMethod]
433-
public async Task BuildInformation_ToMarkdown_UsesCorrectTableWidths()
433+
public async Task BuildInformation_ToMarkdown_UsesBulletLists()
434434
{
435435
// Arrange
436436
var connector = new MockRepoConnector();
@@ -439,23 +439,25 @@ public async Task BuildInformation_ToMarkdown_UsesCorrectTableWidths()
439439
// Act
440440
var markdown = buildInfo.ToMarkdown(includeKnownIssues: true);
441441

442-
// Assert - verify table separators use correct width format (10:1 ratio with centered Issue)
443-
// The separator should have centered Issue column (:-:) and wide left-aligned Title column (:----------)
444-
445-
// Verify the table separator appears in Changes section
442+
// Assert - verify bullet list format is used for changes, bugs, and known issues
443+
// Verify the bullet list appears in Changes section
446444
var changesStart = markdown.IndexOf("## Changes", StringComparison.Ordinal);
447445
var bugsStart = markdown.IndexOf("## Bugs Fixed", StringComparison.Ordinal);
448446
var changesSection = markdown.Substring(changesStart, bugsStart - changesStart);
449-
Assert.Contains("| :-: | :---------- |", changesSection);
447+
Assert.Contains("- [", changesSection);
448+
Assert.DoesNotContain("| :-: | :---------- |", changesSection);
450449

451-
// Verify the table separator appears in Bugs Fixed section
450+
// Verify the bullet list appears in Bugs Fixed section
452451
var knownIssuesStart = markdown.IndexOf("## Known Issues", StringComparison.Ordinal);
453452
var bugsSection = markdown.Substring(bugsStart, knownIssuesStart - bugsStart);
454-
Assert.Contains("| :-: | :---------- |", bugsSection);
455-
456-
// Verify the table separator appears in Known Issues section
457-
var knownIssuesSection = markdown.Substring(knownIssuesStart);
458-
Assert.Contains("| :-: | :---------- |", knownIssuesSection);
453+
Assert.Contains("- [", bugsSection);
454+
Assert.DoesNotContain("| :-: | :---------- |", bugsSection);
455+
456+
// Verify the bullet list appears in Known Issues section
457+
var fullChangelogStart = markdown.IndexOf("## Full Changelog", StringComparison.Ordinal);
458+
var knownIssuesSection = markdown.Substring(knownIssuesStart, fullChangelogStart - knownIssuesStart);
459+
Assert.Contains("- [", knownIssuesSection);
460+
Assert.DoesNotContain("| :-: | :---------- |", knownIssuesSection);
459461
}
460462

461463
/// <summary>

0 commit comments

Comments
 (0)