Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/knip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Knip

on:
pull_request:
branches: [main]
workflow_dispatch:

jobs:
knip:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Missing job-level timeout

Without a timeout-minutes on the job, a hung pnpm install or Knip run could hold a GitHub-hosted runner for up to the platform default (6 hours). Adding a budget (e.g. timeout-minutes: 15) keeps the queue healthy and surfaces real hangs quickly.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/knip.yml
Line: 9

Comment:
**Missing job-level timeout**

Without a `timeout-minutes` on the job, a hung `pnpm install` or Knip run could hold a GitHub-hosted runner for up to the platform default (6 hours). Adding a budget (e.g. `timeout-minutes: 15`) keeps the queue healthy and surfaces real hangs quickly.

How can I resolve this? If you propose a fix, please make it concise.

runs-on: ubuntu-latest
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: '1'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.28.2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'pnpm'

- name: Install dependencies
run: |
for attempt in 1 2 3; do
pnpm install --frozen-lockfile --ignore-scripts && break
if [ "$attempt" -eq 3 ]; then
echo "pnpm install failed after 3 attempts"
exit 1
fi
echo "Install failed (attempt $attempt). Retrying in 10s..."
sleep 10
done

- name: Run knip dry run
# Report-only while the Knip configuration matures: surface annotations
# without blocking PRs on false positives.
run: pnpm exec knip --reporter github-actions --no-exit-code --no-config-hints
54 changes: 54 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"$schema": "https://unpkg.com/knip@6/schema.json",
"entry": [
"src/main/index.ts",
"src/preload/index.ts",
"src/renderer/main.tsx",
"src/renderer/index.html",
"src/renderer/index.css",
"scripts/release/*.ts",
"electron.vite.config.ts",
"electron-builder.config.ts",
"electron-builder.canary.config.ts",
"src/**/*.test.{ts,tsx}",
"src/renderer/tests/browser/**/*.test.{ts,tsx}"
],
"project": ["src/**/*.{ts,tsx}", "scripts/**/*.ts"],
"ignore": ["**/_*/**", "src/renderer/_legacy/**", "src/renderer/lib/ui/**"],
"ignoreFiles": [
"src/renderer/features/tasks/components/lifecycleStatusIndicator.tsx",
"src/renderer/features/tasks/diff-view/main-panel/stacked-diff-view.tsx",
"src/renderer/features/tasks/diff-view/stores/diff-selectors.ts",
"src/renderer/features/tasks/diff-view/stores/stacked-diff-panel-store.ts",
"src/renderer/features/tasks/editor/stores/editor-selectors.ts"
],
"ignoreDependencies": [
"@types/.+",
"postcss",
"lint-staged",
"@vitest/browser",
"vitest-browser-react",
"concurrently",
"@dnd-kit/react",
"@isaacs/brace-expansion",
"@radix-ui/.+",
"@xterm/addon-fit",
"chokidar",
"fix-path",
"minimatch",
"react-icons",
"react-window",
"streamdown",
"tsconfig-paths"
],
"ignoreExportsUsedInFile": true,
"rules": {
"duplicates": "warn",
"exports": "warn",
"types": "warn",
"unlisted": "warn"
},
"eslint": {
"config": ["eslint.config.ts"]
}
}
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"clean": "rm -rf node_modules dist",
"reset": "pnpm run clean && pnpm install",
"lint": "eslint . --cache --cache-strategy content --cache-location node_modules/.cache/eslint/.eslintcache",
"knip": "knip",
"format": "prettier --write .",
"format:check": "prettier --check .",
"typecheck": "tsc --noEmit && tsc --noEmit -p scripts/release/tsconfig.json",
Expand Down Expand Up @@ -73,8 +74,10 @@
"electron-vite": "^5.0.0",
"eslint": "^9.0.0",
"eslint-plugin-react-hooks": "^7.0.0",
"globals": "14.0.0",
"husky": "^9.1.7",
"jsdom": "^29.0.2",
"knip": "^6.12.2",
"lint-staged": "^16.3.0",
"postcss": "^8.4.32",
"prettier": "3.6.2",
Expand All @@ -99,6 +102,7 @@
"@llamaduck/forgejo-ts": "^14.0.3",
"@monaco-editor/react": "^4.7.0",
"@octokit/auth-oauth-device": "^8.0.3",
"@octokit/request-error": "7.1.0",
"@octokit/rest": "^22.0.1",
"@parcel/watcher": "^2.5.6",
"@radix-ui/react-accordion": "^1.2.12",
Expand Down Expand Up @@ -134,6 +138,7 @@
"@xterm/addon-web-links": "^0.12.0",
"@xterm/xterm": "^6.0.0",
"allotment": "^1.20.5",
"axios": "1.14.0",
"better-sqlite3": "^12.6.0",
"chokidar": "^5.0.0",
"class-variance-authority": "^0.7.1",
Expand Down
Loading
Loading