MCPcopy Create free account
hub / github.com/modem-dev/hunk / makeReviewFile

Function makeReviewFile

scripts/daemon-memory-check.ts:248–269  ·  view source on GitHub ↗
(sessionId: string, fileIndex: number, options: CliOptions)

Source from the content-addressed store, hash-verified

246}
247
248function makeReviewFile(sessionId: string, fileIndex: number, options: CliOptions) {
249 const path = `src/${sessionId}/file-${fileIndex}.ts`;
250 const hunks = Array.from({ length: options.hunksPerFile }, (_, hunkIndex) => {
251 const start = hunkIndex * (options.linesPerHunk + 3) + 1;
252 return {
253 index: hunkIndex,
254 header: `@@ -${start},${options.linesPerHunk} +${start},${options.linesPerHunk} @@`,
255 oldRange: [start, options.linesPerHunk],
256 newRange: [start, options.linesPerHunk],
257 };
258 });
259
260 return {
261 id: `${sessionId}-file-${fileIndex}`,
262 path,
263 additions: options.hunksPerFile * options.linesPerHunk,
264 deletions: options.hunksPerFile * options.linesPerHunk,
265 hunkCount: options.hunksPerFile,
266 patch: makePatch(fileIndex, options.hunksPerFile, options.linesPerHunk),
267 hunks,
268 };
269}
270
271function makeRegistration(
272 sessionId: string,

Callers 1

makeRegistrationFunction · 0.85

Calls 1

makePatchFunction · 0.85

Tested by

no test coverage detected