Skip to content

Commit 4780a84

Browse files
committed
style: sorted all imports
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent b211de5 commit 4780a84

25 files changed

+239
-66
lines changed

cyclonedx/model/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#
1515
# SPDX-License-Identifier: Apache-2.0
1616
# Copyright (c) OWASP Foundation. All Rights Reserved.
17+
1718
import hashlib
1819
import re
1920
import sys
@@ -22,8 +23,13 @@
2223
from enum import Enum
2324
from typing import Iterable, Optional, Set
2425

25-
from ..exception.model import InvalidLocaleTypeException, InvalidUriException, NoPropertiesProvidedException, \
26-
MutuallyExclusivePropertiesException, UnknownHashTypeException
26+
from ..exception.model import (
27+
InvalidLocaleTypeException,
28+
InvalidUriException,
29+
MutuallyExclusivePropertiesException,
30+
NoPropertiesProvidedException,
31+
UnknownHashTypeException,
32+
)
2733

2834
"""
2935
Uniform set of models to represent objects within a CycloneDX software bill-of-materials.

cyclonedx/model/bom.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
#
1717
# SPDX-License-Identifier: Apache-2.0
1818
# Copyright (c) OWASP Foundation. All Rights Reserved.
19+
1920
from datetime import datetime, timezone
2021
from typing import Iterable, Optional, Set
21-
from uuid import uuid4, UUID
22+
from uuid import UUID, uuid4
2223

23-
from . import ExternalReference, OrganizationalContact, OrganizationalEntity, LicenseChoice, Property, ThisTool, Tool
24+
from ..parser import BaseParser
25+
from . import ExternalReference, LicenseChoice, OrganizationalContact, OrganizationalEntity, Property, ThisTool, Tool
2426
from .component import Component
2527
from .service import Service
26-
from ..parser import BaseParser
2728

2829

2930
class BomMetaData:

cyclonedx/model/bom_ref.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#
1717
# SPDX-License-Identifier: Apache-2.0
1818
# Copyright (c) OWASP Foundation. All Rights Reserved.
19+
1920
from typing import Optional
2021
from uuid import uuid4
2122

cyclonedx/model/component.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#
1717
# SPDX-License-Identifier: Apache-2.0
1818
# Copyright (c) OWASP Foundation. All Rights Reserved.
19+
1920
import warnings
2021
from enum import Enum
2122
from os.path import exists
@@ -24,13 +25,24 @@
2425
# See https://github.com/package-url/packageurl-python/issues/65
2526
from packageurl import PackageURL # type: ignore
2627

27-
from . import AttachedText, Copyright, ExternalReference, HashAlgorithm, HashType, IdentifiableAction, LicenseChoice, \
28-
OrganizationalEntity, Property, sha1sum, XsUri
28+
from ..exception.model import NoPropertiesProvidedException
29+
from . import (
30+
AttachedText,
31+
Copyright,
32+
ExternalReference,
33+
HashAlgorithm,
34+
HashType,
35+
IdentifiableAction,
36+
LicenseChoice,
37+
OrganizationalEntity,
38+
Property,
39+
XsUri,
40+
sha1sum,
41+
)
2942
from .bom_ref import BomRef
3043
from .issue import IssueType
3144
from .release_note import ReleaseNotes
3245
from .vulnerability import Vulnerability
33-
from ..exception.model import NoPropertiesProvidedException
3446

3547

3648
class Commit:

cyclonedx/model/issue.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
#
1515
# SPDX-License-Identifier: Apache-2.0
1616
# Copyright (c) OWASP Foundation. All Rights Reserved.
17+
1718
from enum import Enum
1819
from typing import Iterable, Optional, Set
1920

20-
from . import XsUri
2121
from ..exception.model import NoPropertiesProvidedException
22+
from . import XsUri
2223

2324

2425
class IssueClassification(Enum):

cyclonedx/model/release_note.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#
1717
# SPDX-License-Identifier: Apache-2.0
1818
# Copyright (c) OWASP Foundation. All Rights Reserved.
19+
1920
from datetime import datetime
2021
from typing import Iterable, Optional, Set
2122

cyclonedx/model/service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
#
1515
# SPDX-License-Identifier: Apache-2.0
1616
# Copyright (c) OWASP Foundation. All Rights Reserved.
17+
1718
from typing import Iterable, Optional, Set
1819

19-
from . import ExternalReference, DataClassification, LicenseChoice, OrganizationalEntity, Property, XsUri
20+
from . import DataClassification, ExternalReference, LicenseChoice, OrganizationalEntity, Property, XsUri
2021
from .bom_ref import BomRef
2122
from .release_note import ReleaseNotes
2223

cyclonedx/model/vulnerability.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,23 @@
1616
#
1717
# SPDX-License-Identifier: Apache-2.0
1818
# Copyright (c) OWASP Foundation. All Rights Reserved.
19+
1920
import re
2021
import warnings
2122
from datetime import datetime
2223
from decimal import Decimal
2324
from enum import Enum
2425
from typing import Iterable, Optional, Set, Tuple, Union
2526

27+
from ..exception.model import MutuallyExclusivePropertiesException, NoPropertiesProvidedException
2628
from . import OrganizationalContact, OrganizationalEntity, Tool, XsUri
2729
from .bom_ref import BomRef
28-
from .impact_analysis import ImpactAnalysisAffectedStatus, ImpactAnalysisJustification, ImpactAnalysisResponse, \
29-
ImpactAnalysisState
30-
from ..exception.model import MutuallyExclusivePropertiesException, NoPropertiesProvidedException
30+
from .impact_analysis import (
31+
ImpactAnalysisAffectedStatus,
32+
ImpactAnalysisJustification,
33+
ImpactAnalysisResponse,
34+
ImpactAnalysisState,
35+
)
3136

3237
"""
3338
This set of classes represents the data that is possible about known Vulnerabilities.

cyclonedx/output/json.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,24 @@
1616
#
1717
# SPDX-License-Identifier: Apache-2.0
1818
# Copyright (c) OWASP Foundation. All Rights Reserved.
19+
1920
import json
2021
from abc import abstractmethod
21-
from typing import cast, Any, Dict, List, Optional, Union
22+
from typing import Any, Dict, List, Optional, Union, cast
2223

23-
from . import BaseOutput, SchemaVersion
24-
from .schema import BaseSchemaVersion, SchemaVersion1Dot0, SchemaVersion1Dot1, SchemaVersion1Dot2, SchemaVersion1Dot3, \
25-
SchemaVersion1Dot4
26-
from .serializer.json import CycloneDxJSONEncoder
2724
from ..exception.output import FormatNotSupportedException
2825
from ..model.bom import Bom
2926
from ..model.component import Component
27+
from . import BaseOutput, SchemaVersion
28+
from .schema import (
29+
BaseSchemaVersion,
30+
SchemaVersion1Dot0,
31+
SchemaVersion1Dot1,
32+
SchemaVersion1Dot2,
33+
SchemaVersion1Dot3,
34+
SchemaVersion1Dot4,
35+
)
36+
from .serializer.json import CycloneDxJSONEncoder
3037

3138
ComponentDict = Dict[str, Union[
3239
str,

cyclonedx/output/serializer/json.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#
1717
# SPDX-License-Identifier: Apache-2.0
1818
# Copyright (c) OWASP Foundation. All Rights Reserved.
19+
1920
from datetime import datetime
2021
from decimal import Decimal
2122
from enum import Enum

0 commit comments

Comments
 (0)