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
Copy file name to clipboardExpand all lines: AGENTS.md
+21-2Lines changed: 21 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,27 @@ When contributing to this package, please adhere to the following guidelines:
13
13
14
14
### Building and running
15
15
16
-
Before submitting any changes, it is crucial to validate them by running the full suite of static code analysis and tests. To run the full suite of checks, execute the following command: `composer test`.
16
+
Run the narrowest check that covers your change:
17
17
18
-
This single command ensures that your changes meet all the quality gates of the project. While you can run the individual steps separately, it is highly recommended to use this single command to ensure a comprehensive validation.
18
+
| You changed | Run |
19
+
| --- | --- |
20
+
| Any PHP file |`composer phpcs -- <file>` and `composer phpstan`|
21
+
| Logic with unit test coverage |`composer phpunit -- --filter <TestName>`|
22
+
| One feature file |`composer behat -- features/<name>.feature`|
23
+
| One scenario |`composer behat -- features/<name>.feature:<line>`|
24
+
25
+
After a failure, `composer behat-rerun` re-runs only the scenarios that failed, and `composer behat -- --stop-on-failure` bails out at the first one instead of working through the rest.
26
+
27
+
`composer test` runs every suite, the whole Behat suite included. In most packages that means installing WordPress from scratch once per scenario, which takes tens of minutes and needs `jq`, a MySQL or MariaDB client with a prepared test database, and network access to WordPress.org. Run it before opening a pull request when you have touched something cross-cutting. Do not run it to check a two-line change.
28
+
29
+
Set these first, so the tools report problems compactly instead of drawing progress bars and ANSI color into output you are going to read back:
30
+
31
+
```bash
32
+
export NO_COLOR=1
33
+
export WP_CLI_TEST_QUIET=1
34
+
```
35
+
36
+
Note that a green `composer test` is not the same as a green CI. `actionlint` and `typos` also run on every pull request and are not part of it.
19
37
20
38
### Useful Composer Commands
21
39
@@ -24,6 +42,7 @@ The project uses Composer to manage dependencies and run scripts. The following
24
42
*`composer install`: Install dependencies.
25
43
*`composer test`: Run the full test suite, including linting, code style checks, static analysis, and unit/behavior tests.
26
44
*`composer lint`: Check for syntax errors.
45
+
*`composer lint-gherkin`: Check the Behat feature files for style violations.
27
46
*`composer phpcs`: Check for code style violations.
0 commit comments