šŸ› fix(pariksha): repo rules count grep hits on CRLF lines

Merged
AT
10d ago
+9-4

Slice: #315

pariksha's repo rules now count a git grep -n hit on a line that ends in a carriage return. parseGrep (packages/pariksha/src/repo-rules.ts) drops one trailing \r before matching and keeps its regex and anchors. A carriage return anywhere else in the line, or a second one at its end, still means no hit. Alok approved this on #315; Cubic first raised it on #297.

What changes for users

  • deleted-path-still-pinned now reports a CRLF test file that quotes a path the change deletes or renames.
  • vitest4-inert-pool-config now reports, on a turbo.json change that leaves VITEST_MAX_WORKERS out of its pass-through, a CRLF caller that hands the variable to turbo.
  • veda gets no new findings: none of its tracked text files holds a carriage return.

Checks

  • Real git. A scratch repo with a CRLF a.test.ts quoting 'old/path.ts': git grep -n prints a.test.ts:2:expect('old/path.ts');\r, and sideGrep returns that one hit, with text free of \r, for the tree, the index and a commit. Before the change it returned none.

  • Stryker 10.1.1, tap runner, mutate: ["src/repo-rules.ts"], tap.testFiles: ["src/repo-rules.test.ts"], incremental off:

    RunMutantsKilledTimeoutSurvivedNoCoverage
    Before (#297)297295200
    After301299200

    The two Timeouts are the same endless loops as before, which Stryker's hit limit stops.

  • pnpm --filter @veda-hq/pariksha check is green: 3,910 tests, repo-rules.ts at 100% lines, branches and functions.

  • pnpm lint is clean.

  • pariksha's version is not bumped; the next release carries it.

šŸ¤– Generated with Claude Code


Summary by cubic

Fixes parseGrep in packages/pariksha so repo rules now count a git grep -n hit on a line ending in a carriage return. Previously . in the regex stopped at \r, so every hit in a CRLF file was dropped, and deleted-path-still-pinned and vitest4-inert-pool-config passed changes they exist to stop.

  • Drops one trailing \r before matching, keeping the regex anchors.
  • A carriage return anywhere else in the line, or a second one at its end, still means no hit.