<commit_before>import os
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import List, Optional

from commitizen import cmd


class GitObject:
    def __eq__(self, other):
        if not isinstance(other, GitObject):
            return False
        return self.rev == other.rev


class GitCommit(GitObject):
    def __init__(self, rev, title, body=""):
        self.rev = rev.strip()
        self.title = title.strip()
        self.body = body.strip()

    @property
    def message(self):
        message = self.title
        if self.body:
            message = message + f"\n\n{self.body}"
        return message

    def __repr__(self):
        return f"{self.title} ({self.rev})"
<commit_msg>refactor(git): replace GitCommit.message code with one-liner<commit_after>import os
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import List, Optional

from commitizen import cmd


class GitObject:
    def __eq__(self, other):
        if not isinstance(other, GitObject):
            return False
        return self.rev == other.rev


class GitCommit(GitObject):
    def __init__(self, rev, title, body=""):
        self.rev = rev.strip()
        self.title = title.strip()
        self.body = body.strip()

    @property
    def message(self):
        return f"{self.title}\n\n{self.body}".strip()

    def __repr__(self):
        return f"{self.title} ({self.rev})"

{'fraction_non_alphanumeric': 0.10729312762973352, 'fraction_numerical': 0.0, 'mean_word_length': 2.6968911917098444, 'pattern_counts': {'":': 0, '<': 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': '302344', 'n_tokens_mistral': 425, 'n_tokens_neox': 416, 'n_words': 124}