File tree Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : " Code Linting"
2
+ on :
3
+ push :
4
+ branches :
5
+ - master
6
+ pull_request :
7
+
8
+ jobs :
9
+ php-cs-fixer :
10
+ name : ' PHP-CS-Fixer'
11
+ runs-on : ' ubuntu-latest'
12
+ steps :
13
+ - uses : ' actions/checkout@v3'
14
+
15
+ - name : ' Setup PHP'
16
+ uses : ' shivammathur/setup-php@v2'
17
+ with :
18
+ php-version : ' 8.1'
19
+ tools : php-cs-fixer, cs2pr
20
+
21
+ - uses : ' actions/cache@v3'
22
+ with :
23
+ path : ' .php-cs-fixer.cache'
24
+ key : ' ${{ github.repository }}-8.1-phpcsfixer-${{ github.ref_name }}'
25
+ restore-keys : |
26
+ ${{ github.repository }}-8.1-phpcsfixer-main
27
+ ${{ github.repository }}-8.1-phpcsfixer-
28
+
29
+ - name : ' Run PHP-CS-Fixer'
30
+ # Using cs2pr settings, see: https://github.com/shivammathur/setup-php#tools-with-checkstyle-support
31
+ run : ' php-cs-fixer fix --dry-run --format checkstyle | cs2pr'
Original file line number Diff line number Diff line change 6
6
lib /plugins /sfDoctrinePlugin /test /functional /fixtures /log /
7
7
/vendor
8
8
/composer.lock
9
+ .php-cs-fixer.cache
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ $ finder = PhpCsFixer \Finder::create ()
4
+ ->ignoreVCSIgnored (true )
5
+ ->in (__DIR__ .'/lib ' )
6
+ ->in (__DIR__ .'/data/bin ' )
7
+ ->in (__DIR__ .'/test ' )
8
+ ->append (array (__FILE__ ))
9
+ // Exclude PHP classes templates/generators, which are not valid PHP files
10
+ ->exclude ('task/generator/skeleton/ ' )
11
+ ->exclude ('plugins/sfDoctrinePlugin/data/generator/ ' )
12
+ // Exclude generated files (single files)
13
+ ->notPath ('unit/config/fixtures/sfDefineEnvironmentConfigHandler/prefix_result.php ' )
14
+ ->notPath ('unit/config/fixtures/sfFilterConfigHandler/result.php ' )
15
+ ;
16
+
17
+ $ config = new PhpCsFixer \Config ();
18
+ $ config ->setRules (array (
19
+ '@PhpCsFixer ' => true ,
20
+ '@Symfony ' => true ,
21
+ 'array_syntax ' => array (
22
+ 'syntax ' => 'long ' ,
23
+ ),
24
+ ))
25
+ ->setCacheFile ('.php-cs-fixer.cache ' )
26
+ ->setFinder ($ finder )
27
+ ;
28
+
29
+ return $ config ;
You can’t perform that action at this time.
0 commit comments