Skip to content

Commit

Permalink
Add some type stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jdangerx committed Nov 30, 2023
1 parent 91339ff commit b919359
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/make_slack_notification_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ def _parse_args():
return parser.parse_args()


def main(summary_files: list[Path]):
def main(summary_files: list[Path]) -> None:
"""Format summary files for Slack perusal."""
summaries = []
for summary_file in summary_files:
with summary_file.open() as f:
summaries.extend(json.loads(f.read()))

def format_summary(summary):
def format_summary(summary: dict) -> list[dict]:
name = summary["dataset_name"]
url = summary["record_url"]
if file_changes := summary["file_changes"]:
Expand Down Expand Up @@ -50,10 +50,10 @@ def format_summary(summary):
)
)

def header_block(text):
def header_block(text: str) -> dict:
return {"type": "header", "text": {"type": "plain_text", "text": text}}

def section_block(text):
def section_block(text: str) -> dict:
return {"type": "section", "text": {"type": "mrkdwn", "text": text}}

if changed_blocks:
Expand Down

0 comments on commit b919359

Please sign in to comment.