From 302f9f5aa9f76654e62a191b331daf8d2eaa6433 Mon Sep 17 00:00:00 2001 From: "Hagen, Kody J" Date: Thu, 21 May 2026 13:07:18 -0500 Subject: [PATCH] fix(ruleset): exclude tests and non-functions paths to prevent false positives --- ruleset.xml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/ruleset.xml b/ruleset.xml index 2e2cf1f..8a2052a 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -22,11 +22,11 @@ Covers: functions (bsu_), classes (BSU_), constants (BSU_). Hook names and global variables are excluded: - - Hook names: WordPress core hooks (the_content, gallery_style, etc.) cannot be - renamed. We hook into them via add_filter/apply_filters — not defining new ones. - - Global variables: WordPress core globals ($post, $wpdb, $wp_query) are accessed - with the global keyword inside methods. The rule cannot distinguish accessing an - existing global from declaring a new one. + - Hook names: WordPress core hooks cannot be renamed; hooking into them via + add_filter/apply_filters produces unavoidable false positives. + - Global variables: WordPress core globals ($post, $wpdb, $wp_query) accessed + with the global keyword inside methods cannot be distinguished from new + declarations by the rule. --> @@ -36,13 +36,16 @@ + */tests/*\.php$ + */crons/*\.php$ */template-parts/*\.php$ */template-*\.php$ */templateincludes-*\.php$ + */blocks-component-panel-postmeta/*\.php$ + */blocks/*\.php$ */functions/class-bsu\.php$ */Sniffs/*\.php$ */vendor/*\.php$