-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
.twig-cs-fixer.php
32 lines (27 loc) · 1.51 KB
/
.twig-cs-fixer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
declare(strict_types=1);
$ruleset = new TwigCsFixer\Ruleset\Ruleset();
$ruleset->addRule(new TwigCsFixer\Rules\Delimiter\BlockNameSpacingRule());
$ruleset->addRule(new TwigCsFixer\Rules\Delimiter\DelimiterSpacingRule());
$ruleset->addRule(new TwigCsFixer\Rules\Function\NamedArgumentSpacingRule());
$ruleset->addRule(new TwigCsFixer\Rules\Operator\OperatorNameSpacingRule());
$ruleset->addRule(new TwigCsFixer\Rules\Operator\OperatorSpacingRule());
$ruleset->addRule(new TwigCsFixer\Rules\Punctuation\PunctuationSpacingRule());
$ruleset->addRule(new TwigCsFixer\Rules\Punctuation\TrailingCommaMultiLineRule());
$ruleset->addRule(new TwigCsFixer\Rules\Punctuation\TrailingCommaSingleLineRule());
$ruleset->addRule(new TwigCsFixer\Rules\String\HashQuoteRule());
$ruleset->addRule(new TwigCsFixer\Rules\String\SingleQuoteRule());
$ruleset->addRule(new TwigCsFixer\Rules\Variable\VariableNameRule());
$ruleset->addRule(new TwigCsFixer\Rules\Whitespace\BlankEOFRule());
$ruleset->addRule(new TwigCsFixer\Rules\Whitespace\EmptyLinesRule());
$ruleset->addRule(new TwigCsFixer\Rules\Whitespace\IndentRule(2));
$ruleset->addRule(new TwigCsFixer\Rules\Whitespace\TrailingSpaceRule());
$finder = new TwigCsFixer\File\Finder();
$finder->in(__DIR__ . '/web/modules/custom');
$finder->in(__DIR__ . '/web/themes/custom');
$config = new TwigCsFixer\Config\Config();
$config->setRuleset($ruleset);
$config->setFinder($finder);
$config->allowNonFixableRules();
$config->addTokenParser(new Drupal\Core\Template\TwigTransTokenParser());
return $config;