File tree Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Expand file tree Collapse file tree 3 files changed +56
-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.2
19+ tools : php-cs-fixer:3.45, cs2pr
20+
21+ - uses : actions/cache@v3
22+ with :
23+ path : ' .php-cs-fixer.cache'
24+ key : ${{ github.repository }}-8.2-phpcsfixer-${{ github.ref_name }}
25+ restore-keys : |
26+ ${{ github.repository }}-8.2-phpcsfixer-master
27+ ${{ github.repository }}-8.2-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 @@ -4,3 +4,4 @@ tests/DoctrineTest/doctrine_tests/*
44/tests /tmp
55/tests /foo.sq3
66/vendor /
7+ .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__ .'/tests ' )
7+ ->append (array (__FILE__ ))
8+ // Exclude generated files (single files)
9+ ->notPath ('should-be-ignored.php ' )
10+ ;
11+
12+ $ config = new PhpCsFixer \Config ();
13+ $ config ->setRules (array (
14+ '@PhpCsFixer ' => true ,
15+ '@Symfony ' => true ,
16+ 'array_syntax ' => array (
17+ 'syntax ' => 'long ' ,
18+ ),
19+ ))
20+ ->setCacheFile ('.php-cs-fixer.cache ' )
21+ ->setFinder ($ finder )
22+ ;
23+
24+ return $ config ;
You can’t perform that action at this time.
0 commit comments