Commit 95e2da5
fix(go): support semicolon format for exhortignore in indirect deps (#474)
## Summary
- Update `IgnoredLine()` regex in `GoModulesProvider.java` to accept the
new semicolon-separated format (`// indirect; exhortignore`) in addition
to the old space-separated format
- Aligns with the JS client change in
[guacsec/trustify-da-javascript-client#416](guacsec/trustify-da-javascript-client#416),
which corrected the format to prevent Go tooling from misclassifying
indirect deps as direct
- Update test fixture `go_mod_with_ignore/go.mod` to use the new format
Fixes [TC-4345](https://redhat.atlassian.net/browse/TC-4345)
## Test plan
- [x] All existing Go module tests pass with the updated regex and
fixture
- [x] Verified with CLI: old format (`// indirect exhortignore`) still
works
- [x] Verified with CLI: new format (`// indirect; exhortignore`) now
works
- [x] Verified against unfixed jar: new format was NOT being ignored
before this fix
🤖 Generated with [Claude Code](https://claude.com/claude-code)
[TC-4345]:
https://redhat.atlassian.net/browse/TC-4345?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
## Summary by Sourcery
Support semicolon-delimited exhort ignore markers for indirect Go module
dependencies while retaining backward compatibility with the previous
format.
Bug Fixes:
- Ensure Go module lines with semicolon-separated indirect exhort ignore
markers are correctly recognized and ignored.
Tests:
- Update Go module test fixture to use the new semicolon-based exhort
ignore format for indirect dependencies.
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 1008471 commit 95e2da5
3 files changed
Lines changed: 30 additions & 3 deletions
File tree
- src
- main/java/io/github/guacsec/trustifyda/providers
- test
- java/io/github/guacsec/trustifyda/providers
- resources/tst_manifests/golang/go_mod_with_ignore
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
569 | | - | |
| 569 | + | |
| 570 | + | |
570 | 571 | | |
571 | 572 | | |
572 | 573 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
232 | 258 | | |
233 | 259 | | |
234 | 260 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments