mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Add php cs fixer and some rule sets.
This commit is contained in:
1
.ci/php-cs-fixer/.gitignore
vendored
Normal file
1
.ci/php-cs-fixer/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
vendor
|
||||||
31
.ci/php-cs-fixer/.php-cs-fixer.php
Normal file
31
.ci/php-cs-fixer/.php-cs-fixer.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* .php-cs-fixer.php
|
||||||
|
* Copyright (c) 2022 james@firefly-iii.org
|
||||||
|
*
|
||||||
|
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
$finder = PhpCsFixer\Finder::create();
|
||||||
|
|
||||||
|
$config = new PhpCsFixer\Config();
|
||||||
|
return $config->setRules([
|
||||||
|
'@PSR12' => true,
|
||||||
|
'strict_param' => true,
|
||||||
|
'array_syntax' => ['syntax' => 'short'],
|
||||||
|
])
|
||||||
|
->setFinder($finder)
|
||||||
|
;
|
||||||
5
.ci/php-cs-fixer/composer.json
Normal file
5
.ci/php-cs-fixer/composer.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"require": {
|
||||||
|
"friendsofphp/php-cs-fixer": "^3.12"
|
||||||
|
}
|
||||||
|
}
|
||||||
2047
.ci/php-cs-fixer/composer.lock
generated
Normal file
2047
.ci/php-cs-fixer/composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -23,9 +23,17 @@
|
|||||||
# Install composer packages
|
# Install composer packages
|
||||||
#composer install --no-scripts --no-ansi
|
#composer install --no-scripts --no-ansi
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
|
|
||||||
# enable test .env file.
|
# enable test .env file.
|
||||||
# cp .ci/.env.ci .env
|
# cp .ci/.env.ci .env
|
||||||
|
|
||||||
|
# clean up php code
|
||||||
|
cd $SCRIPT_DIR/php-cs-fixer
|
||||||
|
composer update
|
||||||
|
./vendor/bin/php-cs-fixer fix $SCRIPT_DIR/../app/Console --config $SCRIPT_DIR/php-cs-fixer/.php-cs-fixer.php --allow-risky=yes
|
||||||
|
cd $SCRIPT_DIR/..
|
||||||
|
|
||||||
# Do static code analysis.
|
# Do static code analysis.
|
||||||
# ./vendor/bin/phpstan analyse -c .ci/phpstan.neon --no-progress
|
# ./vendor/bin/phpstan analyse -c .ci/phpstan.neon --no-progress
|
||||||
./vendor/bin/phpstan analyse -c .ci/phpstan.neon
|
./vendor/bin/phpstan analyse -c .ci/phpstan.neon
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@
|
|||||||
npm-debug.log
|
npm-debug.log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
.env
|
.env
|
||||||
|
.php-cs-fixer.cache
|
||||||
|
|||||||
Reference in New Issue
Block a user