Skip to content

Commit ff0e11d

Browse files
committed
typos
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
1 parent bccb7e3 commit ff0e11d

6 files changed

Lines changed: 7 additions & 6 deletions

File tree

cyclonedx/contrib/hash/factories.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def from_hashlib_alg(self, hashlib_alg: str, content: str) -> HashType:
4949
5050
Args:
5151
hashlib_alg:
52-
Hash algorith - like it is used by `hashlib`.
52+
Hash algorithm - like it is used by `hashlib`.
5353
Example: `sha256`.
5454
5555
content:

cyclonedx/contrib/license/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
"""
20-
Exceptions relating to specific conditions that occur when factoring a module.
20+
Exceptions relating to specific conditions that occur when factoring a model.
2121
"""
2222

2323
from ...exception import CycloneDxException

cyclonedx/contrib/license/factories.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ def make_with_name(self, name: str, *,
9494

9595
# Idea for more factories:
9696
# class LicenseAttachmentFactory:
97-
# def male_from_file(self, path: PathLike) -> AttachedText: ...
97+
# def make_from_file(self, path: PathLike) -> AttachedText: ...

cyclonedx/model/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ class HashType:
384384
@staticmethod
385385
@deprecated('Deprecated - use cyclonedx.contrib.hash.factories.HashTypeFactory.from_hashlib_alg instead')
386386
def from_hashlib_alg(hashlib_alg: str, content: str) -> 'HashType':
387-
"""Deprecated — Alias of :func:`cyclonedx.contrib.hash.factories.HashTypeFactory.from_hashlib_alge`.
387+
"""Deprecated — Alias of :func:`cyclonedx.contrib.hash.factories.HashTypeFactory.from_hashlib_alg`.
388388
389389
Attempts to convert a hashlib-algorithm to our internal model classes.
390390

cyclonedx/model/bom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ def validate(self) -> bool:
817817
.. deprecated:: next
818818
Deprecated without any replacement.
819819
"""
820-
# !! deprecated function. have this as an part of the normlization process, like the BomRefDiscrimator
820+
# !! deprecated function. have this as an part of the normalization process, like the BomRefDiscrimator
821821
# 0. Make sure all Dependable have a Dependency entry
822822
if self.metadata.component:
823823
self.register_dependency(target=self.metadata.component)

cyclonedx/model/component.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,8 @@ def for_file(absolute_file_path: str, path_for_bom: Optional[str]) -> 'Component
971971
from ..contrib.component.builders import ComponentBuilder
972972

973973
component = ComponentBuilder().make_for_file(absolute_file_path, name=path_for_bom)
974-
sha1_hash = next(h.content for h in component.hashes if h.alg is HashAlgorithm.SHA_1)
974+
sha1_hash = next((h.content for h in component.hashes if h.alg is HashAlgorithm.SHA_1), None)
975+
assert sha1_hash is not None
975976
component.version = f'0.0.0-{sha1_hash[0:12]}'
976977
component.purl = PackageURL( # DEPRECATED: a file has no PURL!
977978
type='generic', name=path_for_bom if path_for_bom else absolute_file_path,

0 commit comments

Comments
 (0)