Skip to content

Commit 8171615

Browse files
committed
Only yield PackageData from a pom if we can parse it
* Update CHANGELOG.rst Signed-off-by: Jono Yang <jyang@nexb.com>
1 parent 8ea739a commit 8171615

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ License detection:
5454
detected license only once. This data can contain the reference license text
5555
as an option.
5656

57+
Package parsing:
58+
~~~~~~~~~~~~~~~~~
59+
60+
- Code for parsing a Maven POM, npm package.json, freebsd manifest, haxelib
61+
JSON, have been separated into two functions: one that creates a PackageData
62+
object from the parsed Resource, and another that calls the previous function
63+
and yields the PackageData. This was done such that we can use the package
64+
manifest data parsing code outside of the scancode-toolkit context.
65+
5766
v31.2.1 - 2022-10-05
5867
----------------------------------
5968

src/packagedcode/maven.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,13 +1105,15 @@ def parse(
11051105
Yield Packagedata objects from parsing a Maven pom file at `location` or
11061106
using the provided `text` (one or the other but not both).
11071107
"""
1108-
yield _parse(
1108+
package = _parse(
11091109
datasource_id=datasource_id,
11101110
package_type=package_type,
11111111
primary_language=primary_language,
11121112
location=location,
11131113
base_url=base_url
11141114
)
1115+
if package:
1116+
yield package
11151117

11161118

11171119
def _parse(

0 commit comments

Comments
 (0)