<commit_before>#!/usr/bin/env python3

import re
import sys
from pathlib import Path

ALLOWED_SUFFIXES = ["feature", "bugfix", "doc", "removal", "misc"]
PATTERN = re.compile(r"\d+\.(" + "|".join(ALLOWED_SUFFIXES) + r")(\.d+)?(.rst)?")


def get_root(script_path):
    folder = script_path.resolve().parent
    while not (folder / ".git").exists():
        folder = folder.parent
        if folder == folder.anchor:
            raise RuntimeError("git repo not found")
    return folder


def main(argv):
    print('Check "CHANGES" folder... ', end="", flush=True)
    here = Path(argv[0])<commit_msg>Fix the regexp in the fragment checking script (#6171)<commit_after>#!/usr/bin/env python3

import re
import sys
from pathlib import Path

ALLOWED_SUFFIXES = ["feature", "bugfix", "doc", "removal", "misc"]
PATTERN = re.compile(r"\d+\.(" + "|".join(ALLOWED_SUFFIXES) + r")(\.\d+)?(\.rst)?")


def get_root(script_path):
    folder = script_path.resolve().parent
    while not (folder / ".git").exists():
        folder = folder.parent
        if folder == folder.anchor:
            raise RuntimeError("git repo not found")
    return folder


def main(argv):
    print('Check "CHANGES" folder... ', end="", flush=True)
    here = Path(argv[0])
{'fraction_non_alphanumeric': 0.17779565567176187, 'fraction_numerical': 0.006436041834271922, 'mean_word_length': 3.490974729241877, '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': '7450413', 'n_tokens_mistral': 434, 'n_tokens_neox': 416, 'n_words': 105}