File tree Expand file tree Collapse file tree 5 files changed +82
-2
lines changed Expand file tree Collapse file tree 5 files changed +82
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : Twig CS Fixer
2
+
3
+ on :
4
+ push :
5
+ paths :
6
+ - ' **.twig'
7
+ pull_request :
8
+ paths :
9
+ - ' **.twig'
10
+
11
+ concurrency :
12
+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13
+ cancel-in-progress : true
14
+
15
+ permissions :
16
+ contents : read
17
+
18
+ jobs :
19
+ twig-cs-fixer :
20
+ name : Twig CS Fixer
21
+ runs-on : ubuntu-24.04
22
+
23
+ env :
24
+ php-version : ' 8.4'
25
+ steps :
26
+ - name : Setup PHP
27
+ uses : shivammathur/setup-php@v2
28
+ with :
29
+ php-version : ${{ env.php-version }}
30
+ ini-values : " memory_limit=-1"
31
+ coverage : none
32
+
33
+ - name : Checkout target branch
34
+ uses : actions/checkout@v4
35
+ with :
36
+ ref : ${{ github.base_ref }}
37
+
38
+ - name : Checkout PR
39
+ uses : actions/checkout@v4
40
+
41
+ - name : Install dependencies
42
+ run : |
43
+ COMPOSER_HOME="$(composer config home)"
44
+ ([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
45
+ export COMPOSER_ROOT_VERSION=$(grep ' VERSION = ' src/Symfony/Component/HttpKernel/Kernel.php | grep -P -o '[0-9]+\.[0-9]+').x-dev
46
+ composer require --dev vincentlanglet/twig-cs-fixer:^3.7
47
+
48
+ - name : Run Twig CS Fixer Lint
49
+ run : vendor/bin/twig-cs-fixer lint --config=.twig-cs-fixer.dist.php --report=github
50
+
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ composer.lock
3
3
phpunit.xml
4
4
.php-cs-fixer.cache
5
5
.php-cs-fixer.php
6
+ .twig-cs-fixer.cache
7
+ .twig-cs-fixer.php
6
8
.phpunit.result.cache
7
9
composer.phar
8
10
package.tar
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ $ ruleset = new TwigCsFixer \Ruleset \Ruleset ();
13
+ $ ruleset ->addStandard (new TwigCsFixer \Standard \TwigCsFixer ());
14
+
15
+ $ finder = new TwigCsFixer \File \Finder ();
16
+ $ finder ->in ('src/Symfony/Bridge/ ' );
17
+ $ finder ->in ('src/Symfony/Bundle/ ' );
18
+ $ finder ->in ('src/Symfony/Component/ ' );
19
+ $ finder ->exclude ('Fixtures ' );
20
+
21
+ $ config = new TwigCsFixer \Config \Config ();
22
+ $ config ->setCacheFile ('.twig-cs-fixer.cache ' );
23
+ $ config ->setRuleset ($ ruleset );
24
+ $ config ->setFinder ($ finder );
25
+ // RFC: should we allow?
26
+ // $config->allowNonFixableRules();
27
+
28
+ return $ config ;
Original file line number Diff line number Diff line change 50
50
"symfony/twig-bridge" : " ^6.4|^7.0|^8.0" ,
51
51
"symfony/validator" : " ^6.4|^7.0|^8.0" ,
52
52
"symfony/yaml" : " ^6.4|^7.0|^8.0" ,
53
- "twig/twig" : " ^3.12 " ,
53
+ "twig/twig" : " ^3.15 " ,
54
54
"web-token/jwt-library" : " ^3.3.2|^4.0"
55
55
},
56
56
"conflict" : {
Original file line number Diff line number Diff line change 24
24
"symfony/http-kernel" : " ^6.4|^7.0|^8.0" ,
25
25
"symfony/routing" : " ^6.4|^7.0|^8.0" ,
26
26
"symfony/twig-bundle" : " ^6.4|^7.0|^8.0" ,
27
- "twig/twig" : " ^3.12 "
27
+ "twig/twig" : " ^3.15 "
28
28
},
29
29
"require-dev" : {
30
30
"symfony/browser-kit" : " ^6.4|^7.0|^8.0" ,
You can’t perform that action at this time.
0 commit comments