Skip to content

Commit 6e58e38

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 4d50b4c commit 6e58e38

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

composer.json

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,47 @@
3737
"bin": [
3838
"bin/phpcs",
3939
"bin/phpcbf"
40-
]
40+
],
41+
"scripts": {
42+
"cs": [
43+
"@php ./bin/phpcs"
44+
],
45+
"cbf": [
46+
"@php ./bin/phpcbf"
47+
],
48+
"test": [
49+
"Composer\\Config::disableProcessTimeout",
50+
"@php ./vendor/phpunit/phpunit/phpunit tests/AllTests.php --no-coverage"
51+
],
52+
"test-php8": [
53+
"Composer\\Config::disableProcessTimeout",
54+
"@php ./vendor/phpunit/phpunit/phpunit tests/AllTests.php --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests --no-coverage"
55+
],
56+
"coverage": [
57+
"Composer\\Config::disableProcessTimeout",
58+
"@php ./vendor/phpunit/phpunit/phpunit tests/AllTests.php -d max_execution_time=0"
59+
],
60+
"build": [
61+
"Composer\\Config::disableProcessTimeout",
62+
"@php -d phar.readonly=0 -f ./scripts/build-phar.php"
63+
],
64+
"check-package": [
65+
"@php -f ./scripts/validate-pear-package.php"
66+
],
67+
"check-all": [
68+
"@cs",
69+
"@test",
70+
"@check-package"
71+
]
72+
},
73+
"scripts-descriptions": {
74+
"cs": "Check for code style violations.",
75+
"cbf": "Fix code style violations.",
76+
"test": "Run the unit tests without code coverage.",
77+
"test-php8": "Run the unit tests without code coverage on PHP 8.1 or higher.",
78+
"coverage": "Run the unit tests with code coverage.",
79+
"build": "Create PHAR files for PHPCS and PHPCBF.",
80+
"check-package": "Check all files are correctly listed in the package.xml file.",
81+
"check-all": "Run all checks (phpcs, tests, package check)."
82+
}
4183
}

0 commit comments

Comments
 (0)