Conversation
sonukapoor
left a comment
There was a problem hiding this comment.
Approving, and I owe you a note on how this nearly went wrong at my end.
On first run this failed 32 tests across 6 suites and looked like a real regression. It was not. Every failure was on --offline, and the cause was my machine: I had destroyed my local advisory database earlier while testing something unrelated. main failed identically once I checked it as a control. After rebuilding the database, your branch is 151 suites and 2041 tests green, same as main.
On the change itself, I verified the braces-only claim rather than taking it on trust: stripped every brace and normalised whitespace from both versions of src/cli/args.ts and src/index.ts, and the files are identical to main. So no condition, body or message moved.
Sequencing: this conflicts with #1230 on src/cli/args.ts, confirmed by test-merging. If #1230 goes first you will need a rebase here, and I think that is the right order since the braces reapply more easily than the constant extraction would.
|
Will do rebase soon |
Wrap the 10 single-line if statements in src/cli/args.ts and the one in src/index.ts in braces. Pure brace-only change: conditions, error messages and behaviour are unchanged. Task 4 of OWASP#420. The --output guards are included since they are single-line ifs on current main.
22f5055 to
b081ed1
Compare
What changed and why
Adds braces to the remaining single-line
ifstatements, so everyifbody is a block. Pure brace-only change - no conditions, logic, error
messages or behaviour changed.
src/cli/args.ts: 10 single-lineifs wrapped (ca-cert serial/=,config set key/value, config unset key, base serial/
=,output serial/
=, final ca-cert serial)src/index.ts: 1 single-lineifat thevalidationWarningbranchVerified with a normalized comparison (all whitespace and
{/}stripped):both files are identical to
HEAD, confirming the diff adds braces only.Part of #420 (task 4). The issue text says 8 in
args.ts, but currentmainhas 10 - the two--output requires a directory argumentguardslanded after the audit - so both are included here.
npm testandnpm run buildpass.Closes 4th bullet of #420 ; other bullets in #420
remain separate PRs.