

def get_hook_message(start, postfix='', end_msg=None, end_len=0, end_color=None, use_color=None, cols=COLS):
    "Prints a message for running a hook.\n\n    This currently supports three approaches:\n\n    # Print `start` followed by dots, leaving 6 characters at the end\n    >>> print_hook_message('start', end_len=6)\n    start...............................................................\n\n    # Print `start` followed by dots with the end message colored if coloring\n    # is specified and a newline afterwards\n    >>> print_hook_message(\n        'start',\n        end_msg='end',\n        end_color=color.RED,\n        use_color=True,\n    )\n    start...................................................................end\n\n    # Print `start` followed by dots, followed by the `postfix` message\n    # uncolored, followed by the `end_msg` colored if specified and a newline\n    # afterwards\n    >>> print_hook_message(\n        'start',\n        postfix='postfix ',\n        end_msg='end',\n        end_color=color.RED,\n        use_color=True,\n    )\n    start...........................................................postfix end\n    "
    if (bool(end_msg) == bool(end_len)):
        raise ValueError('Expected one of (`end_msg`, `end_len`)')
    if ((end_msg is not None) and ((end_color is None) or (use_color is None))):
        raise ValueError('`end_color` and `use_color` are required with `end_msg`')
    if end_len:
        return (start + ('.' * (((cols - len(start)) - end_len) - 1)))
    else:
        return '{0}{1}{2}{3}\n'.format(start, ('.' * ((((cols - len(start)) - len(postfix)) - len(end_msg)) - 1)), postfix, color.format_color(end_msg, end_color, use_color))

dataset/ETHPy150Open pre-commit/pre-commit/pre_commit/output.py get_hook_message/original