Skip to content

fix: skip blank gitignore lines when checking lockfiles - #613

Open
vibgrate-team wants to merge 1 commit into
mainfrom
cursor/blank-ignore-patterns-b26e
Open

vibgrate-team wants to merge 1 commit into
mainfrom
cursor/blank-ignore-patterns-b26e

Conversation

@vibgrate-team

Copy link
Copy Markdown
Contributor

Summary

Empty and whitespace-only ignore lines were already dropped while vg build and vg scan discovered source. The lockfile check still passed .gitignore straight to the ignore matcher. A carriage return that is not part of a CRLF pair — a file that contains only \r, or a real rule followed by a bare \r — compiled to a pattern that matches every path, so lockfiles were skipped and a truncated lockfile did not fail the command.

Those lines are now dropped with the same rule source discovery uses. A real pattern next to a blank one still applies. Empty and whitespace-only --exclude values stay skipped and are called out in the command help and in DOCS.md.

Related issues

Closes #279

Checklist

  • pnpm test passes
  • pnpm lint is clean
  • pnpm typecheck is clean
  • Docs updated (README / DOCS / ARCHITECTURE) where behavior changed
  • Determinism preserved — identical input still produces identical graph.json / report output (content-hashed IDs, stable sorts; no time, randomness, or filesystem-order dependence)
  • No proprietary or internal references — public, Apache-2.0 content only
  • Commits use Conventional Commits and are signed off (git commit -s, DCO)

Notes for reviewers

test/blank-exclude.test.ts covers a carriage-return-only .gitignore and a real rule followed by a bare CR, for both source discovery and the lockfile check.

Open in Web Open in Cursor 

A carriage return that is not part of CRLF was compiled as a pattern
that matches every path, so vg build and vg scan skipped lockfiles.
Blank and whitespace-only ignore lines are now dropped, matching
source discovery.

Closes #279

Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
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.

Bug: empty or whitespace-only ignore patterns must not match the entire tree

2 participants