coderev-cli 1.0.7 → 1.0.9
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/README.md +182 -5
- package/package.json +1 -1
- package/src/cli.js +713 -712
- package/src/reviewer.js +5 -0
package/src/reviewer.js
CHANGED
|
@@ -222,6 +222,10 @@ async function runParallelAgents(apiKey, config, prompts) {
|
|
|
222
222
|
async function reviewDiff(diff, config, options = {}) {
|
|
223
223
|
if (!config) config = loadConfig();
|
|
224
224
|
|
|
225
|
+
if (!diff || typeof diff !== 'string') {
|
|
226
|
+
return { summary: 'No diff provided', score: 0, issues: [], suggestions: [], praise: [] };
|
|
227
|
+
}
|
|
228
|
+
|
|
225
229
|
// Apply ignore patterns: strip ignored files from diff
|
|
226
230
|
if (options.ignorePattern) {
|
|
227
231
|
diff = filterDiffByPattern(diff, options.ignorePattern);
|
|
@@ -504,6 +508,7 @@ function parseReviewResponse(text) {
|
|
|
504
508
|
*/
|
|
505
509
|
function filterDiffByPattern(diff, ignorePattern) {
|
|
506
510
|
if (!ignorePattern) return diff;
|
|
511
|
+
if (!diff || typeof diff !== 'string') return diff;
|
|
507
512
|
|
|
508
513
|
const patterns = ignorePattern.split(',').map(p => {
|
|
509
514
|
const glob = p.trim();
|