Skip to content

Commit 9ce967b

Browse files
committed
Fix comment slop.
1 parent 76f98f6 commit 9ce967b

File tree

62 files changed

+46
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+46
-146
lines changed

src/api/providers/__tests__/gemini.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,14 @@ describe("GeminiHandler", () => {
194194

195195
it("should handle only input tokens", () => {
196196
const inputTokens = 5000
197-
// Added non-null assertion (!)
197+
198198
const expectedCost = (inputTokens / 1_000_000) * mockInfo.inputPrice!
199199
expect(handler.calculateCost({ info: mockInfo, inputTokens, outputTokens: 0 })).toBeCloseTo(expectedCost)
200200
})
201201

202202
it("should handle only output tokens", () => {
203203
const outputTokens = 15000
204-
// Added non-null assertion (!)
204+
205205
const expectedCost = (outputTokens / 1_000_000) * mockInfo.outputPrice!
206206
expect(handler.calculateCost({ info: mockInfo, inputTokens: 0, outputTokens })).toBeCloseTo(expectedCost)
207207
})
@@ -212,7 +212,6 @@ describe("GeminiHandler", () => {
212212
const cacheWriteTokens = 5000
213213
const CACHE_TTL = 5 // Match the constant in gemini.ts
214214

215-
// Added non-null assertions (!)
216215
const expectedInputCost = (inputTokens / 1_000_000) * mockInfo.inputPrice!
217216
const expectedOutputCost = (outputTokens / 1_000_000) * mockInfo.outputPrice!
218217
const expectedCacheWriteCost =
@@ -229,7 +228,7 @@ describe("GeminiHandler", () => {
229228
const cacheReadTokens = 8000 // Part of inputTokens read from cache
230229

231230
const uncachedReadTokens = inputTokens - cacheReadTokens
232-
// Added non-null assertions (!)
231+
233232
const expectedInputCost = (uncachedReadTokens / 1_000_000) * mockInfo.inputPrice!
234233
const expectedOutputCost = (outputTokens / 1_000_000) * mockInfo.outputPrice!
235234
const expectedCacheReadCost = mockInfo.cacheReadsPrice! * (cacheReadTokens / 1_000_000)

src/api/providers/__tests__/mistral.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe("MistralHandler", () => {
3838

3939
beforeEach(() => {
4040
mockOptions = {
41-
apiModelId: "codestral-latest", // Update to match the actual model ID
41+
apiModelId: "codestral-latest",
4242
mistralApiKey: "test-api-key",
4343
includeMaxTokens: true,
4444
modelTemperature: 0,

src/api/providers/deepseek.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { OpenAiHandler, OpenAiHandlerOptions } from "./openai"
22
import { deepSeekModels, deepSeekDefaultModelId, ModelInfo } from "../../shared/api"
3-
import { ApiStreamUsageChunk } from "../transform/stream" // Import for type
3+
import { ApiStreamUsageChunk } from "../transform/stream"
44
import { getModelParams } from "../index"
55

66
export class DeepSeekHandler extends OpenAiHandler {

src/api/transform/cache-strategy/__tests__/cache-strategy.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,6 @@ describe("Cache Strategy", () => {
10501050

10511051
// No new cache point should be added for the small addition
10521052
} finally {
1053-
// Restore original console.log
10541053
console.log = originalConsoleLog
10551054
}
10561055
})

src/api/transform/cache-strategy/base-strategy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export abstract class CacheStrategy {
3838
let tokenCount = words.length * 1.3
3939
// Add overhead for punctuation and special characters
4040
tokenCount += (text.match(/[.,!?;:()[\]{}""''`]/g) || []).length * 0.3
41-
// Add overhead for newlines
41+
4242
tokenCount += (text.match(/\n/g) || []).length * 0.5
4343
// Add a small overhead for system prompt structure
4444
tokenCount += 5
@@ -116,7 +116,7 @@ export abstract class CacheStrategy {
116116
totalTokens += words.length * 1.3
117117
// Add overhead for punctuation and special characters
118118
totalTokens += (text.match(/[.,!?;:()[\]{}""''`]/g) || []).length * 0.3
119-
// Add overhead for newlines
119+
120120
totalTokens += (text.match(/\n/g) || []).length * 0.5
121121
}
122122
} else if (block.type === "image") {
@@ -132,7 +132,7 @@ export abstract class CacheStrategy {
132132
totalTokens += words.length * 1.3
133133
// Add overhead for punctuation and special characters
134134
totalTokens += (text.match(/[.,!?;:()[\]{}""''`]/g) || []).length * 0.3
135-
// Add overhead for newlines
135+
136136
totalTokens += (text.match(/\n/g) || []).length * 0.5
137137
}
138138

src/core/Cline.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2169,7 +2169,6 @@ export class Cline extends EventEmitter<ClineEvents> {
21692169
const timeZoneOffsetStr = `${timeZoneOffset >= 0 ? "+" : "-"}${timeZoneOffsetHours}:${timeZoneOffsetMinutes.toString().padStart(2, "0")}`
21702170
details += `\n\n# Current Time\n${formatter.format(now)} (${timeZone}, UTC${timeZoneOffsetStr})`
21712171

2172-
// Add context tokens information.
21732172
const { contextTokens, totalCost } = getApiMetrics(this.clineMessages)
21742173
const modelInfo = this.api.getModel().info
21752174
const contextWindow = modelInfo.contextWindow
@@ -2212,7 +2211,6 @@ export class Cline extends EventEmitter<ClineEvents> {
22122211
}
22132212
}
22142213

2215-
// Add warning if not in code mode.
22162214
if (
22172215
!isToolAllowedForMode("write_to_file", currentMode, customModes ?? [], { apply_diff: this.diffEnabled }) &&
22182216
!isToolAllowedForMode("apply_diff", currentMode, customModes ?? [], { apply_diff: this.diffEnabled })

src/core/__tests__/Cline.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ describe("Cline", () => {
241241
mockApiConfig = {
242242
apiProvider: "anthropic",
243243
apiModelId: "claude-3-5-sonnet-20241022",
244-
apiKey: "test-api-key", // Add API key to mock config
244+
apiKey: "test-api-key",
245245
}
246246

247247
// Mock provider methods

src/core/config/ContextProxy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ export class ContextProxy {
137137
}
138138

139139
storeSecret(key: SecretStateKey, value?: string) {
140-
// Update cache.
141140
this.secretCache[key] = value
142141

143142
// Write directly to context.

src/core/config/CustomModesManager.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export class CustomModesManager {
7272
const isRoomodes = filePath.endsWith(ROOMODES_FILENAME)
7373
const source = isRoomodes ? ("project" as const) : ("global" as const)
7474

75-
// Add source to each mode
7675
return result.data.customModes.map((mode) => ({
7776
...mode,
7877
source,
@@ -99,7 +98,6 @@ export class CustomModesManager {
9998
}
10099
}
101100

102-
// Add non-duplicate global modes
103101
for (const mode of globalModes) {
104102
if (!slugs.has(mode.slug)) {
105103
slugs.add(mode.slug)
@@ -200,7 +198,6 @@ export class CustomModesManager {
200198
projectModes.set(mode.slug, { ...mode, source: "project" as const })
201199
}
202200

203-
// Add global modes
204201
for (const mode of settingsModes) {
205202
if (!projectModes.has(mode.slug)) {
206203
globalModes.set(mode.slug, { ...mode, source: "global" as const })

src/core/diff/insert-groups.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function insertGroups(original: string[], insertGroups: InsertGroup[]): s
2121
normalGroups.forEach(({ index, elements }) => {
2222
// Add elements from original array up to insertion point
2323
result.push(...original.slice(lastIndex, index))
24-
// Add the group of elements
24+
2525
result.push(...elements)
2626
lastIndex = index
2727
})

0 commit comments

Comments
 (0)