Skip to content

Commit

Permalink
QA: remove redundant PHPCS ignore annotations
Browse files Browse the repository at this point in the history
... and make two others more specific.
  • Loading branch information
jrfnl committed Apr 15, 2021
1 parent 288ad35 commit 5593738
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion WordPress-VIP-Go/ruleset-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@
// Run the tests!
$test = new RulesetTest( 'WordPress-VIP-Go', $expected );
if ( $test->passes() ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
printf( 'All WordPress-VIP-Go tests passed!' . PHP_EOL );
exit( 0 );
}
Expand Down
2 changes: 1 addition & 1 deletion WordPressVIPMinimum/ruleset-test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ add_filter( 'robots_txt', function() { // Warning.
} );

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

// WordPressVIPMinimum.Performance.CacheValueOverride
Expand Down
2 changes: 1 addition & 1 deletion WordPressVIPMinimum/ruleset-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
// Run the tests!
$test = new RulesetTest( 'WordPressVIPMinimum', $expected );
if ( $test->passes() ) {
printf( 'All WordPressVIPMinimum tests passed!' . PHP_EOL ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
printf( 'All WordPressVIPMinimum tests passed!' . PHP_EOL );
exit( 0 );
}

Expand Down
5 changes: 2 additions & 3 deletions tests/RulesetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function __construct( $ruleset, $expected = [] ) {
// Travis and Windows support.
$phpcs_bin = getenv( 'PHPCS_BIN' );
if ( $phpcs_bin === false ) {
// phpcs:ignore
// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration_putenv -- This is test code, not production.
putenv( 'PHPCS_BIN=phpcs' );
} else {
$this->phpcs_bin = realpath( $phpcs_bin );
Expand All @@ -101,7 +101,6 @@ public function __construct( $ruleset, $expected = [] ) {
$output = $this->collect_phpcs_result();

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

return json_decode( $output );
Expand Down

0 comments on commit 5593738

Please sign in to comment.