Skip to content

Add composer runnable scripts for PHPStan & PHP-CS #881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"type": "project",
"minimum-stability": "beta",
"homepage": "https://enqueue.forma-pro.com/",
"scripts": {
"cs-fix": "bin/php-cs-fixer fix --config=.php_cs.php",
"cs-lint": "bin/php-cs-fixer fix --config=.php_cs.php --no-interaction --dry-run --diff",
"phpstan": "bin/phpstan analyse --memory-limit=512M -c phpstan.neon"
},
"require": {
"php": "^7.1.3",

Expand Down
6 changes: 6 additions & 0 deletions docs/contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ composer install

Once you did it you can work on a feature or bug fix.

If you need, you can also use composer scripts to run code linting and static analysis:
* For code style linting, run `composer run cs-lint`. Optionally add file names:
`composer run cs-lint pkg/null/NullTopic.php` for example.
* You can also fix your code style with `composer run cs-fix`.
* Static code analysis can be run using `composer run phpstan`. As above, you can pass specific files.

## Testing

To run tests
Expand Down