threadlines 0.2.18 → 0.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/check.js +8 -0
- package/package.json +1 -1
package/dist/commands/check.js
CHANGED
|
@@ -227,6 +227,14 @@ async function checkCommand(options) {
|
|
|
227
227
|
console.error(chalk_1.default.bold('ℹ️ No changes detected.'));
|
|
228
228
|
process.exit(0);
|
|
229
229
|
}
|
|
230
|
+
// Safety limit: prevent expensive API calls on large diffs
|
|
231
|
+
const MAX_CHANGED_FILES = 20;
|
|
232
|
+
if (gitDiff.changedFiles.length > MAX_CHANGED_FILES) {
|
|
233
|
+
console.error(chalk_1.default.red(`❌ Too many changed files: ${gitDiff.changedFiles.length} (max: ${MAX_CHANGED_FILES})`));
|
|
234
|
+
console.error(chalk_1.default.gray(' This limit prevents expensive API calls on large diffs.'));
|
|
235
|
+
console.error(chalk_1.default.gray(' Consider reviewing smaller batches of changes.'));
|
|
236
|
+
process.exit(1);
|
|
237
|
+
}
|
|
230
238
|
// Check for zero diff (files changed but no actual code changes)
|
|
231
239
|
if (!gitDiff.diff || gitDiff.diff.trim() === '') {
|
|
232
240
|
console.log(chalk_1.default.blue('ℹ️ No code changes detected. Diff contains zero lines added or removed.'));
|