Skip to content

Commit 1bf9cf2

Browse files
committed
generated file notifies users not to edit file
Signed-off-by: Aminu 'Seun Joshua <seun.aminujoshua@gmail.com>
1 parent efce864 commit 1bf9cf2

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/summary.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,11 @@ impl<'a> Summary<'a> {
11631163
alias_module: Option<String>,
11641164
}
11651165

1166+
let file_header = "
1167+
# This file is automatically generated by componentize-py
1168+
# It is not intended for manual editing.
1169+
";
1170+
11661171
let mut interface_imports = HashMap::<InterfaceId, Definitions>::new();
11671172
let mut interface_exports = HashMap::<InterfaceId, Definitions>::new();
11681173
let mut world_imports = Definitions::default();
@@ -1799,7 +1804,7 @@ Result = peer.types.Result
17991804

18001805
write!(
18011806
file,
1802-
"{python_imports}
1807+
"{file_header}{python_imports}
18031808
18041809
S = TypeVar('S')
18051810
@dataclass
@@ -1853,7 +1858,7 @@ Result = Union[Ok[T], Err[E]]
18531858

18541859
write!(
18551860
file,
1856-
"{docs}{python_imports}
1861+
"{file_header}{docs}{python_imports}
18571862
from ..types import Result, Ok, Err, Some
18581863
{imports}
18591864
{types}
@@ -1884,7 +1889,7 @@ from ..types import Result, Ok, Err, Some
18841889

18851890
write!(
18861891
file,
1887-
"{docs}{python_imports}
1892+
"{file_header}{docs}{python_imports}
18881893
from ..types import Result, Ok, Err, Some
18891894
{imports}
18901895
{types}
@@ -1931,7 +1936,7 @@ class {camel}(Protocol):
19311936

19321937
write!(
19331938
init,
1934-
"{python_imports}
1939+
"{file_header}{python_imports}
19351940
from ..types import Result, Ok, Err, Some
19361941
{imports}
19371942
{protocols}
@@ -1983,7 +1988,7 @@ from ..types import Result, Ok, Err, Some
19831988

19841989
write!(
19851990
file,
1986-
"{docs}{python_imports}
1991+
"{file_header}{docs}{python_imports}
19871992
from .types import Result, Ok, Err, Some
19881993
{imports}
19891994
{type_exports}

0 commit comments

Comments
 (0)