Skip to content

Commit 5a48abe

Browse files
committed
feat: track original source paths
1 parent 62242d1 commit 5a48abe

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

decoder.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class DecoderStatistic(TypedDict):
1616
forbiddenPaths: list[str]
1717
renamedPaths: dict[str, str]
1818
deduplicated: dict[str, str]
19+
originalPaths: list[str]
1920

2021

2122
def check_in_forbidden_symbols(file_path: str) -> bool:
@@ -73,6 +74,7 @@ def save_decode_result(output_folder: Path, bundle_name: str, decode_result: sou
7374
forbidden_paths: list[str] = []
7475
renamed_paths: dict[str, str] = {}
7576
deduplicated: dict[str, str] = {}
77+
original_paths: list[str] = []
7678
saved_file_contents: dict[Path, str] = {}
7779

7880
# Папка в который лежит бандл, относительной данной папки, мы и будет сохранять файлы
@@ -107,6 +109,9 @@ def save_decode_result(output_folder: Path, bundle_name: str, decode_result: sou
107109
if not saved_file_path.parent.exists():
108110
saved_file_path.parent.mkdir(parents=True)
109111

112+
if not is_generated_source_path(original_file_path):
113+
original_paths.append(file_path)
114+
110115
saved_file_exists = False
111116
if saved_file_path in saved_file_contents:
112117
saved_file_exists = True
@@ -141,6 +146,7 @@ def save_decode_result(output_folder: Path, bundle_name: str, decode_result: sou
141146
forbiddenPaths=forbidden_paths,
142147
renamedPaths=renamed_paths,
143148
deduplicated=deduplicated,
149+
originalPaths=original_paths,
144150
)
145151

146152
save_statistic_file(folder_path / "statistic.json", decode_result.sourceMapStatistic)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ select = [
4848
"UP", # pyupgrade
4949
]
5050
ignore = [
51+
"PLR0915",
5152
"RUF001",
5253
]
5354

0 commit comments

Comments
 (0)