You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1e0ff2d
Browse filesBrowse the repository at this point in the historyBrowse files
Merge branch 'main' into claude/wp-cli-ai-contributor-experience-2d3ces
Brings in the README regeneration from #361, which adds the section
#340 had only written into .readme-partials/USING.md. It merged
cleanly with this branch's own README additions.
Checked afterwards that every section the partial defines still matches
its generated counterpart byte for byte, so the next regeneration stays
a no-op.
Copy file name to clipboardExpand all lines: README.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,8 @@ To make use of the WP-CLI testing framework, you need to complete the following
91
91
```
92
92
93
93
All other [PHPCS configuration options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset) are, of course, available.
94
+
The PHP snippets embedded in your feature files are checked along with the rest of the package. See [Checking the code style of the PHP blocks in feature files](#checking-the-code-style-of-the-php-blocks-in-feature-files) below.
95
+
94
96
6. Optionally add a `phpstan-feature-files.neon.dist` file to the package root to also run PHPStan over the PHP snippets embedded in your feature files. See [Analysing the PHP blocks in feature files](#analysing-the-php-blocks-in-feature-files) below.
95
97
96
98
7. Update your composer dependencies and regenerate your autoloader and binary folders:
@@ -179,6 +181,56 @@ Two kinds of blocks are left out of the analysis, and are listed at the end of t
179
181
Blocks that declare the same class or function as another block are analysed separately from each
180
182
other, so that PHPStan does not resolve a name to the wrong block's declaration.
181
183
184
+
### Checking the code style of the PHP blocks in feature files
185
+
186
+
`composer phpcs` also checks the PHP snippets that feature files embed in docstrings, and
187
+
`composer phpcbf` fixes them in place. No configuration is needed, and like the analysis above the
188
+
blocks are padded so that findings are reported against the feature file itself:
The blocks are left alone when a run is narrowed down to a path, as in`composer phpcs -- src/`,
232
+
since such an argument is about the files of the package itself.
233
+
182
234
### Controlling what to test
183
235
184
236
To send one or more arguments to one of the test tools, prepend the argument(s) with a double dash. As an example, here's how to run the functional tests for a specific feature file only:
0 commit comments