-
Notifications
You must be signed in to change notification settings - Fork 266
Add composer scripts #1120
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
Add composer scripts #1120
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,8 @@ Composer. | |
|
||
The test suite may be executed with: | ||
|
||
``` | ||
$ vendor/bin/simple-phpunit | ||
```console | ||
$ composer run test | ||
``` | ||
|
||
The `phpunit.xml.dist` file is used as the default configuration file for the | ||
|
@@ -47,8 +47,8 @@ By default, the `simple-phpunit` binary chooses the correct PHPUnit version for | |
the PHP version you are running. To run tests against a specific PHPUnit | ||
version, use the `SYMFONY_PHPUNIT_VERSION` environment variable: | ||
|
||
``` | ||
$ SYMFONY_PHPUNIT_VERSION=7.5 vendor/bin/simple-phpunit | ||
```console | ||
$ SYMFONY_PHPUNIT_VERSION=8.5 vendor/bin/simple-phpunit | ||
``` | ||
|
||
### Environment Variables | ||
|
@@ -108,55 +108,63 @@ The following environment variables are used for [CSFLE testing](https://github. | |
* `KMS_TLS_CA_FILE` | ||
* `KMS_TLS_CERTIFICATE_KEY_FILE` | ||
|
||
## Checking coding standards | ||
## Code quality | ||
|
||
Before submitting a pull request, please ensure that your code adheres to the | ||
coding standards and passes static analysis checks. | ||
|
||
```console | ||
$ composer run checks | ||
``` | ||
|
||
### Coding standards | ||
|
||
The library's code is checked using [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer), | ||
which is installed as a development dependency by Composer. To check the code | ||
for style errors, run the `phpcs` binary: | ||
|
||
|
||
``` | ||
```console | ||
$ vendor/bin/phpcs | ||
``` | ||
|
||
To automatically fix all fixable errors, use the `phpcbf` binary: | ||
|
||
``` | ||
```console | ||
$ vendor/bin/phpcbf | ||
``` | ||
|
||
## Running static analysis | ||
### Static analysis | ||
|
||
The library uses [psalm](https://psalm.dev) to run static analysis on the code | ||
and ensure an additional level of type safety. New code is expected to adhere | ||
to level 1, with a baseline covering existing issues. To run static analysis | ||
checks, run the `psalm` binary: | ||
|
||
``` | ||
```console | ||
$ vendor/bin/psalm | ||
``` | ||
|
||
To remove fixed errors from the baseline, you can use the `update-baseline` | ||
command-line argument: | ||
|
||
``` | ||
```console | ||
$ vendor/bin/psalm --update-baseline | ||
``` | ||
|
||
Note that this will not add new errors to the baseline. New errors should be | ||
fixed instead of being added to the technical debt, but in case this isn't | ||
possible it can be added to the baseline using `set-baseline`: | ||
|
||
``` | ||
```console | ||
$ vendor/bin/psalm --set-baseline=psalm-baseline.xml | ||
``` | ||
|
||
## Automatic code refactoring | ||
### Refactoring | ||
|
||
The library uses [rector](https://getrector.com/) to refactor the code for new features. | ||
To run automatic refactoring, use the `rector` command: | ||
|
||
``` | ||
```console | ||
$ vendor/bin/rector | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you mean to change this to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really hesitated. In the end, I think we should offer the 2 entry points into the document: Composer scripts in the header and the path to the binaries in details. |
||
``` | ||
|
||
|
@@ -178,7 +186,7 @@ repository: | |
repository. | ||
* Create and activate Python 2.7 virtual environment if necessary. | ||
|
||
``` | ||
```console | ||
$ virtualenv -p python2.7 venv | ||
$ source venv/bin/activate | ||
``` | ||
|
Uh oh!
There was an error while loading. Please reload this page.