(sessionId: string, fileIndex: number, options: CliOptions)
| 246 | } |
| 247 | |
| 248 | function 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 | |
| 271 | function makeRegistration( |
| 272 | sessionId: string, |
no test coverage detected