Skip to content

Commit b564131

Browse files
committed
Composer: add scripts for contributors
These scripts should make contributing to PHPCS more straight-forward as they document common CI checks and allow for running these locally.
1 parent 4caa4ef commit b564131

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

composer.json

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,43 @@
4848
"bin": [
4949
"bin/phpcs",
5050
"bin/phpcbf"
51-
]
51+
],
52+
"scripts": {
53+
"cs": [
54+
"@php ./bin/phpcs"
55+
],
56+
"cbf": [
57+
"@php ./bin/phpcbf"
58+
],
59+
"test": [
60+
"Composer\\Config::disableProcessTimeout",
61+
"@php ./vendor/phpunit/phpunit/phpunit tests/AllTests.php --no-coverage"
62+
],
63+
"test-php8": [
64+
"Composer\\Config::disableProcessTimeout",
65+
"@php ./vendor/phpunit/phpunit/phpunit tests/AllTests.php --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests --no-coverage"
66+
],
67+
"coverage": [
68+
"Composer\\Config::disableProcessTimeout",
69+
"@php ./vendor/phpunit/phpunit/phpunit tests/AllTests.php -d max_execution_time=0"
70+
],
71+
"build": [
72+
"Composer\\Config::disableProcessTimeout",
73+
"@php -d phar.readonly=0 -f ./scripts/build-phar.php"
74+
],
75+
"check-all": [
76+
"@cs",
77+
"@test",
78+
"@check-package"
79+
]
80+
},
81+
"scripts-descriptions": {
82+
"cs": "Check for code style violations.",
83+
"cbf": "Fix code style violations.",
84+
"test": "Run the unit tests without code coverage.",
85+
"test-php8": "Run the unit tests without code coverage on PHP 8.1 or higher.",
86+
"coverage": "Run the unit tests with code coverage.",
87+
"build": "Create PHAR files for PHPCS and PHPCBF.",
88+
"check-all": "Run all checks (phpcs, tests)."
89+
}
5290
}

0 commit comments

Comments
 (0)