Commit f3e6753
authored
[Fix CI] Improve license parsing in
* Improve license parsing
* Add changelog
* fix(licenses): Fix validation of SPDX identifiers containing -or- and -and-
- Update _OP_SPLIT regex to use negative lookbehind/lookahead assertions
- Prevent matching "-or-" or "-and-" inside identifiers like "GPL-2.0-or-later"
- Fix fallback logic to check per-chunk instead of entire parts list
- Ensure all license identifiers are extracted from compound expressions
Rationale: The _OP_SPLIT regex was incorrectly splitting SPDX identifiers like
GPL-2.0-or-later into fragments (GPL-2.0- and -later) because \bOR\b with
re.IGNORECASE matched the lowercase "or" between hyphens. This caused valid
licenses with -or-later or -and- segments to be rejected by ddev validate
licenses. Additionally, the fallback logic bug prevented proper extraction of
multiple license identifiers from compound expressions, resulting in only the
first identifier being extracted.
This commit made by [/dd:git:commit:atomic](https://github.com/DataDog/claude-marketplace/tree/main/dd/commands/git/commit/atomic.md)
* Add type hint to parts
* fix(licenses): Remove comma as a separator in license expressions
- Remove comma from _OP_SPLIT regex separator list
- Fixes incorrect splitting of license names containing commas
- Addresses validation failures for licenses like "Apache License, Version 2.0"
Rationale: Commas are not part of the SPDX expression syntax (only AND, OR,
and WITH are valid operators). When commas appear in license strings, they are
part of the license name itself, not expression separators. The previous
implementation incorrectly split "Apache License, Version 2.0" into
["Apache License", "Version 2.0"], causing validation failures.
This commit made by [/dd:git:commit:atomic](https://github.com/DataDog/claude-marketplace/tree/main/dd/commands/git/commit/atomic.md)ddev validation (#22559)1 parent 5fa76fc commit f3e6753
File tree
2 files changed
+38
-7
lines changed- ddev
- changelog.d
- src/ddev/cli/validate
2 files changed
+38
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
13 | 22 | | |
14 | 23 | | |
15 | 24 | | |
| |||
330 | 339 | | |
331 | 340 | | |
332 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
333 | 369 | | |
334 | 370 | | |
335 | 371 | | |
| |||
420 | 456 | | |
421 | 457 | | |
422 | 458 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
| 459 | + | |
430 | 460 | | |
431 | 461 | | |
432 | 462 | | |
| |||
0 commit comments