Skip to content

Commit

Permalink
Add CHANGELOG entry and fix typo #583
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Druez <[email protected]>
  • Loading branch information
tdruez committed Mar 3, 2023
1 parent ae4860c commit a19946b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Changelog
v33.0.0 (unreleased)
--------------------

- Add support for CycloneDX 1.4 to the "inspect-manifest" pipeline to import SBOM into
a Project.
https://github.com/nexB/scancode.io/issues/583

- Refine the "Command Line Interface" documentation about the ``scanpipe`` command
usages in the Docker context.
Add the /app workdir in the "PYTHONPATH" env of the Docker file to make the
Expand All @@ -17,6 +21,9 @@ v33.0.0 (unreleased)
- Use CodebaseResource ``path`` instead of ``id`` as slug_field in URL navigation.
https://github.com/nexB/scancode.io/issues/242

- Remove dead code related to the project_tree view
https://github.com/nexB/scancode.io/issues/623

v32.0.1 (2023-02-20)
--------------------

Expand Down
9 changes: 4 additions & 5 deletions scanpipe/cyclonedx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from collections import defaultdict

import jsonschema
from hoppr_cyclonedx_models.cyclonedx_1_4 import Component
from hoppr_cyclonedx_models.cyclonedx_1_4 import (
CyclonedxSoftwareBillOfMaterialsStandard as Bom_1_4,
)
Expand Down Expand Up @@ -137,17 +136,17 @@ def get_external_references(external_references):
if not external_references:
return {}

refrences = defaultdict(lambda: [])
references = defaultdict(lambda: [])

for ref in external_references:
refrences[ref.type.value].append(ref.url)
references[ref.type.value].append(ref.url)

return dict(refrences)
return dict(references)


def validate_document(document, schema=CYCLONEDX_JSON_SCHEMA_PATH):
"""
CycloneDX document validation.
Check the validity of this CycloneDX document.
"""
if isinstance(document, str):
document = json.loads(document)
Expand Down
2 changes: 1 addition & 1 deletion scanpipe/spdx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def safe_document_name(name):

def validate(self, schema):
"""
Check the validation of this SPDX document.
Check the validity of this SPDX document.
"""
return validate_document(document=self.as_dict(), schema=schema)

Expand Down
6 changes: 2 additions & 4 deletions scanpipe/tests/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def test_scanpipe_inspect_manifest_pipeline_aboutfile_integration_test(self):
self.assertEqual("4.0.8", discoveredpackage.version)
self.assertEqual("bsd-new", discoveredpackage.license_expression)

def test_scanpipe_inspect_manifest_pipeline_spdx_document_integration_test(self):
def test_scanpipe_inspect_manifest_pipeline_spdx_integration_test(self):
pipeline_name = "inspect_manifest"
project1 = Project.objects.create(name="Analysis")

Expand All @@ -706,9 +706,7 @@ def test_scanpipe_inspect_manifest_pipeline_spdx_document_integration_test(self)
self.assertEqual("MIT", discoveredpackage.declared_license)
self.assertEqual("mit", discoveredpackage.license_expression)

def test_scanpipe_inspect_manifest_pipeline_cyclonedx_document_integration_test(
self,
):
def test_scanpipe_inspect_manifest_pipeline_cyclonedx_integration_test(self):
pipeline_name = "inspect_manifest"
project1 = Project.objects.create(name="Analysis")

Expand Down

0 comments on commit a19946b

Please sign in to comment.