Skip to content

Commit 9b99daa

Browse files
authored
Merge pull request #88 from martincostello/trim-titles
Trim issue titles
2 parents 92b849a + 98d2f39 commit 9b99daa

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

markdown_writer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ def write_to_markdown(
136136
for issue in issues_with_metrics:
137137
# Replace the vertical bar with the HTML entity
138138
issue.title = issue.title.replace("|", "|")
139+
# Replace any whitespace
140+
issue.title = issue.title.strip()
139141

140142
file.write(f"| " f"{issue.title} | " f"{issue.html_url} |")
141143
if "Time to first response" in columns:

test_labels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_get_label_metrics_open_issue(self):
5858
labels = ["bug", "feature"]
5959
metrics = get_label_metrics(self.issue, labels)
6060
self.assertEqual(metrics["bug"], timedelta(days=2))
61-
self.assertLess(
61+
self.assertLessEqual(
6262
metrics["feature"],
6363
datetime.now(pytz.utc) - datetime(2021, 1, 2, tzinfo=pytz.UTC),
6464
)

test_markdown_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_write_to_markdown(self):
3838
{"bug": timedelta(days=1)},
3939
),
4040
IssueWithMetrics(
41-
"Issue 2",
41+
"Issue 2\r",
4242
"https://github.com/user/repo/issues/2",
4343
timedelta(days=3),
4444
timedelta(days=4),

0 commit comments

Comments
 (0)