def format_file_contents(contents: str, filename: str) ->str:
    """Add markdown code block around file contents with extension for code highlighting.

    If a file is empty or contains only whitespace, note this in the log.
    """
    if not contents.rstrip():
        return '*File empty*'
    return '```{}\n'.format(filename.split('.')[-1]) + contents + '\n```\n'
