-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.twig-cs-fixer.php
More file actions
24 lines (19 loc) · 807 Bytes
/
.twig-cs-fixer.php
File metadata and controls
24 lines (19 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
declare(strict_types=1);
$ruleset = new TwigCsFixer\Ruleset\Ruleset();
$ruleset->addStandard(new TwigCsFixer\Standard\TwigCsFixer());
$ruleset->overrideRule(new TwigCsFixer\Rules\Whitespace\IndentRule(2));
// @todo Remove when https://www.drupal.org/project/civictheme/issues/3556899 is fixed.
$ruleset->removeRule(TwigCsFixer\Rules\Function\IncludeFunctionRule::class);
$finder = new TwigCsFixer\File\Finder();
$finder->in(__DIR__ . '/web/modules/custom');
$finder->in(__DIR__ . '/web/themes/custom')->exclude([
'.components-civictheme',
'components_combined',
]);
$config = new TwigCsFixer\Config\Config();
$config->setRuleset($ruleset);
$config->setFinder($finder);
$config->allowNonFixableRules();
$config->addTokenParser(new Drupal\Core\Template\TwigTransTokenParser());
return $config;