Repository navigation
Commit 3b7843b
Keep the test suite out of everybody's plugin
Composer installs a package from a git archive, and git archive honours
export-ignore. Most of these libraries had no .gitattributes at all, so
tests/, .github/ and the phpcs configuration were being installed into the
vendor directory of every plugin that depends on them.
That is not only untidy. A plugin's vendor tree gets scanned: by
WordPress.org on submission, and by security plugins on the live site. A
test suite is full of what a scanner reports -- stubbed core functions,
fixture credentials, and in two of these libraries a call to PHP's runtime
code interpreter, which is the first thing any of them looks for.
src/, assets/, templates/, data/, composer.json and the README ship.
Nothing else does. Checked with `git archive --worktree-attributes` rather
than assumed.
phpcs now refuses that interpreter outright. The sniff already existed and
was already installed; it is a warning by default, and a warning does not
fail CI, which is how it got in.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tk8y5eZa3CHVVSM6nVxsJw1 parent 89d3da9 commit 3b7843b
2 files changed
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
47 | 58 | | |
0 commit comments