fix: remove unused imports and variables flagged by CodeQL
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { describe, expect, test, mock, beforeEach } from 'bun:test'
|
import { describe, expect, test } from 'bun:test'
|
||||||
|
|
||||||
// The feature() function from bun:bundle is shimmed at build time.
|
// The feature() function from bun:bundle is shimmed at build time.
|
||||||
// In tests, it's not available, so we test the getRepoMapContext logic
|
// In tests, it's not available, so we test the getRepoMapContext logic
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { execFile } from 'child_process'
|
import { execFile } from 'child_process'
|
||||||
import { readdirSync, statSync } from 'fs'
|
import { readdirSync } from 'fs'
|
||||||
import { join, relative } from 'path'
|
import { join, relative } from 'path'
|
||||||
import type { SupportedLanguage } from './types.js'
|
import type { SupportedLanguage } from './types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,6 @@ export function rankFiles(
|
|||||||
): RankedFile[] {
|
): RankedFile[] {
|
||||||
if (graph.order === 0) return []
|
if (graph.order === 0) return []
|
||||||
|
|
||||||
// Build personalization vector
|
|
||||||
const focusSet = new Set(focusFiles)
|
|
||||||
const hasPersonalization = focusFiles.length > 0
|
const hasPersonalization = focusFiles.length > 0
|
||||||
|
|
||||||
// graphology-pagerank accepts getEdgeWeight option
|
// graphology-pagerank accepts getEdgeWeight option
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { afterEach, beforeAll, describe, expect, test } from 'bun:test'
|
import { afterEach, beforeAll, describe, expect, test } from 'bun:test'
|
||||||
import { cpSync, existsSync, mkdirSync, mkdtempSync, rmSync, utimesSync, writeFileSync } from 'fs'
|
import { cpSync, mkdtempSync, rmSync, utimesSync, writeFileSync } from 'fs'
|
||||||
import { tmpdir } from 'os'
|
import { tmpdir } from 'os'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { invalidateCache, buildRepoMap } from './index.js'
|
import { invalidateCache, buildRepoMap } from './index.js'
|
||||||
@@ -134,7 +134,6 @@ describe('renderer', () => {
|
|||||||
|
|
||||||
// Every file header in the output should have its signatures listed
|
// Every file header in the output should have its signatures listed
|
||||||
for (const header of fileHeaders) {
|
for (const header of fileHeaders) {
|
||||||
const fileName = header.slice(0, -1) // remove trailing ':'
|
|
||||||
// The file must have at least one signature line after it
|
// The file must have at least one signature line after it
|
||||||
const headerIdx = result.map.indexOf(header)
|
const headerIdx = result.map.indexOf(header)
|
||||||
const afterHeader = result.map.slice(headerIdx + header.length)
|
const afterHeader = result.map.slice(headerIdx + header.length)
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { afterEach, beforeAll, describe, expect, test } from 'bun:test'
|
import { beforeAll, describe, expect, test } from 'bun:test'
|
||||||
import { cpSync, mkdtempSync, rmSync, writeFileSync } from 'fs'
|
import { cpSync, mkdtempSync, rmSync } from 'fs'
|
||||||
import { tmpdir } from 'os'
|
import { tmpdir } from 'os'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { z } from 'zod/v4'
|
|
||||||
import { initParser } from '../../context/repoMap/parser.js'
|
import { initParser } from '../../context/repoMap/parser.js'
|
||||||
import { invalidateCache } from '../../context/repoMap/index.js'
|
import { invalidateCache } from '../../context/repoMap/index.js'
|
||||||
import { RepoMapTool } from './RepoMapTool.js'
|
import { RepoMapTool } from './RepoMapTool.js'
|
||||||
@@ -29,24 +28,6 @@ beforeAll(async () => {
|
|||||||
await initParser()
|
await initParser()
|
||||||
})
|
})
|
||||||
|
|
||||||
// Minimal context stub for tool.call
|
|
||||||
function makeContext(root: string) {
|
|
||||||
// Patch getCwd to return our test root
|
|
||||||
process.env.__TEST_CWD_OVERRIDE = root
|
|
||||||
return {
|
|
||||||
abortController: new AbortController(),
|
|
||||||
getAppState: () => ({
|
|
||||||
toolPermissionContext: {
|
|
||||||
mode: 'default' as const,
|
|
||||||
additionalWorkingDirectories: new Map(),
|
|
||||||
alwaysAllowRules: {},
|
|
||||||
alwaysDenyRules: {},
|
|
||||||
alwaysAskRules: {},
|
|
||||||
isBypassPermissionsModeAvailable: false,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
} as any
|
|
||||||
}
|
|
||||||
|
|
||||||
describe('RepoMapTool schema', () => {
|
describe('RepoMapTool schema', () => {
|
||||||
test('validates a minimal input {}', () => {
|
test('validates a minimal input {}', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user