Skip to content

Commit

Permalink
Merge pull request #88 from martincostello/trim-titles
Browse files Browse the repository at this point in the history
Trim issue titles
  • Loading branch information
zkoppert authored Aug 2, 2023
2 parents 92b849a + 98d2f39 commit 9b99daa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions markdown_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def write_to_markdown(
for issue in issues_with_metrics:
# Replace the vertical bar with the HTML entity
issue.title = issue.title.replace("|", "|")
# Replace any whitespace
issue.title = issue.title.strip()

file.write(f"| " f"{issue.title} | " f"{issue.html_url} |")
if "Time to first response" in columns:
Expand Down
2 changes: 1 addition & 1 deletion test_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_get_label_metrics_open_issue(self):
labels = ["bug", "feature"]
metrics = get_label_metrics(self.issue, labels)
self.assertEqual(metrics["bug"], timedelta(days=2))
self.assertLess(
self.assertLessEqual(
metrics["feature"],
datetime.now(pytz.utc) - datetime(2021, 1, 2, tzinfo=pytz.UTC),
)
Expand Down
2 changes: 1 addition & 1 deletion test_markdown_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_write_to_markdown(self):
{"bug": timedelta(days=1)},
),
IssueWithMetrics(
"Issue 2",
"Issue 2\r",
"https://github.com/user/repo/issues/2",
timedelta(days=3),
timedelta(days=4),
Expand Down

0 comments on commit 9b99daa

Please sign in to comment.