Skip to content

Commit

Permalink
feat: add IncludeFunctionRule in default standard fixer (#218)
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Langlet <[email protected]>
  • Loading branch information
94noni and VincentLanglet committed May 3, 2024
1 parent 15c4e48 commit 66f0c3c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ By default, the twig-cs-fixer standard is enabled with the twig coding standard
- `BlankEOFRule`: ensures that files end with one blank line.
- `BlockNameSpacingRule`: ensures there is one space before and after block names.
- `EmptyLinesRule`: ensures that 2 empty lines do not follow each other.
- `IncludeFunctionRule`: ensures that include function is used instead of function tag.
- `IndentRule`: ensures that files are not indented with tabs.
- `TrailingCommaSingleLineRule`: ensures that single-line arrays, objects and argument lists do not have a trailing comma.
- `TrailingSpaceRule`: ensures that files have no trailing spaces.
Expand Down
2 changes: 2 additions & 0 deletions src/Standard/TwigCsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace TwigCsFixer\Standard;

use TwigCsFixer\Rules\Delimiter\BlockNameSpacingRule;
use TwigCsFixer\Rules\Function\IncludeFunctionRule;
use TwigCsFixer\Rules\Punctuation\TrailingCommaSingleLineRule;
use TwigCsFixer\Rules\String\SingleQuoteRule;
use TwigCsFixer\Rules\Whitespace\BlankEOFRule;
Expand All @@ -24,6 +25,7 @@ public function getRules(): array
new BlankEOFRule(),
new BlockNameSpacingRule(),
new EmptyLinesRule(),
new IncludeFunctionRule(),
new IndentRule(),
new SingleQuoteRule(),
new TrailingCommaSingleLineRule(),
Expand Down
2 changes: 2 additions & 0 deletions tests/Standard/TwigCsFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use PHPUnit\Framework\TestCase;
use TwigCsFixer\Rules\Delimiter\BlockNameSpacingRule;
use TwigCsFixer\Rules\Delimiter\DelimiterSpacingRule;
use TwigCsFixer\Rules\Function\IncludeFunctionRule;
use TwigCsFixer\Rules\Operator\OperatorNameSpacingRule;
use TwigCsFixer\Rules\Operator\OperatorSpacingRule;
use TwigCsFixer\Rules\Punctuation\PunctuationSpacingRule;
Expand Down Expand Up @@ -34,6 +35,7 @@ public function testGetRules(): void
new BlankEOFRule(),
new BlockNameSpacingRule(),
new EmptyLinesRule(),
new IncludeFunctionRule(),
new IndentRule(),
new SingleQuoteRule(),
new TrailingCommaSingleLineRule(),
Expand Down

0 comments on commit 66f0c3c

Please sign in to comment.