From 21adc8aa5a72ff6d1f1e08ec8e5731f166e036d3 Mon Sep 17 00:00:00 2001 From: Agustin Groh Date: Mon, 6 Jan 2025 09:18:14 -0300 Subject: [PATCH 1/2] bug:SP-2020 Fixes undeclared component policy check summary --- .gitignore | 1 + CHANGELOG.md | 7 ++++++- src/scanoss/__init__.py | 2 +- src/scanoss/inspection/undeclared_component.py | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6d384760..edeb3710 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ docs/build !tests/data/*.json !docs/source/_static/*.json !scanoss-settings-schema.json +.DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md index 290dd109..60deb8f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Upcoming changes... +## [1.19.1] - 2025-01-06 +### Fixed +- Fixed undeclared components inspection + ## [1.19.0] - 2024-11-20 ### Fixed - Check if legacy sbom file before post processing @@ -418,4 +422,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [1.17.5]: https://github.com/scanoss/scanoss.py/compare/v1.17.4...v1.17.5 [1.18.0]: https://github.com/scanoss/scanoss.py/compare/v1.17.5...v1.18.0 [1.18.1]: https://github.com/scanoss/scanoss.py/compare/v1.18.0...v1.18.1 -[1.19.0]: https://github.com/scanoss/scanoss.py/compare/v1.18.1...v1.19.0 \ No newline at end of file +[1.19.0]: https://github.com/scanoss/scanoss.py/compare/v1.18.1...v1.19.0 +[1.19.1]: https://github.com/scanoss/scanoss.py/compare/v1.19.0...v1.19.1 \ No newline at end of file diff --git a/src/scanoss/__init__.py b/src/scanoss/__init__.py index 74f26e03..4c18d880 100644 --- a/src/scanoss/__init__.py +++ b/src/scanoss/__init__.py @@ -22,4 +22,4 @@ THE SOFTWARE. """ -__version__ = "1.19.0" +__version__ = "1.19.1" diff --git a/src/scanoss/inspection/undeclared_component.py b/src/scanoss/inspection/undeclared_component.py index 4e618fdc..a4abe151 100644 --- a/src/scanoss/inspection/undeclared_component.py +++ b/src/scanoss/inspection/undeclared_component.py @@ -88,6 +88,7 @@ def _get_summary(self, components: list) -> str: summary += (f'Add the following snippet into your `sbom.json` file\n' f'\n```json\n{json.dumps(self._generate_sbom_file(components), indent=2)}\n```\n') return summary + return summary def _json(self, components: list) -> Dict[str, Any]: """ From 74b718bee626c6572586cf962e2769c0051e5aa9 Mon Sep 17 00:00:00 2001 From: Agustin Groh Date: Mon, 6 Jan 2025 10:01:39 -0300 Subject: [PATCH 2/2] Refactor on _get_summary function --- src/scanoss/inspection/undeclared_component.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/scanoss/inspection/undeclared_component.py b/src/scanoss/inspection/undeclared_component.py index a4abe151..af4f0789 100644 --- a/src/scanoss/inspection/undeclared_component.py +++ b/src/scanoss/inspection/undeclared_component.py @@ -83,11 +83,10 @@ def _get_summary(self, components: list) -> str: if self.sbom_format == 'settings': summary += (f'Add the following snippet into your `scanoss.json` file\n' f'\n```json\n{json.dumps(self._generate_scanoss_file(components), indent=2)}\n```\n') - return summary - - summary += (f'Add the following snippet into your `sbom.json` file\n' + else: + summary += (f'Add the following snippet into your `sbom.json` file\n' f'\n```json\n{json.dumps(self._generate_sbom_file(components), indent=2)}\n```\n') - return summary + return summary def _json(self, components: list) -> Dict[str, Any]: