Skip to content

Commit 3e6f03c

Browse files
Fix release lint formatting (#780)
Co-authored-by: homeboy-ci[bot] <266378653+homeboy-ci[bot]@users.noreply.github.com>
1 parent 6a67c0d commit 3e6f03c

5 files changed

Lines changed: 37 additions & 37 deletions

File tree

inc/Cleanup/CleanupRemainingWorkSummary.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class CleanupRemainingWorkSummary {
1313

1414

1515

16-
private const EXAMPLE_LIMIT = 3;
16+
private const EXAMPLE_LIMIT = 3;
1717
private const METADATA_RECONCILE_COMMAND = 'studio wp datamachine-code workspace worktree reconcile-metadata --dry-run --limit=25 --offset=0 --until-budget=30s --format=json';
1818

1919
/**

inc/CodeTask/CodeTaskCreator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function create( EvidencePacket $packet, array $args = array() ): array|\
122122
* @return array{slug:string,name:string,url:string}|\WP_Error
123123
*/
124124
public static function resolve_repo( string $repo ): array|\WP_Error {
125-
$repo = trim($repo);
125+
$repo = trim($repo);
126126
$descriptor = GitHubRemote::descriptor($repo);
127127
if ( null !== $descriptor ) {
128128
$slug = $descriptor['slug'];

inc/Workspace/WorkspaceMutationLock.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public static function status( string $workspace_path ): array {
195195
*/
196196
public static function prune_stale( string $workspace_path, bool $dry_run = false ): array {
197197
$before = self::status($workspace_path);
198-
$protected = self::active_filesystem_lock_keys((array) ( $before['filesystem'] ?? array() ));
198+
$protected = self::active_filesystem_lock_keys( (array) ( $before['filesystem'] ?? array() ) );
199199
$db_pruned = $dry_run ? array(
200200
'dry_run' => true,
201201
'protected_active' => count($protected),
@@ -282,24 +282,24 @@ private static function stale_lock_report( array $database, array $filesystem ):
282282
$live_flock_present = in_array($lock_key, $active_filesystem_keys, true);
283283
$owner_context = (array) ( $lock['metadata']['owner_context'] ?? array() );
284284
$database_rows[] = array(
285-
'source' => 'database',
286-
'lock_key' => $lock_key,
287-
'scope' => (string) ( $lock['scope'] ?? '' ),
288-
'state' => 'stale',
289-
'owner' => (string) ( $lock['owner'] ?? '' ),
290-
'session' => self::owner_context_session_id($owner_context),
291-
'run_id' => (string) ( $lock['run_id'] ?? '' ),
292-
'job_id' => $lock['job_id'] ?? null,
293-
'acquired_at' => (string) ( $lock['acquired_at'] ?? '' ),
294-
'heartbeat_at' => (string) ( $lock['heartbeat_at'] ?? '' ),
295-
'expires_at' => (string) ( $lock['expires_at'] ?? '' ),
296-
'age_seconds' => $lock['age_seconds'] ?? null,
297-
'heartbeat_age_seconds' => $lock['heartbeat_age_seconds'] ?? null,
298-
'expires_age_seconds' => $lock['expires_age_seconds'] ?? null,
299-
'live_flock_present' => $live_flock_present,
300-
'safe_to_prune' => ! $live_flock_present,
301-
'preview_command' => 'wp datamachine-code workspace worktree locks --prune-stale --dry-run --format=json',
302-
'apply_command' => 'wp datamachine-code workspace worktree locks --prune-stale --format=json',
285+
'source' => 'database',
286+
'lock_key' => $lock_key,
287+
'scope' => (string) ( $lock['scope'] ?? '' ),
288+
'state' => 'stale',
289+
'owner' => (string) ( $lock['owner'] ?? '' ),
290+
'session' => self::owner_context_session_id($owner_context),
291+
'run_id' => (string) ( $lock['run_id'] ?? '' ),
292+
'job_id' => $lock['job_id'] ?? null,
293+
'acquired_at' => (string) ( $lock['acquired_at'] ?? '' ),
294+
'heartbeat_at' => (string) ( $lock['heartbeat_at'] ?? '' ),
295+
'expires_at' => (string) ( $lock['expires_at'] ?? '' ),
296+
'age_seconds' => $lock['age_seconds'] ?? null,
297+
'heartbeat_age_seconds' => $lock['heartbeat_age_seconds'] ?? null,
298+
'expires_age_seconds' => $lock['expires_age_seconds'] ?? null,
299+
'live_flock_present' => $live_flock_present,
300+
'safe_to_prune' => ! $live_flock_present,
301+
'preview_command' => 'wp datamachine-code workspace worktree locks --prune-stale --dry-run --format=json',
302+
'apply_command' => 'wp datamachine-code workspace worktree locks --prune-stale --format=json',
303303
'active_lock_refusal_note' => $live_flock_present ? 'Matching filesystem lock has a live flock; DB row is reported but protected from stale pruning.' : '',
304304
);
305305
}

inc/Workspace/WorkspaceRowTriage.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ public function workspace_row_triage_list( array $opts = array() ): array|\WP_Er
3434
$rows = array_merge($this->workspace_top_level_triage_rows(), $this->workspace_external_worktree_triage_rows());
3535

3636
if ( '' !== $status_filter ) {
37-
$rows = array_values(array_filter($rows, static fn( array $row ): bool => $status_filter === (string) ( $row['triage_status'] ?? '' )));
37+
$rows = array_values(array_filter($rows, static fn( array $row ): bool => (string) ( $row['triage_status'] ?? '' ) === $status_filter));
3838
} elseif ( ! $include_resolved ) {
3939
$rows = array_values(array_filter($rows, static fn( array $row ): bool => 'unresolved' === (string) ( $row['triage_status'] ?? '' )));
4040
}
4141

4242
usort(
4343
$rows,
4444
static function ( array $a, array $b ): int {
45-
$status_cmp = strcmp((string) ( $a['triage_status'] ?? '' ), (string) ( $b['triage_status'] ?? '' ));
46-
return 0 !== $status_cmp ? $status_cmp : strcmp((string) ( $a['row_id'] ?? '' ), (string) ( $b['row_id'] ?? '' ));
45+
$status_cmp = strcmp( (string) ( $a['triage_status'] ?? '' ), (string) ( $b['triage_status'] ?? '' ) );
46+
return 0 !== $status_cmp ? $status_cmp : strcmp( (string) ( $a['row_id'] ?? '' ), (string) ( $b['row_id'] ?? '' ) );
4747
}
4848
);
4949

@@ -104,7 +104,7 @@ public function workspace_row_triage_mark( string $row_id, string $status, strin
104104
$metadata['triage_created_at'] = $now;
105105
}
106106

107-
WorktreeContextInjector::store_lifecycle_metadata((string) ( $row['metadata_key'] ?? $row_id ), $metadata);
107+
WorktreeContextInjector::store_lifecycle_metadata( (string) ( $row['metadata_key'] ?? $row_id ), $metadata );
108108

109109
$updated = $this->workspace_row_triage_find($row_id, true);
110110
if ( is_wp_error($updated) ) {
@@ -145,7 +145,7 @@ public function workspace_row_triage_adopt( string $row_id, ?string $name = null
145145
return new \WP_Error('triage_adopt_linked_worktree_unsupported', 'Linked worktree rows cannot be adopted as primary checkouts.', array( 'status' => 400 ));
146146
}
147147

148-
$adopt = $this->adopt_repo((string) ( $row['path'] ?? '' ), $name);
148+
$adopt = $this->adopt_repo( (string) ( $row['path'] ?? '' ), $name );
149149
if ( is_wp_error($adopt) ) {
150150
return $adopt;
151151
}
@@ -346,7 +346,7 @@ private function workspace_row_triage_normalize_row( array $row ): array {
346346
$triage_status = $this->workspace_row_triage_status_from_metadata($metadata);
347347

348348
$created_at = isset($metadata['created_at']) ? (string) $metadata['created_at'] : null;
349-
$mtime = @filemtime((string) ( $row['path'] ?? '' )); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- Best-effort provenance for local workspace rows.
349+
$mtime = @filemtime( (string) ( $row['path'] ?? '' ) ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- Best-effort provenance for local workspace rows.
350350
if ( null === $created_at && false !== $mtime ) {
351351
$created_at = gmdate('c', $mtime);
352352
}
@@ -409,7 +409,7 @@ private function workspace_row_triage_find( string $row_id, bool $include_resolv
409409
}
410410

411411
foreach ( (array) ( $result['rows'] ?? array() ) as $row ) {
412-
if ( $row_id === (string) ( $row['row_id'] ?? '' ) ) {
412+
if ( (string) ( $row['row_id'] ?? '' ) === $row_id ) {
413413
return $row;
414414
}
415415
}
@@ -425,15 +425,15 @@ private function workspace_row_triage_find( string $row_id, bool $include_resolv
425425
*/
426426
private function workspace_row_triage_summary( array $rows ): array {
427427
$summary = array(
428-
'total' => count($rows),
429-
'unresolved' => 0,
430-
'ignored' => 0,
431-
'quarantined' => 0,
432-
'adopted' => 0,
433-
'external_worktree' => 0,
428+
'total' => count($rows),
429+
'unresolved' => 0,
430+
'ignored' => 0,
431+
'quarantined' => 0,
432+
'adopted' => 0,
433+
'external_worktree' => 0,
434434
'noncanonical_handle' => 0,
435-
'non_git' => 0,
436-
'by_issue' => array(),
435+
'non_git' => 0,
436+
'by_issue' => array(),
437437
);
438438

439439
foreach ( $rows as $row ) {

inc/Workspace/WorktreeCleanupClassifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public static function buckets( int $candidate_count, array $candidates_by_signa
143143
$buckets['metadata_reconciliation_candidates'] = (int) ( $skipped_by_reason['needs_metadata_reconcile'] ?? 0 ) + (int) ( $skipped_by_reason['requires_full_scan'] ?? 0 ) + (int) ( $skipped_by_reason['missing_metadata'] ?? 0 );
144144
$buckets['dirty_unpushed'] = $buckets[ self::BUCKET_BLOCKED_BY_DIRTY_OR_UNPUSHED ];
145145
$buckets['active_no_signal'] = (int) ( $skipped_by_reason['active_no_signal'] ?? 0 ) + (int) ( $skipped_by_reason['no_inventory_cleanup_signal'] ?? 0 );
146-
$buckets['intentional_triage'] = (int) ( $skipped_by_reason['triage_ignored'] ?? 0 ) + (int) ( $skipped_by_reason['triage_quarantined'] ?? 0 );
146+
$buckets['intentional_triage'] = (int) ( $skipped_by_reason['triage_ignored'] ?? 0 ) + (int) ( $skipped_by_reason['triage_quarantined'] ?? 0 );
147147

148148
ksort($buckets);
149149
return $buckets;

0 commit comments

Comments
 (0)