Skip to content

Commit 424b98e

Browse files
committed
build(sync-gen): do not abort generation when unasyncd rewrites files
unasyncd exits non-zero whenever it transforms a file, the way a formatter signals "changed". Since run() defaulted to fatal, the very run that did the work aborted before restore_all_blocks() and before ruff normalized the generated tree — so `make sync-gen` failed on every real change and had to be run twice to produce a correct result.
1 parent 0d391fc commit 424b98e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/gen_sync.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ def restore_all_blocks() -> int:
5050

5151

5252
def main() -> None:
53-
run("uv", "run", "unasyncd")
53+
# unasyncd exits non-zero whenever it rewrites a file, the way a
54+
# formatter signals "changed". That is the normal case here, so it
55+
# must not abort the post-processing below.
56+
run("uv", "run", "unasyncd", fatal=False)
5457
restored = restore_all_blocks()
5558
print(f"Restored __all__ in {restored} generated files")
5659
# Remaining findings are silenced via per-file-ignores in ruff.toml;

0 commit comments

Comments
 (0)