@@ -107,18 +107,52 @@ You can easily use the code quality checkers on your CI (CircleCi/Jenkins/GitLab
107
107
./vendor/bin/grumphp run --no-ansi --no-interaction
108
108
` ` `
109
109
110
- # # IDE Integration
110
+ # # IDE Integration (optional)
111
111
112
- To use PHPCS from your IDE, you can point it to the following script :
112
+ # ## Prerequisites
113
113
114
+ # ### Ubuntu
115
+ To install the necessary PHP components without Apache :
114
116
` ` `
115
- vendor/wunderio/code-quality/bin/phpcs-docker
117
+ sudo apt install php-cli php-tokenizer
116
118
` ` `
117
119
118
- This script runs PHP_CodeSniffer inside a Docker container using the PHP 8.2
119
- CLI image. It mounts the current working directory to the /app directory inside
120
- the container and executes the PHPCS command with the WunderAll standard.
120
+ # ### macOS
121
+ [Placeholder for macOS installation instructions]
121
122
122
- For Visual Studio Code you'd also need this plugin
123
- https://marketplace.visualstudio.com/items?itemName=shevaua.phpcs
123
+ # ## Configuration
124
+
125
+ # ### Visual Studio Code
126
+
127
+ 1. Install the [Drupal extension](https://marketplace.visualstudio.com/items?itemName=Stanislav.vscode-drupal).
128
+ 2. Open the Drupal extension configuration.
129
+ 3. Find "Drupal > Phpcs : Args" and "Drupal > Phpcbf: Args".
130
+ 4. Click "Edit in settings.json" and add :
131
+
132
+ ` ` ` json
133
+ {
134
+ "drupal.phpcs.args": [
135
+ "--standard=WunderAll"
136
+ ],
137
+ "drupal.phpcbf.args": [
138
+ "--standard=WunderAll"
139
+ ]
140
+ }
141
+ ` ` `
142
+
143
+ PHPCS usage Example in Visual Studio Code :
144
+ 
145
+
146
+ # ### PhpStorm
147
+
148
+ Open settings and look for PHP_Codesniffer. Make sure these settings are the same :
149
+ 
150
+
151
+ Check the paths and validate :
152
+ 
153
+
154
+ Warnings are underlined and you can choose to fix them by right clicking :
155
+ 
124
156
157
+ Choose the "PHP Code Beautifier and Fixer : fix the whole file"
158
+ 
0 commit comments