Skip to content

chore(lint): clean up 34 pre-existing phpcs errors blocking clean releases on main #419

@chubes4

Description

@chubes4

Summary

main has accumulated 34 phpcs errors (plus 593 warnings) that have been failing the homeboy / Lint CI check on every push for several weeks. Releases currently require --skip-checks to bypass the lint gate. This is tech debt, not blockers — none of the errors are functional bugs — but they hide real regressions when they finally do appear.

Recent PRs (#413, #418) successfully passed their own lint gate after the layer-purity work flagged new errors and fixed them. The remaining 34 are all in workspace lifecycle code that's been refactored multiple times without lint cleanup riding along.

Per-file breakdown (current main)

```
7: inc/Workspace/WorkspaceLockStore.php
5: inc/Workspace/CleanupRunService.php
4: inc/Storage/CleanupRunRepository.php
3: inc/Workspace/WorkspaceMutationLock.php
2: inc/Workspace/WorkspaceWorktreeLifecycle.php
1: inc/Workspace/WorkspaceCleanupPlan.php
1: inc/Runtime/WordPressRuntimeInspector.php
1: inc/Bundle/WorkspacePreloadArtifact.php
1: inc/Workspace/WorkspaceHygieneReport.php
1: inc/Cleanup/DataMachineJobCleanupRunEvidenceStore.php
1: inc/Workspace/WorktreeContextInjector.php
1: inc/Workspace/WorkspaceWorktreeEmergencyCleanup.php
1: inc/Workspace/WorkspaceMetadataReconciliation.php
1: inc/Storage/WorktreeInventoryRepository.php
1: inc/Handlers/GitHub/GitHub.php
1: inc/Workspace/WorkspaceArtifactCleanup.php
1: inc/Workspace/WorkspaceRepositoryLifecycle.php
1: inc/Workspace/WorkspaceWorktreeInventoryCleanup.php
```

Most are formatting errors:

  • Generic.Formatting.MultipleStatementAlignment.NotSameWarning (equals-sign alignment)
  • PSR2.Classes.ClassDeclaration.CloseBraceAfterBody (trait/class brace placement)
  • WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
  • WordPress.PHP.YodaConditions.NotYoda

Likely all fixable with phpcbf (the auto-fixer) plus a small handful of manual cleanups.

Why this matters

  1. homeboy release currently requires --skip-checks. Every release this session (DMC v0.44.0, v0.45.0, v0.45.1) was forced through. Future releases need the same dance.
  2. CI on main has been red for weeks. Real regressions get lost in the noise — when something genuinely breaks, nobody notices because the badge was already red.
  3. PR lint diffs are confusing. New PRs see "627 findings" and have to manually filter out the pre-existing 593 warnings + 34 errors to find their own contribution.

Approach

  1. Run phpcbf on the affected files. Capture the diff.
  2. Hand-review any remaining errors (Yoda conditions etc. that phpcbf may not auto-fix).
  3. Verify the smoke tests still pass after formatting changes.
  4. Open a chore(lint): clean up pre-existing phpcs errors PR. This is a one-shot cleanup, not behavior changes.

Acceptance criteria

  • homeboy lint data-machine-code returns zero errors (warnings OK if reducing them would balloon the PR scope).
  • homeboy release data-machine-code succeeds without --skip-checks.
  • No behavior changes — pure formatting / Yoda / array-spacing cleanup.
  • No tests broken (smoke tests + unit tests must continue passing).

Out of scope

  • Cleanup of pre-existing 593 warnings (target them in a follow-up if you want to push further).
  • Any refactor beyond what phpcbf and minimal hand-edits require.
  • Test infrastructure debt (separate issue — see DM #XXX WP_Agent_Token_Store bootstrap failure on Playground CI).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions