bristol-su / portal-pipeline
Styles for the Bristol SU Portal
Requires
- php: >=7.2
- friendsofphp/php-cs-fixer: ^2.18
- phpstan/phpstan: ^0.12.71
- rector/rector: 0.9.16
Requires (Dev)
- pheromone/phpcs-security-audit: ^2.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-12-17 07:49:05 UTC
README
Bring your coding style in line with the Bristol SU Portal Guidelines
Installation
Pull in this project
composer require bristol-su/portal-code-style
Create a .php_cs.dist file in your project. You can find an example in ./vendor/bristol-su/portal-code-style/examples/.php_cs.dist.example
Create a rector.php file in your project. You can find an example in ./vendor/bristol-su/portal-code-style/examples/rector.php
Add the following to your composer scripts
"scripts": {
"test": "vendor/bin/phpunit --colors=always --process-isolation --verbose --configuration phpunit.xml",
"code-style": [
"vendor/bin/php-cs-fixer fix --config .php_cs --dry-run --verbose --using-cache=no",
"vendor/bin/rector process --dry-run --output-format=console"
],
"fix-code-style": "vendor/bin/php-cs-fixer fix --config .php_cs --verbose --using-cache=no"
}
Github Actions
You can now set up a github workflow using the actions we provide. See examples of all these at ./vendor/bristol-su/portal-code-style/examples/workflow.php
Commands
You can also run the following commands locally
composer run test
: Run the entire testsuite
composer run code-style
: Dry run all our coding checks to make sure your code will pass the pipeline
composer run fix-code-style
: Fix any minor formatting issues automatically