From 79f90095d4f72832e14a5bc13df77f7e4defa71d Mon Sep 17 00:00:00 2001 From: anthonyharrison Date: Sun, 1 Dec 2024 21:26:30 +0000 Subject: [PATCH] chore: linting --- sbom4python/scanner.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sbom4python/scanner.py b/sbom4python/scanner.py index 71457fc..d0c07c6 100644 --- a/sbom4python/scanner.py +++ b/sbom4python/scanner.py @@ -250,8 +250,8 @@ def _create_package(self, package, version, parent="-", requirements=None): ) else: self.sbom_package.set_downloadlocation( - f"https://pypi.org/project/{package}/{version}/#files" - ) + f"https://pypi.org/project/{package}/{version}/#files" + ) else: self.sbom_package.set_downloadlocation(self.metadata.get("Download-URL")) # External references @@ -268,7 +268,9 @@ def _create_package(self, package, version, parent="-", requirements=None): self.sbom_package.set_cpe( f"cpe:2.3:a:{component_supplier.replace(' ', '_').lower()}:{package}:{cpe_version}:*:*:*:*:*:*:*" ) - checksum, checksum_algorithm = self.package_metadata.get_checksum(version=version) + checksum, checksum_algorithm = self.package_metadata.get_checksum( + version=version + ) if checksum is not None: self.sbom_package.set_checksum(checksum_algorithm, checksum) # Copyright @@ -563,7 +565,7 @@ def process_requirements(self, filename): elif filename.endswith(".txt"): self.process_requirements_file(filename) elif self.debug: - print (f"Unable to process requirements file {filename}") + print(f"Unable to process requirements file {filename}") def _process_requirement_dependency(self, dependency, filename): if len(dependency.strip()) > 0: @@ -585,6 +587,7 @@ def _process_requirement_dependency(self, dependency, filename): print(f"Processing {package}") self._create_package(package, version, requirements=filename) self._create_relationship(package) + def process_requirements_file(self, filename): # Process a requirements.txt file if len(filename) > 0: