From e3b39c8edf13562d023a6ecf39d0b083c7a93017 Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Fri, 3 Jul 2026 13:59:36 +0100 Subject: [PATCH] fix: disable duplicate checks when threshold <= 0 If the threshold is `0`, you're basically saying "show me when a package has 0 or more versions". This will always be true so is a nonsensical value. Similarly, `-1` may be set as a way to turn it off but currently does the opposite (same as `0`). This change means `-1` and `0` behave as "turn off duplicate checks". --- build/main.js | 16 +++++++++------- src/main.ts | 17 ++++++++++------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/build/main.js b/build/main.js index 405fcd7..f9a3684 100644 --- a/build/main.js +++ b/build/main.js @@ -25085,13 +25085,15 @@ async function analyzeAndComment() { info(`Pack size threshold set to ${formatBytes(packSizeThreshold)}`); const messages = []; scanForDependencyCount(messages, dependencyThreshold, currentDeps, baseDeps); - scanForDuplicates( - messages, - duplicateThreshold, - currentDeps, - lockfilePath, - parsedCurrentLock - ); + if (duplicateThreshold > 0) { + scanForDuplicates( + messages, + duplicateThreshold, + currentDeps, + lockfilePath, + parsedCurrentLock + ); + } await scanForDependencySize( messages, sizeThreshold, diff --git a/src/main.ts b/src/main.ts index 68fd4ec..d34fd47 100644 --- a/src/main.ts +++ b/src/main.ts @@ -168,13 +168,16 @@ async function analyzeAndComment(): Promise { const messages: string[] = []; scanForDependencyCount(messages, dependencyThreshold, currentDeps, baseDeps); - scanForDuplicates( - messages, - duplicateThreshold, - currentDeps, - lockfilePath, - parsedCurrentLock - ); + + if (duplicateThreshold > 0) { + scanForDuplicates( + messages, + duplicateThreshold, + currentDeps, + lockfilePath, + parsedCurrentLock + ); + } await scanForDependencySize( messages,