Skip to content

fix(cli): reject partially numeric line and hunk values#535

Open
fallintoplace wants to merge 1 commit into
modem-dev:mainfrom
fallintoplace:fix/strict-positive-integers
Open

fix(cli): reject partially numeric line and hunk values#535
fallintoplace wants to merge 1 commit into
modem-dev:mainfrom
fallintoplace:fix/strict-positive-integers

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

Number.parseInt() silently truncated malformed hunk and line values such as 12abc, 1.5, and 1e3. Validate the complete token as decimal digits and require the result to be a safe positive integer before accepting it.

This covers --hunk, --old-line, and --new-line and adds the required patch changeset.

Testing

  • bun test src/core/cli.test.ts
  • bun test (1,072 passed, 22 skipped)
  • bun run typecheck
  • bun run lint
  • bunx oxfmt --check src/core/cli.ts src/core/cli.test.ts .changeset/strict-cli-integers.md

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant