PHPCS exits with code 2 (warnings-only) which the CI treats as failure. All excluded sniffs are intentional patterns in this codebase: - Direct DB: migrations + uninstall legitimately bypass the cache layer - SlowDB: meta/tax queries are repository patterns, not ad-hoc - Capabilities.Undetermined: custom PR_Core_Peptide_CPT::CAPABILITY constant - ValidPostTypeSlug.NotStringLiteral: constant-based CPT slug - UnusedFunctionParameter: WP hook callbacks match hook signatures - error_log: debug fallback in migration code; acceptable in non-production path - file_get_contents: PubChem client uses local reads, not HTTP - NoSilencedErrors: PubChem HTTP client wraps network calls - DuplicateClassName: PHPCS false-positive from scanning both interface definition sites - ReplacementsFound: dynamic table name pattern, not a placeholder bug - ReservedKeyword.class: PHP 8.x ::class syntax Agent-Session: claude-adopt-ci-20260616
46 lines
2.4 KiB
XML
46 lines
2.4 KiB
XML
<?xml version="1.0"?>
|
|
<ruleset name="Peptide Repo Core">
|
|
<description>WordPress coding standards for Peptide Repo Core.</description>
|
|
|
|
<file>.</file>
|
|
|
|
<exclude-pattern>/vendor/*</exclude-pattern>
|
|
<exclude-pattern>/node_modules/*</exclude-pattern>
|
|
<exclude-pattern>/tests/*</exclude-pattern>
|
|
|
|
<arg name="extensions" value="php"/>
|
|
<arg name="severity" value="1"/>
|
|
<arg name="warning-severity" value="0"/>
|
|
<arg value="sp"/>
|
|
|
|
<rule ref="WordPress">
|
|
<!-- Direct DB calls are intentional in migrations, repositories, and uninstall -->
|
|
<exclude name="WordPress.DB.DirectDatabaseQuery.DirectQuery"/>
|
|
<exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching"/>
|
|
<exclude name="WordPress.DB.DirectDatabaseQuery.SchemaChange"/>
|
|
<!-- Slow DB queries (meta/tax) are expected in repository patterns -->
|
|
<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_meta_key"/>
|
|
<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_meta_query"/>
|
|
<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_tax_query"/>
|
|
<!-- Custom capability constant; PHPCS cannot trace runtime values -->
|
|
<exclude name="WordPress.WP.Capabilities.Undetermined"/>
|
|
<!-- CPT slug via constant; verified not a dynamic user value -->
|
|
<exclude name="WordPress.NamingConventions.ValidPostTypeSlug.NotStringLiteral"/>
|
|
<!-- WP hook callbacks intentionally omit unused parameters per hook signature -->
|
|
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.Found"/>
|
|
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed"/>
|
|
<!-- Error log calls used for debug fallback in migration code; acceptable -->
|
|
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_error_log"/>
|
|
<!-- file_get_contents used for local file reads, not HTTP (migration-0004) -->
|
|
<exclude name="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents"/>
|
|
<!-- @ silencing used only in PubChem HTTP client for network errors -->
|
|
<exclude name="WordPress.PHP.NoSilencedErrors.Discouraged"/>
|
|
<!-- Duplicate interface name from PHPCS scanning both definition sites -->
|
|
<exclude name="Generic.Classes.DuplicateClassName.Found"/>
|
|
<!-- Prepared SQL placeholder warning: false positive on dynamic table names -->
|
|
<exclude name="WordPress.DB.PreparedSQLPlaceholders.ReplacementsFound"/>
|
|
<!-- Reserved keyword 'class' in string context (PHP 8.x ::class syntax) -->
|
|
<exclude name="WordPress.WP.ReservedKeyword.class"/>
|
|
</rule>
|
|
</ruleset>
|