Skip to content

fix(lint): split runtime-file-read-client under the max-lines cap - #34930

Closed
nwparker wants to merge 1 commit into
mainfrom
nwparker/fix-lint-runtime-file-read-client-split
Closed

nwparker wants to merge 1 commit into
mainfrom
nwparker/fix-lint-runtime-file-read-client-split

Conversation

@nwparker

@nwparker nwparker commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​101 $\color{#cf222e}{\Huge{\mathbf{−}}}$​92 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​9

ELI5

The lint check fails on main because one file grew past the 300-line limit. This PR moves one self-contained group of functions into its own file. Nothing the app does changes.

What Changed

  • The three helpers behind remote file downloads (remoteChunkedDownloadAvailable, readRemoteDownloadChunk, downloadRemoteFileViaPreview), along with their constants and the private isUnsupportedRemotePreviewDownload check, moved from runtime-file-read-client.ts to a new sibling file, runtime-remote-file-download.ts. The code was moved, not changed.
  • runtime-file-read-client.ts now imports these helpers and is down to 241 lines. Its exports haven't changed, so no importer needs an update.

Why

main started failing the max-lines lint rule (runtime-file-read-client.ts: File has too many lines (304)) after two changes to this file landed one after the other. Every PR's static-analysis job fails as a result. The remote-download helpers are the most self-contained piece of the file: only downloadRuntimeFile uses them, and they don't depend on the read and preview paths. That makes them the cleanest split, and it avoids a max-lines disable, which the repo rules forbid.

Linked Issue

N/A. This fixes a lint failure on main.

Visual Proof

N/A. No UI change.

Testing

  • pnpm tc and pnpm run typecheck:ci pass.
  • pnpm exec oxlint src/renderer/src/runtime passes, and so do the anti-slop lint, the ast-grep gates, check:process-host-imports and check:code-quality:changed.
  • runtime-file-client.test.ts, runtime-file-client-download.test.ts, runtime-paged-file-read.test.ts, remote-host-file-open-repro.test.ts and runtime-terminal-artifact-read.test.ts pass (49 tests).

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

The moved code is the same, so security, cross-platform, SSH/remote, mobile, compatibility and performance behave exactly as before.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Move the remote chunked-download helpers into runtime-remote-file-download.ts so
runtime-file-read-client.ts is back under the 300-line lint cap. No behaviour change.
@nwparker

Copy link
Copy Markdown
Contributor Author

folded into #34929

@nwparker nwparker closed this Oct 28, 2026
@nwparker
nwparker deleted the nwparker/fix-lint-runtime-file-read-client-split branch October 28, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant