Skip to content

Commit

Permalink
code cleanup Signed-off-by: NucleonGodX <[email protected]>
Browse files Browse the repository at this point in the history
  • Loading branch information
NucleonGodX authored Feb 9, 2025
1 parent 8d12b2c commit 0c13beb
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/packagedcode/componentjs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

class ComponentJSONMetadataHandler(models.NonAssemblableDatafileHandler):
"""
Handle JSON metadata files for package analysis.
Handle component JSON metadata files for package analysis.
"""
datasource_id = "json_metadata"
path_patterns = ("*component.json",)
default_package_type = "library"
description = "JSON package metadata file"
description = "component JSON package metadata file"

@classmethod
def parse(cls, location, package_only=False):
Expand Down Expand Up @@ -110,12 +110,8 @@ def _process_dependencies(data):
@classmethod
def _extract_license_statement(cls, data):
"""
Extract license statement similar to BuildpackHandler.
Handles various license formats:
- Simple string license
- Multiple licenses
- Complex license strings
Extract license statement.
"""
license_field = data.get('license')
if not license_field:
Expand Down Expand Up @@ -148,4 +144,4 @@ def _extract_extra_data(data):
field: data[field]
for field in extra_fields
if field in data
}
}

0 comments on commit 0c13beb

Please sign in to comment.