Skip to content

Commit a225999

Browse files
tkfossgithub-actions[bot]
authored andcommitted
Automated pre-commit update
1 parent d71fca8 commit a225999

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/codegen/sdk/typescript/file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,10 @@ def remove_unused_exports(self) -> None:
484484
imp.remove()
485485

486486
# Handle different export types
487-
if hasattr(export, 'source') and export.source:
487+
if hasattr(export, "source") and export.source:
488488
# Re-export case (export { x } from 'y')
489489
export.remove()
490-
elif exported_symbol and hasattr(exported_symbol, 'export') and exported_symbol.export:
490+
elif exported_symbol and hasattr(exported_symbol, "export") and exported_symbol.export:
491491
if exported_symbol.export.declared_symbol == exported_symbol:
492492
# Direct export case (export function x)
493493
if exported_symbol.source.startswith("export default "):

tests/unit/codegen/sdk/typescript/file/test_file_remove.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,7 @@ def test_remove_unused_exports_with_reexports(tmpdir):
163163
export function localFunction() { return true; }
164164
"""
165165

166-
with get_codebase_session(tmpdir=tmpdir, programming_language=ProgrammingLanguage.TYPESCRIPT, files={
167-
"main.ts": content1,
168-
"other.ts": content2
169-
}) as codebase:
166+
with get_codebase_session(tmpdir=tmpdir, programming_language=ProgrammingLanguage.TYPESCRIPT, files={"main.ts": content1, "other.ts": content2}) as codebase:
170167
main_file = codebase.get_file("main.ts")
171168
main_file.remove_unused_exports()
172169
assert main_file.content.strip() == expected1.strip()
@@ -192,11 +189,7 @@ def test_remove_unused_exports_with_moved_and_reexported_symbol(tmpdir):
192189
}
193190
"""
194191

195-
with get_codebase_session(tmpdir=tmpdir, programming_language=ProgrammingLanguage.TYPESCRIPT, files={
196-
"utils.ts": content1,
197-
"main.ts": content2,
198-
"consumer.ts": content3
199-
}) as codebase:
192+
with get_codebase_session(tmpdir=tmpdir, programming_language=ProgrammingLanguage.TYPESCRIPT, files={"utils.ts": content1, "main.ts": content2, "consumer.ts": content3}) as codebase:
200193
utils_file = codebase.get_file("utils.ts")
201194
main_file = codebase.get_file("main.ts")
202195

0 commit comments

Comments
 (0)