From c3c8aa520981e5ccfbe280faea788190014de37f Mon Sep 17 00:00:00 2001 From: Aminu 'Seun Joshua Date: Wed, 16 Jul 2025 15:00:17 +0100 Subject: [PATCH] generated file notifies users not to edit file Signed-off-by: Aminu 'Seun Joshua --- src/summary.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/summary.rs b/src/summary.rs index fdbaf1a..c93ab04 100644 --- a/src/summary.rs +++ b/src/summary.rs @@ -1163,6 +1163,10 @@ impl<'a> Summary<'a> { alias_module: Option, } + let file_header = "# This file is automatically generated by componentize-py +# It is not intended for manual editing. +"; + let mut interface_imports = HashMap::::new(); let mut interface_exports = HashMap::::new(); let mut world_imports = Definitions::default(); @@ -1799,7 +1803,7 @@ Result = peer.types.Result write!( file, - "{python_imports} + "{file_header}{python_imports} S = TypeVar('S') @dataclass @@ -1853,7 +1857,7 @@ Result = Union[Ok[T], Err[E]] write!( file, - "{docs}{python_imports} + "{file_header}{docs}{python_imports} from ..types import Result, Ok, Err, Some {imports} {types} @@ -1884,7 +1888,7 @@ from ..types import Result, Ok, Err, Some write!( file, - "{docs}{python_imports} + "{file_header}{docs}{python_imports} from ..types import Result, Ok, Err, Some {imports} {types} @@ -1931,7 +1935,7 @@ class {camel}(Protocol): write!( init, - "{python_imports} + "{file_header}{python_imports} from ..types import Result, Ok, Err, Some {imports} {protocols} @@ -1983,7 +1987,7 @@ from ..types import Result, Ok, Err, Some write!( file, - "{docs}{python_imports} + "{file_header}{docs}{python_imports} from .types import Result, Ok, Err, Some {imports} {type_exports}