"""
Jinja2 templates for YARA rule generation.
"""

YARA_TEMPLATE = """/*
   Auto-generated by yara-gen
   Tool: https://github.com/deconvolute-labs/yara-gen
   Generated at: {{ timestamp }}
*/
{% for rule in rules %}
rule {{ rule.name }} : {{ rule.tags|join(' ') }}
{
    meta:
        {%- for key, value in rule.metadata.items() %}
        {{ key }} = "{{ value }}"
        {%- endfor %}

    strings:
        // We use the 'wide' and 'ascii' modifiers to catch both encoding types
        {%- for s in rule.strings %}
        $s{{ loop.index }} = "{{ s.value }}" {{ s.modifiers|join(' ') }}
        {%- endfor %}

    condition:
        any of them
}
{% endfor %}"""
