asm89/twig-lint

Unexpected fail linting

Opened this issue · 0 comments

It seems like this should pass, but fails.
The template works and looks fine when viewing pages though.

Twig Code:

{% set n = content.field_content_blocks['#items']|length %}
{% set classes = [
                'n-' ~ p,
                n is divisible by (2) ? 'n-twos',
                n is divisible by (3) ? 'n-threes'
        ] %}
        <section class="row crocosmias">
            <div class="col-xs-12 {{ classes|myextensions_join_parts }}">

Lint Error:

[ExecStack] Done in 7.663s
> validate:twig:files
Linting twig files...
Iterating over fileset files.twig...
KO in /www/repos/uwmcms/docroot/themes/custom/cust_theme/templates/node/node--fact-page.html.twig (line 28)
   26             {% set classes = [
   27                     'n-' ~ p,
>> 28                     (n is divisible by (2) ? 'n-twos',
>> An opened parenthesis is not properly closed. Unexpected token "name" of value "by" ("punctuation" expected with value ")"). 
   29                     (n is divisible by (3)) ? 'n-threes'
   30             ] %}

[error]  Executing `'/www/repos/cust_theme/vendor/bin/twig-lint' lint --only-print-errors '%s'` against fileset(s) files.twig returned a non-zero exit code.`