From c1c62f198615bfb70b380f7c7948ebabd9b69e54 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 2 Mar 2021 19:21:29 +0100 Subject: [PATCH 1/2] CI: fix build failures [1] PR 618 updated the message type for the `WordPressVIPMinimum.Functions.RestrictedFunctions.cookies_setcookie` error code from `warning` to `error`. However, the ruleset test for the `WordPressVIPMinimum` ruleset was not updated to match. Fixed now. --- WordPressVIPMinimum/ruleset-test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPressVIPMinimum/ruleset-test.php b/WordPressVIPMinimum/ruleset-test.php index 00ce92e8..45f428a8 100644 --- a/WordPressVIPMinimum/ruleset-test.php +++ b/WordPressVIPMinimum/ruleset-test.php @@ -164,6 +164,7 @@ 393 => 1, 394 => 1, 395 => 1, + 402 => 1, 415 => 1, 425 => 1, 451 => 1, @@ -269,7 +270,6 @@ 399 => 1, 400 => 1, 401 => 1, - 402 => 1, 403 => 1, 404 => 1, 405 => 1, From 87ddd1b95475d1189d4fe77cbd12b6c1b99175bb Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 2 Mar 2021 19:29:09 +0100 Subject: [PATCH 2/2] CI: fix build failures [2] PR 620 silenced the `VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable` error code in the VIP Go ruleset. However, the ruleset test for the `WordPress-VIP-Go` ruleset was not updated to match. Fixed now. --- WordPress-VIP-Go/ruleset-test.inc | 4 ++-- WordPress-VIP-Go/ruleset-test.php | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/WordPress-VIP-Go/ruleset-test.inc b/WordPress-VIP-Go/ruleset-test.inc index 9996527f..6000c1fa 100644 --- a/WordPress-VIP-Go/ruleset-test.inc +++ b/WordPress-VIP-Go/ruleset-test.inc @@ -214,7 +214,7 @@ function foo_bar_bar() { // VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable function foo_bar_foo() { - $a = 'Hello'; // Warning + $a = 'Hello'; // OK. Unused variables warning silenced. } // WordPressVIPMinimum.UserExperience.AdminBarRemoval @@ -417,7 +417,7 @@ the_sub_field( 'field' ); // Warning. the_field( 'field' ); // Warning. wp_remote_get( $url ); // Warning. get_posts(); // Warning. -function test_function( $a, $b ) { +function test_function( $a, $b ) { // OK. Unused variables warning silenced. return create_function( '$a, $b', 'return ( $b / $a ); '); // Warning. } wpcom_vip_get_term_link(); // Warning. diff --git a/WordPress-VIP-Go/ruleset-test.php b/WordPress-VIP-Go/ruleset-test.php index f76b352a..12128b66 100644 --- a/WordPress-VIP-Go/ruleset-test.php +++ b/WordPress-VIP-Go/ruleset-test.php @@ -184,7 +184,6 @@ 207 => 1, 208 => 1, 212 => 1, - 217 => 1, 221 => 1, 223 => 1, 225 => 1, @@ -222,7 +221,6 @@ 417 => 1, 418 => 1, 419 => 1, - 420 => 2, 421 => 1, 423 => 1, 424 => 1,