Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include syntax #228

Closed
rafipiccolo opened this issue May 10, 2024 · 2 comments
Closed

include syntax #228

rafipiccolo opened this issue May 10, 2024 · 2 comments

Comments

@rafipiccolo
Copy link

rafipiccolo commented May 10, 2024

Rule(s) related to or rule(s) missing

There seem to be a recent change (version 2.9.0) with the way you format includes.
But this new way, valid in twig v3, makes my code fail since i use twigjs and it does not support it
can i disable this particular rule ?

Expected behavior

{% include('template.html') with vars %}

Actual behavior

{{ include('template.html', vars) }}
@VincentLanglet
Copy link
Owner

Hi !

I dunno twigjs ; I'm curious, is there other syntaxes which are not supported ? Is it planned to be supported ?

I'll do some investigations and maybe only add the IncludeRule conditionnally or remove it of the standard by default.

Until then you can add a config and call "removeRule" in it. There is some doc about it.

@rafipiccolo
Copy link
Author

i use twigjs on my nodejs projects and dont know any other thing that are not supported.
i filed an issue, and they likely will cover this case.

by the meantime i'll use this config :

<?php

$ruleset = new TwigCsFixer\Ruleset\Ruleset();

// You can start from a default standard
$ruleset->addStandard(new TwigCsFixer\Standard\TwigCsFixer());

// And then add/remove/override some rules
$ruleset->removeRule(TwigCsFixer\Rules\Function\IncludeFunctionRule::class);

$config = new TwigCsFixer\Config\Config();
$config->setRuleset($ruleset);

return $config;

you can close the issue if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants