Skip to content

chore: clean up stale knip configuration hints#532

Merged
rhuanbarreto merged 1 commit into
mainfrom
chore/knip-config-cleanup
Jul 26, 2026
Merged

chore: clean up stale knip configuration hints#532
rhuanbarreto merged 1 commit into
mainfrom
chore/knip-config-cleanup

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

  • Removed ignoreDependencies/ignoreBinaries entries in knip.json that knip flagged as redundant (conventional-changelog, czg, oxfmt, oxlint, knip, tsc) — knip already resolves these correctly without the ignore rules.
  • Dropped the @internal tag from ClaudeSettingsSchema and VscodeSettingsSchema — both are already imported by their test files, so knip resolves them as used regardless of the tag.

Test plan

  • bun run knip — exit 0, no hints or issues
  • bun run cli check — 49/49 ADR rules pass
  • bun run lint / bun run typecheck / bun run format:check — all clean

Remove ignoreDependencies/ignoreBinaries entries knip flagged as
redundant (conventional-changelog, czg, oxfmt, oxlint, knip, tsc) --
knip already resolves these correctly without the ignore rules.

Drop the @internal tag from ClaudeSettingsSchema and
VscodeSettingsSchema: both are already imported by their test files,
so knip resolves them as used regardless of the tag.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 86039c45-606e-445c-8b48-99b752d5d332

📥 Commits

Reviewing files that changed from the base of the PR and between c7419b3 and 97a278d.

📒 Files selected for processing (3)
  • knip.json
  • src/helpers/claude-settings.ts
  • src/helpers/vscode-settings.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (10)
  • GitHub Check: Smoke Test (Windows) / Windows
  • GitHub Check: Lint, Test & Check
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (csharp)
  • GitHub Check: Cloudflare Pages
🧰 Additional context used
📓 Path-based instructions (8)
src/**/!(*platform).ts

📄 CodeRabbit inference engine (.archgate/adrs/ARCH-009-platform-detection-helper.md)

src/**/!(*platform).ts: In src/ TypeScript source files, do not read process.platform directly; use src/helpers/platform.ts (isWindows(), isMacOS(), isLinux(), isWSL(), getPlatformInfo()) for all platform detection.
Use the centralized platform helper instead of duplicating OS/WSL detection logic inline anywhere in src/ TypeScript source.
When behavior differs between Linux and Windows, account for WSL by using isWSL() rather than assuming `

Files:

  • src/helpers/vscode-settings.ts
  • src/helpers/claude-settings.ts
src/**/*.ts

📄 CodeRabbit inference engine (.archgate/adrs/ARCH-010-prefer-bun-built-in-json-parsing.md)

src/**/*.ts: Use await Bun.file(path).json() when reading JSON files in Bun TypeScript source code; do not use JSON.parse(await Bun.file(path).text()) or JSON.parse(fs.readFileSync(path, "utf-8")) for file reads.
Use Bun.JSONC.parse() when reading files that may contain comments, such as tsconfig.json, instead of plain JSON.parse() on file contents.
Reserve JSON.parse() for parsing JSON strings from non-file sources such as API responses or string variables; do not use it as the default for reading JSON files.

src/**/*.ts: Use exit codes 0 for success, 1 for expected failures, 2 for internal errors, and 130 for user cancellation; do not use other exit codes.
Use logError() from src/helpers/log.ts for user-facing errors; write errors to stderr, not stdout, and avoid direct console.error() calls.
Provide actionable suggestions in user-facing error messages whenever possible.
Do not show stack traces for user-triggered errors; unexpected errors may include stack traces only when DEBUG or TRACE is set.
Do not catch and swallow unexpected errors; caught errors must be logged or re-thrown.
Do not exit with code 0 when an operation fails; expected failures must use exit code 1.
Fall back to process.cwd() when findProjectRoot() returns null in commands that do not require .archgate/.
Handle Inquirer's ExitPromptError at the top-level error boundary as user cancellation: exit with code 130, do not log an error, and do not send it to Sentry.
Do not send UserError or user-cancellation ExitPromptError instances to Sentry from any error handler, including beforeSend.
Use exitWith() rather than bare process.exit() when terminating after command execution so telemetry and Sentry data are flushed.

src/**/*.ts: Use styleText(format, text) from node:util for all colored CLI output; do not use raw ANSI escape codes or third-party color libraries.
Commands producing structured results must support --json; JSON output must contain ...

Files:

  • src/helpers/vscode-settings.ts
  • src/helpers/claude-settings.ts
{src,tests}/**/*.ts

📄 CodeRabbit inference engine (.archgate/adrs/LEGAL-001-spdx-license-headers.md)

{src,tests}/**/*.ts: Every TypeScript source file in src/ and tests/ must begin with // SPDX-License-Identifier: Apache-2.0 followed by // Copyright 2026 Archgate.
If a TypeScript file has a shebang line (for example #!/usr/bin/env bun in src/cli.ts), the SPDX license header must appear immediately after the shebang.
Use single-line // comments for the SPDX header; do not use block comments (/* */) or alternate license identifiers.

Files:

  • src/helpers/vscode-settings.ts
  • src/helpers/claude-settings.ts
src/helpers/**/*.ts

📄 CodeRabbit inference engine (.archgate/adrs/ARCH-002-error-handling.md)

In helper files, use logInfo() or logWarn() instead of direct console.log(), console.warn(), or console.info() calls.

Files:

  • src/helpers/vscode-settings.ts
  • src/helpers/claude-settings.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.archgate/adrs/ARCH-006-dependency-policy.md)

**/*.{ts,tsx}: Prefer Bun built-ins for file I/O, HTTP, globbing, testing, and subprocess execution; prefer node: built-in modules over npm alternatives when appropriate.
Use Bun.spawn with array-based arguments for all subprocess execution; do not use Bun.$ because it can hang on Windows.
Do not add npm packages for functionality already provided by Bun, such as glob, chalk, or utility libraries used for a single function.
Use Bun APIs such as Bun.file() instead of Node.js-specific APIs such as fs.readFile() when Bun provides an equivalent.
Use relative imports with Bun's native module resolution; do not use TypeScript path aliases.

**/*.{ts,tsx}: Use TypeScript strict mode with ESNext and ES modules.
Prefer minimal dependencies and Bun built-ins where appropriate.

Files:

  • src/helpers/vscode-settings.ts
  • src/helpers/claude-settings.ts
**/*.{rules.ts,ts}

📄 CodeRabbit inference engine (.archgate/adrs/LEGAL-002-dependency-license-compatibility.md)

Newly encountered permissive licenses may be added to the LEGAL-002 allowlist in the rule implementation, with a comment explaining any override for packages whose package.json lacks a license field.

Files:

  • src/helpers/vscode-settings.ts
  • src/helpers/claude-settings.ts
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Run bun run validate successfully before considering any task complete; it performs linting, typechecking, formatting checks, tests, ADR checks, dead-export detection, and build checks.

Files:

  • src/helpers/vscode-settings.ts
  • src/helpers/claude-settings.ts
  • knip.json
**

⚙️ CodeRabbit configuration file

**: This project uses Archgate — an AI governance framework based on
Architecture Decision Records (ADRs). The ADRs in .archgate/adrs/
are the authoritative rules for this codebase. Each ADR has a companion
.rules.ts file with automated checks that run via archgate check.

When reviewing, you must:

  1. Treat ADR violations as blocking issues, not suggestions.
  2. Cite the specific ADR ID when flagging a violation (e.g., "Violates ARCH-006").
  3. Focus on semantic and contextual violations that automated rules cannot catch —
    the .rules.ts files already cover syntactic/structural patterns.
  4. If you are unsure whether something violates an ADR, flag it as a question
    rather than approving it.

Files:

  • src/helpers/vscode-settings.ts
  • src/helpers/claude-settings.ts
  • knip.json
🧠 Learnings (4)
📚 Learning: 2026-07-02T16:03:33.031Z
Learnt from: rhuanbarreto
Repo: archgate/cli PR: 446
File: src/helpers/session-context-opencode.ts:81-100
Timestamp: 2026-07-02T16:03:33.031Z
Learning: For synchronous helper functions that use Bun’s sqlite sync API (i.e., they must remain synchronous), it’s acceptable to use `existsSync` from `node:fs` to check whether the SQLite database file exists. Avoid using `Bun.file(path).exists()` for this purpose because it’s async and would force the helper to become async (no equivalent synchronous Bun alternative). If the DB file is missing, throw/return a clear, actionable "No database found" error (per ARCH-006) rather than letting the sqlite open fail with a generic DB-open error.

Applied to files:

  • src/helpers/vscode-settings.ts
  • src/helpers/claude-settings.ts
📚 Learning: 2026-07-25T00:05:58.884Z
Learnt from: rhuanbarreto
Repo: archgate/cli PR: 496
File: tests/helpers/auth.test.ts:38-46
Timestamp: 2026-07-25T00:05:58.884Z
Learning: When reviewing the Archgate CLI repository’s GEN-004 “concise forward-only narration” comments, don’t rely only on the automated phrase-based narration checks. Those checks can pass even when the comment wording describes historical/transfer semantics rather than current behavior (e.g., saying a prior restore “leaked” a value or a later subprocess “inherited it”). Manually verify that the comment describes the code’s current, forward behavior; flag or adjust comments that imply past/historical state transfer even if GEN-004 enforcement passes.

Applied to files:

  • src/helpers/vscode-settings.ts
  • src/helpers/claude-settings.ts
📚 Learning: 2026-07-25T00:05:59.109Z
Learnt from: rhuanbarreto
Repo: archgate/cli PR: 496
File: src/cli.ts:0-0
Timestamp: 2026-07-25T00:05:59.109Z
Learning: Code comments may include a concise issue/PR reference (per GEN-004) when it’s used to point readers to fuller rationale instead of inlining that rationale. During review, flag surrounding comment prose that reads like historical context or narrates refactors/relocations; a bare GEN-004-style reference is allowed and should not be flagged by itself.

Applied to files:

  • src/helpers/vscode-settings.ts
  • src/helpers/claude-settings.ts
📚 Learning: 2026-07-25T22:03:14.216Z
Learnt from: rhuanbarreto
Repo: archgate/cli PR: 501
File: .archgate/adrs/ARCH-002-error-handling.md:0-0
Timestamp: 2026-07-25T22:03:14.216Z
Learning: In Archgate boundary-wrapped CLI command actions (the handlers that rely on `handleCommandError()` for user-facing error output), expected-failure guards should signal user errors by throwing `new UserError(<message/details>)` rather than directly calling `logError()` followed by `exitWith(1)`. This keeps user-facing logging and the exit path centralized in `handleCommandError()`. For normal/computed command outcomes (e.g., `const exitCode = getExitCode(await runChecks(...))`), use `await exitWith(exitCode)` instead of calling `process.exit(exitCode)` so telemetry/Sentry flushing and outcome tagging still run.

Applied to files:

  • src/helpers/vscode-settings.ts
  • src/helpers/claude-settings.ts
🔇 Additional comments (3)
knip.json (1)

9-9: LGTM!

src/helpers/claude-settings.ts (1)

15-15: LGTM!

src/helpers/vscode-settings.ts (1)

16-16: LGTM!


📝 Walkthrough

Walkthrough

The Knip configuration now ignores only conventional-changelog-angular among the listed dependencies and no longer includes the previous ignored-binaries block. Documentation for the exported Claude and VS Code settings testing entities no longer uses the @internal annotation. No runtime logic or public signatures changed.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title concisely reflects the main change: cleaning up stale Knip configuration hints.
Description check ✅ Passed The description accurately summarizes the Knip cleanup and the testing performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 97a278d
Status: ✅  Deploy successful!
Preview URL: https://2074846f.archgate-cli.pages.dev
Branch Preview URL: https://chore-knip-config-cleanup.archgate-cli.pages.dev

View logs

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Metric Value
Lines 91.3% (8354 / 9155)
Threshold 90% minimum — met
Platforms Linux + Windows

Full HTML report available in workflow artifacts.

Per-directory breakdown
Directory Coverage Lines
src/commands/ 88.7% 1966 / 2216
src/engine/ 93.8% 2230 / 2378
src/formats/ 98.7% 148 / 150
src/helpers/ 90.9% 4010 / 4411

@rhuanbarreto
rhuanbarreto merged commit 2b20d69 into main Jul 26, 2026
22 checks passed
@rhuanbarreto
rhuanbarreto deleted the chore/knip-config-cleanup branch July 26, 2026 12:34
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