<commit_before>#!/usr/bin/env python
import sys
from random import choice

from time_tracker.utils import parse_time_entry

with open(sys.argv[1]) as f:
    content = f.read()

# Add a cool "little big detail"
message = choice([
    "Add more tests",
    "Fixes #9001",
    "Fixes infinite loop"
    "Flake8",
    "Hotfix",
    "Initial commit",
    "Optimize the Foobar class",
    "Reduce the potential yak shaving",
    "Y2K protection",
])

if not parse_time_entry(content):
    print("Please include the amount of time "
          "spent on this commit in the commit message.")
    print("E.g. \":clock1: 5m | {}\"".format(message))
    print("Failed to commit.")
    sys.exit(1)
<commit_msg>:clock1: 2m | Execute the hook only as __main__<commit_after>#!/usr/bin/env python
import sys
from random import choice

from time_tracker.utils import parse_time_entry

if __name__ == '__main__':

    with open(sys.argv[1]) as f:
        content = f.read()

    # Add a cool "little big detail"
    message = choice([
        "Add more tests",
        "Fixes #9001",
        "Fixes infinite loop"
        "Flake8",
        "Hotfix",
        "Initial commit",
        "Optimize the Foobar class",
        "Reduce the potential yak shaving",
        "Y2K protection",
    ])

    if not parse_time_entry(content):
        print("Please include the amount of time "
              "spent on this commit in the commit message.")
        print("E.g. \":clock1: 5m | {}\"".format(message))
        print("Failed to commit.")
        sys.exit(1)

{'fraction_non_alphanumeric': 0.12239583333333333, 'fraction_numerical': 0.014322916666666666, 'mean_word_length': 2.6421800947867298, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7348637', 'n_tokens_mistral': 505, 'n_tokens_neox': 486, 'n_words': 158}