Skip to content

Commit

Permalink
[#1455] Updated TwigCSFixer rules
Browse files Browse the repository at this point in the history
Closes #1455
  • Loading branch information
AlexSkrypnyk committed Dec 3, 2024
1 parent c4602ea commit c77acd4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
18 changes: 16 additions & 2 deletions .twig-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

$ruleset = new TwigCsFixer\Ruleset\Ruleset();
$ruleset->addStandard(new TwigCsFixer\Standard\Twig());
$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');
Expand Down
9 changes: 0 additions & 9 deletions .vortex/docs/content/tools/twig-cs-fixer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,9 @@ Targets include custom modules and themes.

Adding or removing targets:
```php
$ruleset = new TwigCsFixer\Ruleset\Ruleset();
$ruleset->addStandard(new TwigCsFixer\Standard\Twig());

$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);

return $config;
```

## Ignoring
Expand Down

1 comment on commit c77acd4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.