Fully sync name and file name

This commit is contained in:
Johan van Eck 2025-07-26 12:31:56 +03:00
parent ae132ff1c4
commit 2f1995ef49
199 changed files with 9 additions and 5 deletions

View file

@ -2,6 +2,8 @@ import os
import json
import yaml
from utils.strings import get_file_name
# TODO: prevent duplicates by only writing unique regex patterns to files
# In some cases negations will result in a new regex pattern as of now
@ -34,7 +36,7 @@ def collect_regex_pattern(service, file_name, input_json, output_dir):
# Output path
output_path = os.path.join(
output_dir,
f"{name.replace('/', '-').replace('[', '(').replace(']', ')')}.yml",
f"{get_file_name(name)}.yml",
)
with open(output_path, "w", encoding="utf-8") as f:
yaml.dump(yml_data, f, sort_keys=False, allow_unicode=True)