Fix WordPress Coding Standards CI check#97
Draft
apermo wants to merge 3 commits into
Draft
Conversation
Replace two `else { if (...) }` blocks with `elseif` in the
repository and auto-update columns of render_table_row(). This
resolves the Universal.ControlStructures.DisallowLonelyIf errors
and removes the misplaced phpcs:ignore comments that never took
effect (they sat on the `if` line while the sniff reports on the
`else`). Behaviour is unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a project .phpcs.xml.dist that extends the WordPress standard and excludes WordPress.Files.FileName.InvalidClassFileName, since the plugin ships as a single bootstrap file named after the plugin and cannot be renamed to class-*.php. Also configures the text domain and global prefixes. Point the CI WPCS step at the ruleset and exclude the ruleset file from the distributed plugin zip via .distignore. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 tasks
Plugin Check scans the raw repo checkout, so it flags .wp-env.json and .phpcs.xml.dist as hidden/application files (.dist is a flagged extension). Both are development-only files already excluded from the distributed plugin via .distignore, so exclude them from the check. Resolves the hidden_files and application_files errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the WordPress Coding Standards and Plugin Check CI jobs pass.
Coding Standards (3 errors)
.phpcs.xml.distruleset that extends theWordPressstandard and excludes
WordPress.Files.FileName.InvalidClassFileName.The plugin ships as a single bootstrap file named after the plugin
(
rt-plugin-report.php); renaming it toclass-*.phpwould break theentry point, so this sniff does not apply. The ruleset also configures
the text domain (
plugin-report) and global prefixes.standard: .phpcs.xml.dist)..phpcs.xml.distfrom the distributed plugin zip via.distignore.else { if (...) }blocks inrender_table_row()toelseif, resolvingUniversal.ControlStructures.DisallowLonelyIf. Thisalso removes the two
// phpcs:ignorecomments that never took effect —they were placed on the
ifline, but the sniff reports the violation onthe
elseline above. Behaviour is unchanged.Plugin Check (hidden_files / application_files errors)
Plugin Check scans the raw repo checkout, so it flagged
.wp-env.jsonand.phpcs.xml.distas hidden/application files (.distis a flaggedextension). Both are development-only files already excluded from the
distributed plugin via
.distignore, so the Plugin Check step now excludesthem with
exclude-files. OnlyERROR-type results fail the action, so theremaining warnings (restricted term "plugin" in the name/slug, the
RT_Plugin_Reportprefix, auto-update detection,.githubdirectory) arenon-blocking and left untouched — they reflect the established, published
plugin and aren't introduced here.
This branch is cut from current
develop. Several other open PRs touchrt-plugin-report.php(e.g. #92). Please rebase this branch once those aremerged so the
elseifrefactor applies on top of the final line numbers andavoids conflicts. Kept as a draft until then.
Disclosure
Claude (Anthropic) assisted with diagnosing the CI failures and preparing this
change. I (the human author) reviewed it and take responsibility for the
contribution.