Skip to content

chore: ignore Knip export findings for test-only consumers - #202

Open
DevJoaoLopes wants to merge 1 commit into
CopilotKit:mainfrom
DevJoaoLopes:chore/knip-production-test-exports
Open

DevJoaoLopes wants to merge 1 commit into
CopilotKit:mainfrom
DevJoaoLopes:chore/knip-production-test-exports

Conversation

@DevJoaoLopes

Copy link
Copy Markdown
Contributor

Summary

  • Add narrow ignoreIssues entries to knip.json: issue type exports only, for the 10 files whose remaining production findings are exports imported only by regression tests.
  • Document each entry in docs/knip.md: file, exports, consuming test, and when to remove it.

Refs #147. Follows #196 and #197.

This is the production-mode exports stage only. No source or test files change. Each of these exports is used by its own module and exported so a test can call it directly; default mode already counts the test imports, production mode does not. Deleting or un-exporting them would drop regression coverage, which #147 rules out.

Entries

File Exports used only by tests Test
src/browser/security.ts isPublicAddress tests/security.test.ts
src/client/SpaceLibrary.tsx pageExcerpt tests/library.test.ts
src/client/editor/markdown.ts markdownManager tests/markdown.test.ts
src/client/theme.ts resolveTheme tests/dark-theme.test.ts
src/server/connection-store.ts INTERRUPTED_ACTION_THRESHOLD_MS tests/connections.test.ts
src/server/connections.ts exposedTools, normalizeResult tests/connections.test.ts
src/server/headless.ts currentTurnText tests/headless.test.ts
src/server/parallel.ts sourcesFromResult tests/parallel.test.ts
src/server/research.ts requestedUrls tests/research.test.ts
src/server/slack-channel.ts slackIdentity, slackHandlers tests/slack-channel.test.ts

Trade-off: ignoreIssues applies in both modes, so a new unused export in one of these 10 files would not be reported. docs/knip.md says so and asks reviewers to check new exports there by hand. No other issue types, files or directories are ignored, and the entries add no configuration hints in default mode. Knip 6.41.0 does not emit configuration hints in production mode.

Knip

Category Default before Default after Production before Production after
Unused exports 0 0 12 0
Unused exported types 0 0 0 0
Unused devDependencies 0 0 0 0
Other categories 0 0 0 0

With #196, #197 and this PR, both npm run knip -- --treat-config-hints-as-errors and npm run knip:production -- --treat-config-hints-as-errors report nothing and exit 0, checked in a fresh checkout. No configuration hints in default mode. Knip 6.41.0 does not emit configuration hints in production mode. Blocking CI is left for the final stage.

Verification

Verified the exact commit in a fresh disposable checkout, without .env, dist or node_modules, on Node 24.22.1 / npm 11.21.1:

  • npm ci
  • npm run knip -- --no-exit-code and npm run knip:production -- --no-exit-code before build
  • npm run knip -- --treat-config-hints-as-errors: exit 0
  • npm run knip:production -- --treat-config-hints-as-errors: exit 0
  • npm run check-format
  • npm run lint
  • npm run typecheck
  • npm test: 355 tests across 56 files
  • npm run build

Not covered: no live application run was required for this configuration-and-docs change.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T18:21:45.068714Z ad4f451 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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