Skip to content

Commit c18a15f

Browse files
feat(installer): make phpcs-composer-installer optional
Moves dealerdirect/phpcodesniffer-composer-installer from equire to suggest in composer.json to make its installation optional. The README.md has been updated to reflect this change, providing clearer instructions for both automatic and manual configuration of PHP_CodeSniffer. This gives users more flexibility in how they manage their dependencies and PHP_CodeSniffer setup.
1 parent ab3a5a9 commit c18a15f

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,21 @@ Install this package as a development dependency using [Composer](https://getcom
4848
composer require --dev wptechnix/wordpress-coding-standards
4949
```
5050

51-
### Automatic Installation with Dealerdirect
51+
### Optional: Automatic Installation with Dealerdirect
5252

53-
This package uses [dealerdirect/phpcodesniffer-composer-installer](https://github.com/Dealerdirect/phpcodesniffer-composer-installer) to automatically register the coding standard with PHP_CodeSniffer. This means:
53+
For automatic registration with PHP_CodeSniffer, you can optionally install [dealerdirect/phpcodesniffer-composer-installer](https://github.com/Dealerdirect/phpcodesniffer-composer-installer):
5454

55-
- The standard is automatically installed to PHP_CodeSniffer's standards directory upon Composer install.
56-
- No manual path configuration is required.
57-
- The standard becomes immediately available for use in your `phpcs.xml` configuration.
55+
```bash
56+
composer require --dev dealerdirect/phpcodesniffer-composer-installer
57+
```
58+
59+
This plugin will:
60+
61+
- Automatically register the standard with PHP_CodeSniffer upon Composer install.
62+
- Eliminate the need for manual path configuration.
63+
- Make the standard immediately available for use in your `phpcs.xml` configuration.
5864

59-
If you're using a custom PHP_CodeSniffer installation, ensure the `dealerdirect/phpcodesniffer-composer-installer` plugin is enabled. This package's `composer.json` already allows this plugin automatically.
65+
**Note:** This is optional. If you prefer manual configuration or have a custom PHP_CodeSniffer setup, you can skip this step and configure the path manually in your `phpcs.xml` file.
6066

6167
## Usage
6268

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
],
2424
"require": {
2525
"php": "^8.0",
26-
"wptechnix/coding-standards": "^1.0",
27-
"dealerdirect/phpcodesniffer-composer-installer": "^1.0"
26+
"wptechnix/coding-standards": "^1.0"
27+
},
28+
"suggest": {
29+
"dealerdirect/phpcodesniffer-composer-installer": "Automatically register the standard with PHP_CodeSniffer upon Composer install"
2830
},
2931
"support": {
3032
"issues": "https://github.com/wptechnix/wordpress-coding-standards/issues",
@@ -34,5 +36,8 @@
3436
"allow-plugins": {
3537
"dealerdirect/phpcodesniffer-composer-installer": true
3638
}
39+
},
40+
"extra": {
41+
"installer-name": "WPTechnixWordPress"
3742
}
3843
}

0 commit comments

Comments
 (0)