Hook: for checking commit message (prevent commit).

def commit_msg_hook(argv):
    """Hook: for checking commit message (prevent commit)."""
    with open(argv[1], "r", "utf-8") as fh:
        message = "\n".join(filter(lambda x: not x.startswith("#"),
                                   fh.readlines()))
    options = {"allow_empty": True}

    if not _check_message(message, options):
        click.echo(
            "Aborting commit due to commit message errors (override with "
            "'git commit --no-verify').", file=sys.stderr)
        raise click.Abort
    return 0