From a30828c22d28fac1c6f0f2130471b2693930d171 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sat, 21 Sep 2024 03:36:48 +0200 Subject: [PATCH 1/8] Check against (an existing) minimal WP version --- phpcs.ruleset.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.ruleset.xml b/phpcs.ruleset.xml index 0f5844ab4..110c921fd 100644 --- a/phpcs.ruleset.xml +++ b/phpcs.ruleset.xml @@ -30,7 +30,7 @@ - + From 5b2fb36a5a68a0e32340dcbe17be988a3a373aaf Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sat, 21 Sep 2024 03:38:10 +0200 Subject: [PATCH 2/8] Update config directivedue to WordPressCS 3.0.0, this was called minimum_supported_wp_version before --- phpcs.ruleset.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.ruleset.xml b/phpcs.ruleset.xml index 110c921fd..217fe7dec 100644 --- a/phpcs.ruleset.xml +++ b/phpcs.ruleset.xml @@ -30,7 +30,7 @@ - + From 3770649e6d6eb52141fc45643695b1ec2ce73903 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sat, 21 Sep 2024 03:38:54 +0200 Subject: [PATCH 3/8] Remove superflous phpcs:ignore statement --- includes/core/classes/class-event-query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/core/classes/class-event-query.php b/includes/core/classes/class-event-query.php index f59092a5b..0a93f6802 100644 --- a/includes/core/classes/class-event-query.php +++ b/includes/core/classes/class-event-query.php @@ -340,9 +340,9 @@ public function adjust_event_sql( array $pieces, string $type = 'all', string $o $current = gmdate( Event::DATETIME_FORMAT, time() ); if ( 'upcoming' === $type ) { - $pieces['where'] .= $wpdb->prepare( ' AND %i.datetime_end_gmt >= %s', $table, $current ); // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnsupportedIdentifierPlaceholder + $pieces['where'] .= $wpdb->prepare( ' AND %i.datetime_end_gmt >= %s', $table, $current ); } elseif ( 'past' === $type ) { - $pieces['where'] .= $wpdb->prepare( ' AND %i.datetime_end_gmt < %s', $table, $current ); // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnsupportedIdentifierPlaceholder + $pieces['where'] .= $wpdb->prepare( ' AND %i.datetime_end_gmt < %s', $table, $current ); } return $pieces; From ad19125eedbf6bc0d9d51f0b2136a5097d002d29 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sat, 21 Sep 2024 03:43:19 +0200 Subject: [PATCH 4/8] Allow to use the 'default' textdomain with strings (No need to translate 100%-core strings) --- phpcs.ruleset.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/phpcs.ruleset.xml b/phpcs.ruleset.xml index 217fe7dec..c9cb3747e 100644 --- a/phpcs.ruleset.xml +++ b/phpcs.ruleset.xml @@ -41,7 +41,11 @@ - + + + + + From 09d49342a87042a829288eeb26d1f56ae4907154 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sat, 21 Sep 2024 03:51:06 +0200 Subject: [PATCH 5/8] Trigger a Warning on @todo comments --- phpcs.ruleset.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpcs.ruleset.xml b/phpcs.ruleset.xml index c9cb3747e..67c4e57b6 100644 --- a/phpcs.ruleset.xml +++ b/phpcs.ruleset.xml @@ -32,6 +32,8 @@ + + From 4801bc9ad65d5fb7ff5392325dcb34f9c924a316 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sat, 21 Sep 2024 03:51:29 +0200 Subject: [PATCH 6/8] Let's also check that everything is properly documented. --- phpcs.ruleset.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpcs.ruleset.xml b/phpcs.ruleset.xml index 67c4e57b6..33240d128 100644 --- a/phpcs.ruleset.xml +++ b/phpcs.ruleset.xml @@ -32,6 +32,8 @@ + + From c098f6d403132ced7d3143d45dd3eee8e99ac345 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Wed, 25 Sep 2024 00:27:01 +0200 Subject: [PATCH 7/8] Are 'documented' todos with issue-URLs allowed for the CS check? --- includes/core/classes/class-settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/core/classes/class-settings.php b/includes/core/classes/class-settings.php index d009bba25..d42643bc1 100644 --- a/includes/core/classes/class-settings.php +++ b/includes/core/classes/class-settings.php @@ -757,7 +757,7 @@ public function maybe_flush_rewrite_rules( $old_value, $new_value ): void { isset( $old_value['urls'] ) && ! isset( $new_value['urls'] ) || $old_value['urls'] !== $new_value['urls'] ) { - // Event_Setup->maybe_create_flush_rewrite_rules_flag // TODO maybe make this a public method ?! + // Event_Setup->maybe_create_flush_rewrite_rules_flag //@TODO https://github.com/GatherPress/gatherpress/issues/880 Maybe make this a public method ?! add_option( 'gatherpress_flush_rewrite_rules_flag', true ); } } From 1924fde01f3c11f14f92e85b736e173865e713e4 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Wed, 25 Sep 2024 00:39:05 +0200 Subject: [PATCH 8/8] Dop the severity of "Generic.Commenting.Todo" from the default value (5) so that it is hidden by default --- phpcs.ruleset.xml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/phpcs.ruleset.xml b/phpcs.ruleset.xml index 33240d128..843512c95 100644 --- a/phpcs.ruleset.xml +++ b/phpcs.ruleset.xml @@ -36,6 +36,39 @@ + + + + + Please review this TODO comment + 3 + + + + Please review this TODO comment: %s + 3 + +