Skip to content

Commit

Permalink
tests: dedicated config file for PHP CS Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Aug 28, 2024
1 parent 82e045b commit 66dd0ec
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

/*
* This file is part of Cecil.
*
* Copyright (c) Arnaud Ligny <arnaud@ligny.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

$finder = (new PhpCsFixer\Finder())
->ignoreDotFiles(false)
->ignoreVCSIgnored(true)
->exclude(['tests/fixtures'])
->in(__DIR__)
;

return (new PhpCsFixer\Config())
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setRules([
'@PSR12' => true,
'native_function_invocation' => true,
'nullable_type_declaration_for_default_null_value' => true,
'header_comment' => ['header' => <<<'EOF'
This file is part of Cecil.
Copyright (c) Arnaud Ligny <arnaud@ligny.fr>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF],
])
->setFinder($finder)
;
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"code:md": "phpmd src text codesize, naming, unusedcode",
"code:md:gh": "phpmd src github codesize, naming, unusedcode",
"code:style": "phpcs ./src/ --standard=PSR12 -n",
"code:fix": "php-cs-fixer fix ./src/ --rules=@PSR12,native_function_invocation,nullable_type_declaration_for_default_null_value --allow-risky=yes --show-progress=none",
"code:fix": "php-cs-fixer fix --allow-risky=yes --show-progress=none",
"test": "@test:integration",
"test:integration": "phpunit -c ./ --testsuite=IntegrationTests",
"test:coverage": "phpunit -c ./ --testsuite=IntegrationTests --coverage-text --coverage-clover=build/logs/clover.xml",
Expand Down

0 comments on commit 66dd0ec

Please sign in to comment.