Skip to content

Commit 3c28431

Browse files
committed
fix --limit alias to properly map to --pr-limit
Changes: - Add aliases: ['limit'] to prLimit flag definition - Remove separate limit flag from hiddenFlags that was causing conflicts - Add comprehensive tests for --limit alias functionality The --limit flag now properly functions as a hidden alias for --pr-limit, resolving the issue identified in PR #960 discussion.
1 parent 39a114d commit 3c28431

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

src/commands/fix/cmd-fix.integration.test.mts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,43 @@ describe('socket fix', async () => {
10131013
expect(code, 'should exit with code 0').toBe(0)
10141014
},
10151015
)
1016+
1017+
cmdit(
1018+
[
1019+
'fix',
1020+
FLAG_DRY_RUN,
1021+
'--limit',
1022+
'15',
1023+
'--autopilot',
1024+
FLAG_CONFIG,
1025+
'{"apiToken":"fakeToken"}',
1026+
],
1027+
'should accept --limit alias in combination with other flags',
1028+
async cmd => {
1029+
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
1030+
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Not saving"`)
1031+
expect(code, 'should exit with code 0').toBe(0)
1032+
},
1033+
)
1034+
1035+
cmdit(
1036+
[
1037+
'fix',
1038+
FLAG_DRY_RUN,
1039+
'--limit',
1040+
'7',
1041+
FLAG_ID,
1042+
'GHSA-1234-5678-9abc',
1043+
FLAG_CONFIG,
1044+
'{"apiToken":"fakeToken"}',
1045+
],
1046+
'should accept --limit alias with --id flag',
1047+
async cmd => {
1048+
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
1049+
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Not saving"`)
1050+
expect(code, 'should exit with code 0').toBe(0)
1051+
},
1052+
)
10161053
})
10171054

10181055
describe('--ecosystems flag behavior', () => {

src/commands/fix/cmd-fix.mts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ const generalFlags: MeowFlags = {
115115
isMultiple: true,
116116
},
117117
prLimit: {
118+
aliases: ['limit'],
118119
type: 'number',
119120
default: DEFAULT_LIMIT,
120121
description: `Maximum number of pull requests to create in CI mode (default ${DEFAULT_LIMIT}). Has no effect in local mode.`,
@@ -164,10 +165,6 @@ const hiddenFlags: MeowFlags = {
164165
...generalFlags['id'],
165166
hidden: true,
166167
} as MeowFlag,
167-
limit: {
168-
...generalFlags['prLimit'],
169-
hidden: true,
170-
} as MeowFlag,
171168
maxSatisfying: {
172169
type: 'boolean',
173170
default: true,

0 commit comments

Comments
 (0)