Skip to content
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bsu/BSUWordPressCS",
"version": "1.2.0",
"version": "1.3.0",
"description": "Custom PHPCS sniffs for BSU WordPress standards",
"author": "BSU|NTC Web Services",
"license": "Copyright Web Services, Bemidji State University - All Rights Reserved. Unauthorized copying of any files or code in this package, via any medium is strictly prohibited.",
Expand Down
19 changes: 11 additions & 8 deletions ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
-->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
Expand All @@ -36,13 +36,16 @@
</property>
</properties>
<!--
Exclude template files (view layer — unprefixed local variables by design),
the BSU facade (named exactly "BSU" with no slug suffix), and any vendor or
Sniff directories that belong to the standard itself rather than project code.
Exclude everything that is not theme function/class source code.
Using exclude-pattern is more reliable cross-platform than include-pattern.
-->
<exclude-pattern>*/tests/*\.php$</exclude-pattern>
<exclude-pattern>*/crons/*\.php$</exclude-pattern>
<exclude-pattern>*/template-parts/*\.php$</exclude-pattern>
<exclude-pattern>*/template-*\.php$</exclude-pattern>
<exclude-pattern>*/templateincludes-*\.php$</exclude-pattern>
<exclude-pattern>*/blocks-component-panel-postmeta/*\.php$</exclude-pattern>
<exclude-pattern>*/blocks/*\.php$</exclude-pattern>
<exclude-pattern>*/functions/class-bsu\.php$</exclude-pattern>
<exclude-pattern>*/Sniffs/*\.php$</exclude-pattern>
<exclude-pattern>*/vendor/*\.php$</exclude-pattern>
Expand Down