Skip to content

codegen: unify generated-file headers across Rust/TS/Python#147

Merged
hardbyte merged 2 commits into
mainfrom
unify-generated-file-headers
May 12, 2026
Merged

codegen: unify generated-file headers across Rust/TS/Python#147
hardbyte merged 2 commits into
mainfrom
unify-generated-file-headers

Conversation

@hardbyte
Copy link
Copy Markdown
Contributor

Summary

Every generated file now starts with the same header wording, regardless of language. Previously:

  • Rust and TypeScript wrote // DO NOT MODIFY THIS FILE MANUALLY / // This file was generated by reflectapi-cli / // Schema name: … / // {description}
  • Python wrote a different sentence (This file is automatically generated by ReflectAPI), with no schema name or description
  • Python's root __init__.py used a third, one-line variant ("{pkg} client generated by ReflectAPI.")
  • generated.transport.ts had no provenance marker at all

After this PR, all generated files share the same content (rendered as // ... in Rust/TS and """...""" in Python):

DO NOT MODIFY THIS FILE MANUALLY
This file was generated by reflectapi-cli

Schema name: {schema.name}
{schema.description}    # omitted when empty

PythonGeneration now carries the schema name + description so the post-generation file renderers don't need to thread schema separately.

Test plan

  • cargo fmt, cargo clippy -p reflectapi --all-features --all-targets -D warnings, cargo test -p reflectapi --all-features all green
  • Regenerated reflectapi-demo clients; only the headers change (TS generated.ts and Rust generated.rs are unchanged byte-for-byte — see the demo snapshot diff)
  • Imported the regenerated Python demo client; module docstring renders as expected

Every generated file now starts with the same wording — "DO NOT MODIFY
THIS FILE MANUALLY" / "This file was generated by reflectapi-cli" /
"Schema name: …" / optional description — rendered as a // block in
Rust and TypeScript and as a triple-quoted docstring in Python.

Previously Python used a different sentence ("automatically generated
by ReflectAPI"), its root __init__.py used a one-line docstring with
no provenance marker, and generated.transport.ts had no header at all.
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.

Once credits are available, reopen this pull request to trigger a review.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

📖 Documentation Preview: https://reflectapi-docs-preview-pr-147.partly.workers.dev

Updated automatically from commit bdcb638

@hardbyte hardbyte merged commit 9fbf17e into main May 12, 2026
5 checks passed
@hardbyte hardbyte deleted the unify-generated-file-headers branch May 12, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant