Commit 7d20efe
fix(golang): reject // indirect //exhortignore as ignore marker (#538)
## Summary
- Fix greedy regex in `IgnoredLine` that incorrectly treated `//
indirect //exhortignore` as an ignored dependency (TC-4345)
- Parse the first `//` comment and only accept standalone ignore markers
(`// exhortignore`) or the semicolon-separated format (`// indirect;
exhortignore`), matching the JavaScript client behavior
- Add test cases for the `// indirect //exhortignore` format
## Test plan
- [x] Existing
`test_IgnoredLine_rejects_old_space_separated_indirect_format` passes
with new assertions
- [ ] CI passes
- [ ] Verify with integration test `golang-go_mod_with_ignore[stack]`
that Java and JS clients produce matching results
🤖 Generated with [Claude Code](https://claude.com/claude-code)
## Summary by Sourcery
Update Go modules ignore-line detection to only treat standalone or
semicolon-separated ignore markers as valid, and align behavior with the
JavaScript client.
Bug Fixes:
- Prevent lines with the invalid "// indirect //exhortignore" or "//
indirect //trustify-da-ignore" formats from being treated as ignored
dependencies.
Tests:
- Extend IgnoredLine tests to cover double-slash indirect formats and
confirm they are not recognized while the semicolon format remains
supported.
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent cea1a4b commit 7d20efe
2 files changed
Lines changed: 40 additions & 26 deletions
File tree
- src
- main/java/io/github/guacsec/trustifyda/providers
- test/java/io/github/guacsec/trustifyda/providers
Lines changed: 33 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| |||
560 | 568 | | |
561 | 569 | | |
562 | 570 | | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
589 | 596 | | |
590 | 597 | | |
591 | 598 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
242 | 249 | | |
243 | 250 | | |
244 | 251 | | |
| |||
0 commit comments