Skip to content

Commit dec7a62

Browse files
authored
style: shorten typehint-ignores (#820)
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent bfe889a commit dec7a62

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cyclonedx/model/bom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ def validate(self) -> bool:
703703
# 2. if root component is set and there are other components: dependencies should exist for the Component
704704
# this BOM is describing
705705
if self.metadata.component and len(self.components) > 0 and not any(map(
706-
lambda d: d.ref == self.metadata.component.bom_ref and len(d.dependencies) > 0, # type: ignore[union-attr]
706+
lambda d: d.ref == self.metadata.component.bom_ref and len(d.dependencies) > 0, # type:ignore[union-attr]
707707
self.dependencies
708708
)):
709709
warn(
@@ -716,7 +716,7 @@ def validate(self) -> bool:
716716
# 3. If a LicenseExpression is set, then there must be no other license.
717717
# see https://github.com/CycloneDX/specification/pull/205
718718
elem: Union[BomMetaData, Component, Service]
719-
for elem in chain( # type: ignore[assignment]
719+
for elem in chain( # type:ignore[assignment]
720720
[self.metadata],
721721
self.metadata.component.get_all_nested_components(include_self=True) if self.metadata.component else [],
722722
chain.from_iterable(c.get_all_nested_components(include_self=True) for c in self.components),

cyclonedx/model/definition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def requirements(self) -> 'SortedSet[BomRef]':
368368

369369
@requirements.setter
370370
def requirements(self, requirements: Iterable[Union[str, BomRef]]) -> None:
371-
self._requirements = SortedSet(map(_bom_ref_from_str, # type: ignore[arg-type]
371+
self._requirements = SortedSet(map(_bom_ref_from_str, # type:ignore[arg-type]
372372
requirements))
373373

374374
def __comparable_tuple(self) -> _ComparableTuple:

0 commit comments

Comments
 (0)