Skip to content

Commit eb8370f

Browse files
authored
Merge pull request #655 from Automattic/fix/QA/remove-outdated-ignore-annotations
QA: remove redundant PHPCS ignore annotations
2 parents 288ad35 + 5593738 commit eb8370f

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

WordPress-VIP-Go/ruleset-test.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@
342342
// Run the tests!
343343
$test = new RulesetTest( 'WordPress-VIP-Go', $expected );
344344
if ( $test->passes() ) {
345-
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
346345
printf( 'All WordPress-VIP-Go tests passed!' . PHP_EOL );
347346
exit( 0 );
348347
}

WordPressVIPMinimum/ruleset-test.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ add_filter( 'robots_txt', function() { // Warning.
443443
} );
444444

445445
// WordPressVIPMinimum.Performance.BatcacheWhitelistedParams
446-
// phpcs:ignore WordPress.Security.NonceVerification.NoNonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotValidated
446+
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated
447447
$test = sanitize_text_field( $_GET["utm_medium"] ); // Warning.
448448

449449
// WordPressVIPMinimum.Performance.CacheValueOverride

WordPressVIPMinimum/ruleset-test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@
323323
// Run the tests!
324324
$test = new RulesetTest( 'WordPressVIPMinimum', $expected );
325325
if ( $test->passes() ) {
326-
printf( 'All WordPressVIPMinimum tests passed!' . PHP_EOL ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
326+
printf( 'All WordPressVIPMinimum tests passed!' . PHP_EOL );
327327
exit( 0 );
328328
}
329329

tests/RulesetTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function __construct( $ruleset, $expected = [] ) {
9292
// Travis and Windows support.
9393
$phpcs_bin = getenv( 'PHPCS_BIN' );
9494
if ( $phpcs_bin === false ) {
95-
// phpcs:ignore
95+
// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration_putenv -- This is test code, not production.
9696
putenv( 'PHPCS_BIN=phpcs' );
9797
} else {
9898
$this->phpcs_bin = realpath( $phpcs_bin );
@@ -101,7 +101,6 @@ public function __construct( $ruleset, $expected = [] ) {
101101
$output = $this->collect_phpcs_result();
102102

103103
if ( ! is_object( $output ) || empty( $output ) ) {
104-
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
105104
printf( 'The PHPCS command checking the ruleset hasn\'t returned any issues. Bailing ...' . PHP_EOL );
106105
exit( 1 ); // Die early, if we don't have any output.
107106
}
@@ -149,7 +148,7 @@ private function collect_phpcs_result() {
149148
$this->phpcs_bin,
150149
$this->ruleset
151150
);
152-
// phpcs:ignore
151+
// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.system_calls_shell_exec -- This is test code, not production.
153152
$output = shell_exec( $shell );
154153

155154
return json_decode( $output );

0 commit comments

Comments
 (0)