Skip to content

fix(analyze-patterns): --min-threshold and --min-vendor-n values are never validated #3113

Description

@santifer

Time: ~30 min · Difficulty: Beginner

analyze-patterns.mjs reads its flags positionally (args.indexOf('--min-threshold')) with no validation at all: a mistyped flag is ignored, and --min-threshold abc silently becomes the default — the same silent-wrong-answer family #2982 closed for four other CLIs. Mirror that work: validateFlags for the names, requireFlagValue with isNonNegativeInt/isPositiveInt (both already exported from lib/cli-flags.mjs) for the values, plus a row in tests/cli-flag-validation.test.mjs.

Acceptance: unknown flags and unusable values exit 2 naming the flag; valid invocations behave exactly as before. (Note: #2983 touches lib/cli-flags.mjs and merges shortly — rebase over it if you collide.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions