Closed seb-jean closed 7 months ago
Can you try
$config->setRuleset($ruleset)->allowNonFixableRules();
Same problem.
Same problem.
I do not reproduce with allowNonFixableRules
; do you use an old version ?
$ruleset = new \TwigCsFixer\Ruleset\Ruleset();
$ruleset->addRule(new FileNameRule(baseDirectory: 'templates', ignoredSubDirectories: ['bundles']));
$config = new \TwigCsFixer\Config\Config();
$config->setRuleset($ruleset)->allowNonFixableRules();
$config->setCacheFile(null);
return $config;
No, new version 2.4.4.
For me, $fileName
is null : https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/src/Rules/File/FileNameRule.php#L49
I am on Windows
It's the \DIRECTORY_SEPARATOR
that is causing the problem.
Rule(s) related to or rule(s) missing
FileNameRule
Expected behavior
FileNameRule
should report errors to me.Actual behavior
I download Symfony with
symfony new myproject --php=8.2 --webapp --docker --cloud
Then I download this bundle with
symfony composer require --dev vincentlanglet/twig-cs-fixer
I put this config
I rename
templates/base.twig.html
bytemplates/Xbase.twig.html
for test this rule.I execute
vendor\bin\twig-cs-fixer lint
but I have no errors.