File tree Expand file tree Collapse file tree 6 files changed +77
-10
lines changed
Expand file tree Collapse file tree 6 files changed +77
-10
lines changed Original file line number Diff line number Diff line change 1- /.github / export-ignore
2- /bin / export-ignore
3- /tests / export-ignore
4- /.editorconfig export-ignore
5- /.gitattributes export-ignore
6- /.gitignore export-ignore
7- /CONTRIBUTING.md export-ignore
8- /phpunit.dist.xml export-ignore
1+ /.github / export-ignore
2+ /bin / export-ignore
3+ /tests / export-ignore
4+ /.editorconfig export-ignore
5+ /.gitattributes export-ignore
6+ /.gitignore export-ignore
7+ /CONTRIBUTING.md export-ignore
8+ /phpunit.dist.xml export-ignore
9+ /.php-cs-fixer.dist.php export-ignore
Original file line number Diff line number Diff line change 88 types : [ created ]
99
1010jobs :
11+ check_code_style :
12+ name : Check code style
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v4
16+
17+ - uses : shivammathur/setup-php@v2
18+ with :
19+ coverage : none
20+ php-version : ' 8.3'
21+
22+ - name : Install dependencies
23+ run : composer update
24+
25+ - run : ./vendor/bin/php-cs-fixer fix --dry-run --diff --show-progress=dots
26+
1127 tests :
1228 runs-on : ubuntu-latest
1329 name : Build and test
Original file line number Diff line number Diff line change @@ -4,3 +4,5 @@ composer.lock
44.phpunit.cache
55.phpunit.result.cache
66phpunit.xml
7+ .php-cs-fixer.php
8+ .php-cs-fixer.cache
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ $ finder = (new PhpCsFixer \Finder ())
4+ ->in (__DIR__ )
5+ ->notPath ('i18n.php ' );
6+
7+ return (new PhpCsFixer \Config ())
8+ ->setParallelConfig (PhpCsFixer \Runner \Parallel \ParallelConfigFactory::detect ())
9+ ->setRules ([
10+ '@PER-CS ' => true ,
11+ '@Symfony ' => true ,
12+ 'header_comment ' => [
13+ 'header ' => <<<'TEXT'
14+ This file is part of the Behat Gherkin Parser.
15+ (c) Konstantin Kudryashov <ever.zet@gmail.com>
16+
17+ For the full copyright and license information, please view the LICENSE
18+ file that was distributed with this source code.
19+ TEXT
20+ ],
21+ 'yoda_style ' => [
22+ 'equal ' => false ,
23+ 'identical ' => false ,
24+ 'less_and_greater ' => false ,
25+ ],
26+ 'concat_space ' => ['spacing ' => 'one ' ],
27+ 'phpdoc_align ' => ['align ' => 'left ' ],
28+ ])
29+ ->setFinder ($ finder );
Original file line number Diff line number Diff line change @@ -27,6 +27,14 @@ We use automated tools to ensure that the code has a consistent style and is of
2727composer lint
2828```
2929
30+ ## Automated Fixes
31+
32+ Some problems detected by the linting tools can be fixed automatically. Simply run the following:
33+
34+ ``` shell
35+ composer fix
36+ ```
37+
3038## Contributing to Gherkin Translations
3139
3240Gherkin supports &rarr ; 40 different languages and you could add more! You might notice ` i18n.php ` file in the root of
Original file line number Diff line number Diff line change 2020 "require-dev" : {
2121 "symfony/yaml" : " ^5.4 || ^6.4 || ^7.0" ,
2222 "phpunit/phpunit" : " ^10.5" ,
23- "cucumber/cucumber" : " dev-gherkin-24.1.0"
23+ "cucumber/cucumber" : " dev-gherkin-24.1.0" ,
24+ "friendsofphp/php-cs-fixer" : " ^3.65"
2425 },
2526
2627 "suggest" : {
6768
6869 "scripts" : {
6970 "lint" : [
70- " Composer\\ Config::disableProcessTimeout"
71+ " Composer\\ Config::disableProcessTimeout" ,
72+ " vendor/bin/php-cs-fixer fix --dry-run --diff --show-progress=dots"
7173 ],
7274 "test" : [
7375 " Composer\\ Config::disableProcessTimeout" ,
7476 " vendor/bin/phpunit ./tests"
77+ ],
78+ "fix" : [
79+ " Composer\\ Config::disableProcessTimeout" ,
80+ " vendor/bin/php-cs-fixer fix --diff --show-progress=dots"
7581 ]
82+ },
83+ "config" : {
84+ "allow-plugins" : {
85+ "phpstan/extension-installer" : false
86+ }
7687 }
7788}
You can’t perform that action at this time.
0 commit comments