Fully sync name and file name
This commit is contained in:
parent
ae132ff1c4
commit
2f1995ef49
199 changed files with 9 additions and 5 deletions
|
|
@ -4,6 +4,8 @@ import yaml
|
|||
|
||||
from markdownify import markdownify
|
||||
|
||||
from utils.strings import get_file_name
|
||||
|
||||
IMPLEMENTATION_TO_TAG_MAPPING = {
|
||||
"ReleaseTitleSpecification": ["Release Title"],
|
||||
"ResolutionSpecification": ["Resolution"],
|
||||
|
|
@ -77,7 +79,7 @@ def collect_custom_format(service, file_name, input_json, output_dir):
|
|||
}
|
||||
|
||||
# Output path
|
||||
output_path = os.path.join(output_dir, f"{file_name}.yml")
|
||||
output_path = os.path.join(output_dir, 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)
|
||||
print(f"Generated: {output_path}")
|
||||
|
|
|
|||
|
|
@ -4,9 +4,7 @@ import yaml
|
|||
|
||||
from markdownify import markdownify
|
||||
|
||||
|
||||
def get_file_name(profile_name):
|
||||
return profile_name.replace("[", "(").replace("]", ")")
|
||||
from utils.strings import get_file_name
|
||||
|
||||
|
||||
def find_score_for_custom_format(
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
2
scripts/utils/strings.py
Normal file
2
scripts/utils/strings.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def get_file_name(profile_name):
|
||||
return profile_name.replace("/", "-").replace("[", "(").replace("]", ")")
|
||||
Loading…
Add table
Add a link
Reference in a new issue