Simplify formatting tools setup

This commit is contained in:
Timothy Warren 2022-03-03 10:54:50 -05:00
parent 825b84db8a
commit 33993fba2c
8 changed files with 138 additions and 144 deletions

2
.gitignore vendored
View File

@ -11,6 +11,6 @@
###< phpunit/phpunit ### ###< phpunit/phpunit ###
# PHP CS Fixer # PHP CS Fixer
tools/php-cs-fixer/vendor/ tools/vendor/
/.php-cs-fixer.php /.php-cs-fixer.php
/.php-cs-fixer.cache /.php-cs-fixer.cache

View File

@ -19,7 +19,6 @@
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^9.5", "phpunit/phpunit": "^9.5",
"rector/rector": "^0.12.16",
"roave/security-advisories": "dev-master", "roave/security-advisories": "dev-master",
"symfony/dotenv": "^6.0.3", "symfony/dotenv": "^6.0.3",
"symfony/flex": "^2.1.6", "symfony/flex": "^2.1.6",

126
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "8180777612d8d58ad22454a822af2120", "content-hash": "dbd4204be0a3d2c144aeb6270fc8baf5",
"packages": [ "packages": [
{ {
"name": "composer/package-versions-deprecated", "name": "composer/package-versions-deprecated",
@ -6081,70 +6081,6 @@
}, },
"time": "2021-12-08T12:19:24+00:00" "time": "2021-12-08T12:19:24+00:00"
}, },
{
"name": "phpstan/phpstan",
"version": "1.4.7",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "15087679960d72ae56bfcbf0d728d19941d3f7c2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/15087679960d72ae56bfcbf0d728d19941d3f7c2",
"reference": "15087679960d72ae56bfcbf0d728d19941d3f7c2",
"shasum": ""
},
"require": {
"php": "^7.1|^8.0"
},
"conflict": {
"phpstan/phpstan-shim": "*"
},
"bin": [
"phpstan",
"phpstan.phar"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.4.7"
},
"funding": [
{
"url": "https://github.com/ondrejmirtes",
"type": "github"
},
{
"url": "https://github.com/phpstan",
"type": "github"
},
{
"url": "https://www.patreon.com/phpstan",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
"type": "tidelift"
}
],
"time": "2022-03-02T16:04:01+00:00"
},
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "9.2.14", "version": "9.2.14",
@ -6566,66 +6502,6 @@
], ],
"time": "2022-02-23T17:10:58+00:00" "time": "2022-02-23T17:10:58+00:00"
}, },
{
"name": "rector/rector",
"version": "0.12.17",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "4f32575b718a4d7032423dc8e9d1e530ad859782"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/4f32575b718a4d7032423dc8e9d1e530ad859782",
"reference": "4f32575b718a4d7032423dc8e9d1e530ad859782",
"shasum": ""
},
"require": {
"php": "^7.1|^8.0",
"phpstan/phpstan": "^1.4.6"
},
"conflict": {
"phpstan/phpdoc-parser": "<1.2",
"rector/rector-cakephp": "*",
"rector/rector-doctrine": "*",
"rector/rector-laravel": "*",
"rector/rector-nette": "*",
"rector/rector-phpoffice": "*",
"rector/rector-phpunit": "*",
"rector/rector-prefixed": "*",
"rector/rector-symfony": "*"
},
"bin": [
"bin/rector"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "0.12-dev"
}
},
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Instant Upgrade and Automated Refactoring of any PHP code",
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/0.12.17"
},
"funding": [
{
"url": "https://github.com/tomasvotruba",
"type": "github"
}
],
"time": "2022-03-03T12:18:11+00:00"
},
{ {
"name": "roave/security-advisories", "name": "roave/security-advisories",
"version": "dev-master", "version": "dev-master",

View File

@ -4,16 +4,16 @@ default:
# Runs rector, showing what changes will be make # Runs rector, showing what changes will be make
rector-dry-run: rector-dry-run:
vendor/bin/rector process --config=tools/rector.php --dry-run src tools tools/vendor/bin/rector process --config=tools/rector.php --dry-run src
# Runs rector, and updates the files # Runs rector, and updates the files
rector: rector:
vendor/bin/rector process --config=tools/rector.php src tools tools/vendor/bin/rector process --config=tools/rector.php src
# Check code formatting # Check code formatting
check-fmt: check-fmt:
tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --verbose tools/vendor/bin/php-cs-fixer fix --dry-run --verbose
# Fix code formatting # Fix code formatting
fmt: fmt:
tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --verbose tools/vendor/bin/php-cs-fixer fix --verbose

View File

@ -114,9 +114,6 @@
"phpspec/prophecy": { "phpspec/prophecy": {
"version": "v1.15.0" "version": "v1.15.0"
}, },
"phpstan/phpstan": {
"version": "1.4.6"
},
"phpunit/php-code-coverage": { "phpunit/php-code-coverage": {
"version": "9.2.10" "version": "9.2.10"
}, },
@ -158,9 +155,6 @@
"psr/log": { "psr/log": {
"version": "1.1.3" "version": "1.1.3"
}, },
"rector/rector": {
"version": "0.12.16"
},
"roave/security-advisories": { "roave/security-advisories": {
"version": "dev-master" "version": "dev-master"
}, },

7
tools/composer.json Normal file
View File

@ -0,0 +1,7 @@
{
"require": {
"codeigniter/coding-standard": "^1.4",
"friendsofphp/php-cs-fixer": "^3.6",
"rector/rector": "^0.12.16"
}
}

View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "fb2f64263089ac10ffa172721a763924", "content-hash": "c378e5e1c8955dd6dd8351e352ad418a",
"packages": [ "packages": [
{ {
"name": "codeigniter/coding-standard", "name": "codeigniter/coding-standard",
@ -625,6 +625,70 @@
}, },
"time": "2020-10-14T08:32:19+00:00" "time": "2020-10-14T08:32:19+00:00"
}, },
{
"name": "phpstan/phpstan",
"version": "1.4.7",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "15087679960d72ae56bfcbf0d728d19941d3f7c2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/15087679960d72ae56bfcbf0d728d19941d3f7c2",
"reference": "15087679960d72ae56bfcbf0d728d19941d3f7c2",
"shasum": ""
},
"require": {
"php": "^7.1|^8.0"
},
"conflict": {
"phpstan/phpstan-shim": "*"
},
"bin": [
"phpstan",
"phpstan.phar"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.4.7"
},
"funding": [
{
"url": "https://github.com/ondrejmirtes",
"type": "github"
},
{
"url": "https://github.com/phpstan",
"type": "github"
},
{
"url": "https://www.patreon.com/phpstan",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
"type": "tidelift"
}
],
"time": "2022-03-02T16:04:01+00:00"
},
{ {
"name": "psr/cache", "name": "psr/cache",
"version": "3.0.0", "version": "3.0.0",
@ -827,6 +891,66 @@
}, },
"time": "2021-07-14T16:46:02+00:00" "time": "2021-07-14T16:46:02+00:00"
}, },
{
"name": "rector/rector",
"version": "0.12.17",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "4f32575b718a4d7032423dc8e9d1e530ad859782"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/4f32575b718a4d7032423dc8e9d1e530ad859782",
"reference": "4f32575b718a4d7032423dc8e9d1e530ad859782",
"shasum": ""
},
"require": {
"php": "^7.1|^8.0",
"phpstan/phpstan": "^1.4.6"
},
"conflict": {
"phpstan/phpdoc-parser": "<1.2",
"rector/rector-cakephp": "*",
"rector/rector-doctrine": "*",
"rector/rector-laravel": "*",
"rector/rector-nette": "*",
"rector/rector-phpoffice": "*",
"rector/rector-phpunit": "*",
"rector/rector-prefixed": "*",
"rector/rector-symfony": "*"
},
"bin": [
"bin/rector"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "0.12-dev"
}
},
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Instant Upgrade and Automated Refactoring of any PHP code",
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/0.12.17"
},
"funding": [
{
"url": "https://github.com/tomasvotruba",
"type": "github"
}
],
"time": "2022-03-03T12:18:11+00:00"
},
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v6.0.5", "version": "v6.0.5",

View File

@ -1,6 +0,0 @@
{
"require": {
"codeigniter/coding-standard": "^1.4",
"friendsofphp/php-cs-fixer": "^3.6"
}
}