Add php-cs-fixer setup

Exclude propel generated files from php-cs-fixer
This commit is contained in:
jo 2021-09-15 14:07:26 +02:00
parent 0450ca7aad
commit 45eda99ba3
3 changed files with 27 additions and 1 deletions

4
legacy/.gitignore vendored
View File

@ -8,6 +8,10 @@
/tests/results.html
/tests/test_results.xml
# Tools
/tools/
.php-cs-fixer.cache
## Github Composer .gitignore
## See https://github.com/github/gitignore/blob/master/Composer.gitignore
################################################################################

15
legacy/.php-cs-fixer.php Normal file
View File

@ -0,0 +1,15 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('application/models/airtime/map')
->exclude('application/models/airtime/om');
$config = new PhpCsFixer\Config();
return $config->setRules([
'@PhpCsFixer' => true,
'concat_space' => ['spacing' => 'one'],
'ordered_class_elements' => false,
'yoda_style' => false,
])
->setFinder($finder);

View File

@ -1,4 +1,4 @@
.PHONY: build
.PHONY: build php-cs-fixer
SHELL = bash
@ -10,3 +10,10 @@ test: vendor
build:
composer install --no-progress --no-interaction --no-dev
tools/php-cs-fixer:
mkdir -p tools/php-cs-fixer
composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer
php-cs-fixer: tools/php-cs-fixer
tools/php-cs-fixer/vendor/bin/php-cs-fixer fix