Commit fc792bb
add blocked-string rewrite validation fixtures (#8)
## Summary
- add reusable sanitize/rewrite fixtures that seed blocked strings
across file contents, commit messages, refs, and paths
- add scan/assert helpers for full-surface detection and removal checks
- document fixture usage and focused test commands in README/developer
docs
## Test plan
- [x] `go test ./... -run 'RewriteValidation|BlockedStringCoverage'`
- [x] `go test ./...`
Made with [Cursor](https://cursor.com)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Adds new exported helpers that execute git commands and parse repo
history/refs, so edge cases and performance of scans could affect
downstream tests; changes are otherwise additive and well-covered by new
tests.
>
> **Overview**
> Adds a new sanitize/rewrite validation fixture
(`CreateRewriteValidationFixture`) that seeds a repo with a configurable
blocked token across **file content, commit messages, refs (branch/tag),
and object paths**.
>
> Introduces scan/validate/assert helpers (`ScanBlockedStringSurfaces*`,
`ValidateBlockedStringCoverage*`, `AssertBlockedStringCoverage*`) to
verify blocked-string detection coverage pre-rewrite and confirm
complete removal post-rewrite.
>
> Updates `README.md`, `DEVELOPER_GUIDE.md`, and package docs with usage
examples and a focused test command, and adds
`sanitize_fixtures_test.go` to exercise fixture creation, invalid token
rejection, and a simulated history rewrite cleanup flow.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
dc8e18b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Updated developer guide with sanitize/rewrite testing workflow
examples and targeted test commands
* Added sanitize/rewrite validation helpers to README with usage
guidance
* **New Features**
* Added test fixture creation helper for seeding blocked-strings across
Git surfaces (contents, history, refs, paths)
* Added blocked-string detection and assertion utilities for validation
testing
* **Tests**
* Added comprehensive test coverage for sanitize/rewrite validation
scenarios
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ben Schellenberger <TBRX103@users.noreply.github.com>
Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>1 parent ad81ae5 commit fc792bb
5 files changed
Lines changed: 633 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
77 | 91 | | |
78 | 92 | | |
79 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
116 | 146 | | |
117 | 147 | | |
118 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
0 commit comments