Upgrade/Install: Properly exclude the `admin/includesSchema.php` tests file for the `WordPress.DB.PreparedSQL.NotPrepared` sniff.

The way this was implemented in [43630] caused the file to be excluded for all sniffs, since PHPCS does not support file-wide ignores of a specific sniff at this point.

Props jrf.
See #44896.


git-svn-id: https://develop.svn.wordpress.org/trunk@43641 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Felix Arntz 2018-09-14 07:54:53 +00:00
parent 7d22ba1961
commit ffa16fa771
2 changed files with 3 additions and 1 deletions

View File

@ -81,6 +81,9 @@
<rule ref="WordPress.DB.PreparedSQLPlaceholders.UnescapedLiteral">
<exclude-pattern>/tests/phpunit/tests/db\.php</exclude-pattern>
</rule>
<rule ref="WordPress.DB.PreparedSQL.NotPrepared">
<exclude-pattern>/tests/phpunit/tests/admin/includesSchema\.php</exclude-pattern>
</rule>
<!-- Whitelist the I18n functions file from issues identified by the I18n sniff
(such as calling the low-level translate() function). -->

View File

@ -1,5 +1,4 @@
<?php
// phpcs:ignoreFile WordPress.DB.PreparedSQL.NotPrepared
/**
* @group admin