Skip to content

Commit

Permalink
add a couple of tiny docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
daabr committed Dec 30, 2024
1 parent 9590490 commit 7816198
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions purrr/slack_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def _set_bookmarks(pr, channel_id: str) -> None:


def _set_description(pr, channel_id: str) -> None:
"""Set the description of a Slack channel to a GitHub PR title."""
title = f"`{pr.title}`"
if len(title) > _MAX_METADATA_LENGTH:
title = title[: _MAX_METADATA_LENGTH - 4] + "`..."
Expand All @@ -95,6 +96,7 @@ def _set_description(pr, channel_id: str) -> None:


def _set_topic(pr, channel_id: str) -> None:
"""Set the topic of a Slack channel to a GitHub PR URL."""
topic = pr.html_url
if len(topic) > _MAX_METADATA_LENGTH:
topic = topic[: _MAX_METADATA_LENGTH - 4] + " ..."
Expand Down

0 comments on commit 7816198

Please sign in to comment.