Skip to content

Commit deb24fd

Browse files
committed
chore: Clean up imports and remove unused __all__ export list
Removed the `__all__` list from changelog_helper.py as it was added for backward compatibility during refactoring but is not actually needed - the module's public API is naturally exposed through its classes and top-level functions. Also cleaned up imports: - Removed unused dateutil import - Reordered imports for better organization - Fixed formatting in utils/constants.py No functional changes - purely code cleanup and formatting.
1 parent 75bf783 commit deb24fd

2 files changed

Lines changed: 12 additions & 41 deletions

File tree

mitreattack/diffStix/changelog_helper.py

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import markdown
1616
import requests
1717
import stix2
18-
from dateutil import parser as dateparser
1918
from deepdiff import DeepDiff
2019
from loguru import logger
2120
from requests.adapters import HTTPAdapter, Retry
@@ -24,22 +23,10 @@
2423
from tqdm import tqdm
2524

2625
from mitreattack import release_info
27-
from mitreattack.stix20 import MitreAttackData
2826

2927
# Import from new utility modules
3028
from mitreattack.diffStix.core.contributor_tracker import ContributorTracker
31-
from mitreattack.diffStix.utils.constants import DATE as date
32-
from mitreattack.diffStix.utils.constants import THIS_MONTH as this_month
3329
from mitreattack.diffStix.utils.constants import LAYER_DEFAULTS as layer_defaults
34-
from mitreattack.diffStix.utils.version_utils import (
35-
AttackObjectVersion,
36-
get_attack_object_version,
37-
is_major_version_change,
38-
is_minor_version_change,
39-
is_other_version_change,
40-
is_patch_change,
41-
version_increment_is_valid,
42-
)
4330
from mitreattack.diffStix.utils.stix_utils import (
4431
cleanup_values,
4532
deep_copy_stix,
@@ -51,34 +38,16 @@
5138
get_relative_data_component_url,
5239
get_relative_url_from_stix,
5340
)
54-
55-
# Re-export imported functions for backward compatibility
56-
__all__ = [
57-
"DiffStix",
58-
"DomainStatistics",
59-
"AttackChangesEncoder",
60-
"AttackObjectVersion",
61-
"get_attack_object_version",
62-
"is_major_version_change",
63-
"is_minor_version_change",
64-
"is_other_version_change",
65-
"is_patch_change",
66-
"version_increment_is_valid",
67-
"cleanup_values",
68-
"deep_copy_stix",
69-
"get_attack_id",
70-
"has_subtechniques",
71-
"resolve_datacomponent_parent",
72-
"get_relative_data_component_url",
73-
"get_relative_url_from_stix",
74-
"get_placard_version_string",
75-
"markdown_to_html",
76-
"layers_dict_to_files",
77-
"write_detailed_html",
78-
"get_parsed_args",
79-
"get_new_changelog_md",
80-
"main",
81-
]
41+
from mitreattack.diffStix.utils.version_utils import (
42+
AttackObjectVersion,
43+
get_attack_object_version,
44+
is_major_version_change,
45+
is_minor_version_change,
46+
is_other_version_change,
47+
is_patch_change,
48+
version_increment_is_valid,
49+
)
50+
from mitreattack.stix20 import MitreAttackData
8251

8352

8453
@dataclass

mitreattack/diffStix/utils/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"unchanged": "ATT&CK objects which did not change between the two versions.",
6464
}
6565

66+
6667
# Section headers by object type
6768
def get_section_headers(object_type: str) -> dict:
6869
"""Get section headers for a specific object type.
@@ -89,6 +90,7 @@ def get_section_headers(object_type: str) -> dict:
8990
"unchanged": "Unchanged",
9091
}
9192

93+
9294
# Navigator layer colors for different change types
9395
LAYER_COLORS = {
9496
"additions": "#a1d99b",

0 commit comments

Comments
 (0)