{% macro file_validation_report(validation_results, file_name) -%}
{% for check_type, check_per_file in validation_results.items() %}
{% set result = check_per_file.get(file_name, {}) %}
{% if check_type == "assembly_check" %}
{% set nb_match = result.get("match", 0) %}
{% set nb_total = result.get("total", 0) %}
{% set match_percentage = nb_match / nb_total * 100 %}
{% if result.get("nb_mismatch", 0) > 0 %}
{% set icon = "❌" %}
{% set row_class = "report-section fail collapsible" %}
{% else %}
{% set icon = "✔" %}
{% set row_class = "report-section pass" %}
{% endif %}
{{ icon }} Assembly check: {{ nb_match }}/{{ nb_total }} ({{ match_percentage|round(2) }}%)
{% set mismatch_list = result.get("mismatch_list") %}
{% if mismatch_list %}
First 10 errors per category are below. Full report: {{ result.get('report_path', '') }}
Category | Error |
{% for error in mismatch_list[:10] %}
mismatch error | {{ error }} |
{% endfor %}
{% endif %}
{% elif check_type == "vcf_check" %}
{% set critical_count = result.get("critical_count", 0) %}
{% set error_count = result.get("error_count", 0) %}
{% set warning_count = result.get("warning_count", 0) %}
{% if critical_count > 0 %}
{% set icon = "❌" %}
{% set row_class = "report-section fail collapsible" %}
{% elif error_count > 0 %}
{% set icon = "❌" %}
{% set row_class = "report-section warn collapsible" %}
{% else %}
{% set icon = "✔" %}
{% set row_class = "report-section pass" %}
{% endif %}
{{ icon }} VCF check: {{ critical_count }} critical errors, {{ error_count }} non-critical errors, {{ warning_count }} warnings
{% set critical_list = result.get("critical_list") %}
{% set error_list = result.get("error_list") %}
{% if critical_list or error_list%}
First 10 errors per category are below. Full report: {{ result.get('report_path', '') }}
Category | Error |
{% for error in critical_list[:10] %}
critical error | {{ error }} |
{% endfor %}
{% for error in error_list[:10] %}
non-critical error | {{ error }} |
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{%- endmacro %}