Skip to content
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

Update README.md #236

Merged
merged 1 commit into from
Jul 28, 2023
Merged
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
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ All the below static code analysis tests can be run with `task test:static`
`phpcs.xml` can be altered using Drupal's
[composer scaffold](https://www.drupal.org/docs/develop/using-composer/using-drupals-composer-scaffold#toc_4).

- Edit `phpcs.xml` in the root of your project, e.g. to an exclude pattern:
- Edit `phpcs.xml` in the root of your project, e.g. to add an exclude pattern:
```
<!-- Custom excludes -->
<exclude-pattern>web/sites/sites.php</exclude-pattern>
Expand All @@ -197,11 +197,15 @@ All the below static code analysis tests can be run with `task test:static`
- Add the patch to `composer.json`
```
"scripts": {
"pre-drupal-scaffold-cmd": [
"if [ -f \"phpcs.xml\" ]; then rm phpcs.xml; fi"
],
"post-drupal-scaffold-cmd": [
"patch phpcs.xml < patches/custom/phpcs.xml.patch"
"if [ -f \"phpcs.xml\" ]; then patch phpcs.xml < patches/custom/phpcs.xml.patch; fi"
]
},
```
The pre hook is needed otherwise the composer scaffold attempts to re-patch a file it no longer has control over when running `composer install --no-dev`
- Delete the `vendor` directory and `phpcs.xml` and then run `composer install`
to verify everything works as expected

Expand Down