Add php-cs-fixer setup
Exclude propel generated files from php-cs-fixer
This commit is contained in:
parent
0450ca7aad
commit
45eda99ba3
|
@ -8,6 +8,10 @@
|
||||||
/tests/results.html
|
/tests/results.html
|
||||||
/tests/test_results.xml
|
/tests/test_results.xml
|
||||||
|
|
||||||
|
# Tools
|
||||||
|
/tools/
|
||||||
|
.php-cs-fixer.cache
|
||||||
|
|
||||||
## Github Composer .gitignore
|
## Github Composer .gitignore
|
||||||
## See https://github.com/github/gitignore/blob/master/Composer.gitignore
|
## See https://github.com/github/gitignore/blob/master/Composer.gitignore
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
|
@ -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);
|
|
@ -1,4 +1,4 @@
|
||||||
.PHONY: build
|
.PHONY: build php-cs-fixer
|
||||||
|
|
||||||
SHELL = bash
|
SHELL = bash
|
||||||
|
|
||||||
|
@ -10,3 +10,10 @@ test: vendor
|
||||||
|
|
||||||
build:
|
build:
|
||||||
composer install --no-progress --no-interaction --no-dev
|
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
|
||||||
|
|
Loading…
Reference in New Issue