Skip to content

Commit 7faeb7c

Browse files
fix: Exclude test files from WordPress.Security checks
- Test and bootstrap files don't need output escaping - Focus security checks on production code only
1 parent 532b4ff commit 7faeb7c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

phpcs.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
<!-- WordPress Security (Critical for WordPress integration) -->
4848
<rule ref="WordPress.Security.EscapeOutput"/>
4949
<rule ref="WordPress.Security.ValidatedSanitizedInput"/>
50+
51+
<!-- Exclude WordPress.Security checks from test files -->
52+
<rule ref="WordPress.Security">
53+
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
54+
<exclude-pattern>tests/fixtures/*</exclude-pattern>
55+
</rule>
5056

5157
<!-- WordPress i18n (Text domain validation) -->
5258
<rule ref="WordPress.WP.I18n">

0 commit comments

Comments
 (0)