<commit_before>set(template.schema ".hpp.yml")
set(impl.schema ".impl.hpp")
set(test.schema ".test.cpp")

set(type_template "codegen/templates/type.impl.jinja")
set(test_template "codegen/templates/type.test.jinja")

file(GLOB_RECURSE templates    RELATIVE ${CMAKE_SOURCE_DIR}    "*${template.schema}")

set(codegen.cmd "${PYTHON_BIN}\python.exe -m yasha")
set(codegen.ext "codegen/engine/codegen.py")

set(codegen.deps
        "${codegen.ext}"
        "codegen/config/type.test.yml"
        ${type_template}
        ${test_template}
        )

function(preprocess_paths path type template)
    string(REGEX REPLACE "${template.schema}" "${${type}.schema}" outpath ${template})
    string(REPLACE "codegen/" "" outpath ${outpath})

    set(${path} "${outpath}" PARENT_SCOPE)
endfunction()

function(find_files files schema)
    file(GLOB_RECURSE _files RELATIVE ${PROJECT_SOURCE_DIR} ${schema})
    set(${files} ${_files} PARENT_SCOPE)
endfunction()

function(generate_file output template template_data)
    get_filename_component(output_dir ${output} DIRECTORY)

    add_custom_command(
            OUTPUT ${PROJECT_SOURCE_DIR}/${output}
            COMMAND ${CMAKE_COMMAND} -E make_directory ${output_dir}
            COMMAND ${codegen.cmd} -o ${output}  -v ${template} ${template_data} -e ${codegen.ext}<commit_msg>ci cfg<commit_after>set(template.schema ".hpp.yml")
set(impl.schema ".impl.hpp")
set(test.schema ".test.cpp")

set(type_template "codegen/templates/type.impl.jinja")
set(test_template "codegen/templates/type.test.jinja")

file(GLOB_RECURSE templates    RELATIVE ${CMAKE_SOURCE_DIR}    "*${template.schema}")

set(codegen.cmd "${PYTHON_BIN}\\python.exe -m yasha")
set(codegen.ext "codegen/engine/codegen.py")

set(codegen.deps
        "${codegen.ext}"
        "codegen/config/type.test.yml"
        ${type_template}
        ${test_template}
        )

function(preprocess_paths path type template)
    string(REGEX REPLACE "${template.schema}" "${${type}.schema}" outpath ${template})
    string(REPLACE "codegen/" "" outpath ${outpath})

    set(${path} "${outpath}" PARENT_SCOPE)
endfunction()

function(find_files files schema)
    file(GLOB_RECURSE _files RELATIVE ${PROJECT_SOURCE_DIR} ${schema})
    set(${files} ${_files} PARENT_SCOPE)
endfunction()

function(generate_file output template template_data)
    get_filename_component(output_dir ${output} DIRECTORY)

    add_custom_command(
            OUTPUT ${PROJECT_SOURCE_DIR}/${output}
            COMMAND ${CMAKE_COMMAND} -E make_directory ${output_dir}
            COMMAND ${codegen.cmd} -o ${output}  -v ${template} ${template_data} -e ${codegen.ext}
{'fraction_non_alphanumeric': 0.15083586626139817, 'fraction_numerical': 0.0, 'mean_word_length': 4.384458077709612, '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': '2811709', 'n_tokens_mistral': 890, 'n_tokens_neox': 878, 'n_words': 160}