Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA: remove redundant PHPCS ignore annotations #655

Merged
merged 1 commit into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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