wu-sheng commented on PR #276:
URL: https://github.com/apache/skywalking-eyes/pull/276#issuecomment-4670243311
> One doubt, when there are regex patterns in the configured license
pattern, are they printed as diff?
No — the regex pattern is never printed in the diff. I validated with your
exact scenario. The diff is always computed against the normalized license
**content** (`license.content` or the `spdx-id` template), never against
`license.pattern`; the pattern is only used (unchanged) to decide validity,
same as in `check`:
1. **File matches the pattern** (`OK for skywalking-eyes` vs pattern `OK for
skywalking-.*`): the file is valid, so no diff is printed at all.
2. **File matches neither** (`NK for skywalking-eyes`, with content `OK for
skywalking-team` + the pattern above):
```
fails_both.go:
[-ok-] {+nk+} for [-skywalking-team-] ...
```
The diff is against the configured *content*, so regex fragments like
`.*` can never appear in the output.
3. **Pattern-only config** (no `content`/`spdx-id`): rather than producing a
meaningless diff against regex source text, each failing file reports:
```
ERROR no license content configured (spdx-id or content) to diff against
```
This is also covered in code: `DiffFile` uses `config.NormalizedLicense()`
as the expected text and only passes `config.NormalizedPattern()` into the same
`satisfy()` used by `check` to short-circuit valid files.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]