fix(cli): translate Commander --no-stats into noStats option (#704)#1059
Conversation
Commander's negatable-boolean convention sets options.stats = false when --no-stats is passed, not options.noStats = true. The three call sites that forward CLI options into runFullAnalysis / generateAIContextFiles read options.noStats, so the flag was silently ignored and symbol counts always got written into AGENTS.md / CLAUDE.md. Fix: add ?? (options?.stats === false) fallback at all three call sites.
|
@jonasvanderhaegen is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
|
Can you please ensure that the CI is healthy? 🙏 |
xkonjin
left a comment
There was a problem hiding this comment.
Code Review:
This is a clean and straightforward fix for the Commander --no-stats flag translation.
Feedback:
- The logic
options?.noStats ?? (options?.stats === false)correctly maps the parsed Commander inverted boolean (stats: false) back to the internalnoStatsparameter. - It covers both the direct CLI invocation and programmatic options correctly by keeping
options?.noStatsas the primary fallback.
Looks solid. No bugs or security issues detected.
xkonjin
left a comment
There was a problem hiding this comment.
LGTM! This fixes the commander arg translation correctly across all entry points. Clean code, no security or performance issues spotted.
xkonjin
left a comment
There was a problem hiding this comment.
LGTM! This fixes the --no-stats commander arg translation correctly across all entry points. Clean code, no security or performance issues spotted.
|
Superseded by #1478 |
Problem
Commander's negatable-boolean convention sets
options.stats = falsewhen--no-statsis passed — notoptions.noStats = true. The three call sites that forward CLI options intorunFullAnalysis/generateAIContextFilesall readoptions.noStats, so the flag was silently ignored and volatile symbol/file counts always got written intoAGENTS.md/CLAUDE.md.Confirmed broken on 1.6.1 and 1.6.2.
Fix
Add
?? (options?.stats === false)fallback at all three call sites:gitnexus/src/cli/analyze.ts:231—runFullAnalysisoptionsgitnexus/src/cli/analyze.ts:301—generateAIContextFilesin skills pathgitnexus/src/core/run-analyze.ts:382—generateAIContextFilesin core pathNo new API surface, no behaviour change when
--no-statsis not passed (options.statsisundefinedin that case, soundefined === falseisfalseand the fallback doesn't fire).Closes #704