Skip to content

Commit 108ac22

Browse files
ZimmerAmr-c
authored andcommitted
Sort imports and exports to reduce diff noise
1 parent e26cd35 commit 108ac22

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

schema_salad/typescript_codegen.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,13 +737,16 @@ def typedsl_loader(self, inner: TypeDef, ref_scope: Optional[int]) -> TypeDef:
737737
)
738738

739739
def epilogue(self, root_loader: TypeDef) -> None:
740+
740741
"""Trigger to generate the epilouge code."""
741742
pd = "This project contains TypeScript objects and utilities "
742743
pd = pd + ' auto-generated by <a href=\\"https://github.com/'
743744
pd = pd + 'common-workflow-language/schema_salad\\">Schema Salad</a>'
744745
pd = pd + " for parsing documents corresponding to the "
745746
pd = pd + str(self.base_uri) + " schema."
746-
generated_class_imports = ",\n ".join(self.record_types)
747+
748+
sorted_record_types = sorted(self.record_types)
749+
generated_class_imports = ",\n ".join(sorted_record_types)
747750
template_vars: MutableMapping[str, str] = dict(
748751
project_name=self.package,
749752
version="0.0.1-SNAPSHOT",
@@ -784,8 +787,9 @@ def expand_resource_template_to(resource: str, path: Path) -> None:
784787
collected_type.name, collected_type.init
785788
)
786789

790+
sorted_modules = sorted(self.modules)
787791
internal_module_exports = "\n".join(
788-
f"export * from '../{f}'" for f in self.modules
792+
f"export * from '../{f}'" for f in sorted_modules
789793
)
790794

791795
example_tests = ""

0 commit comments

Comments
 (0)