fix(compiler): wrap long generated lines#3799
Draft
jamalasidd wants to merge 6 commits into
Draft
Conversation
Author
|
Hi, this is my first contribution to Apache Fory. I opened this PR as a draft while I finish the AI review checklist. I noticed the PR template references git show upstream/main:.claude/skills/fory-code-review/SKILL.mdand got: Could someone point me to the current Fory-guided review instructions I should use for the required |
Contributor
|
Hii @jamalasidd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
Issue #3233 asks for generated code to include clear generated-file headers and better line breaking. In my local reproduction, the generated-file notice was already present, but generated output still contained long lines over 80 characters across multiple languages.
This PR focuses on the reproducible long-line formatting part of the issue. The changes update specific generator patterns such as Java builder chains, Go
fory.New(...)calls, Pythonpyfory.field(...)output, Rust helper/type lines, and C++ generated method/macro lines.What does this PR do?
This PR improves generated code formatting for Apache Fory compiler output by wrapping long generated lines in several language generators. It adds targeted, language-safe line breaks in the Java, Go, Python, Rust, and C++ generators instead of using a generic line wrapper that could break syntax.
The implementation keeps the changes focused on generated output formatting and avoids changing generated behavior.
Related issues
AI Contribution Checklist
yesai_reviewevidence has been completed.AI Usage Disclosure
Substantial AI assistance was used for this PR. I used AI assistance to help understand the issue, trace generated long lines back to language-specific generator code, suggest safe language-specific line-break changes, debug local testing commands, and organize the PR/README documentation.
I reviewed the suggested code changes manually, applied them locally, regenerated compiler output, and tested the reproduction case before committing the changes. The implementation decisions and final submitted code were reviewed and accepted by me before submission.
ai_review Summary
Pending before requesting maintainer review.
upstream/mainand.claude/skills/fory-code-review/SKILL.mddoes not currently exist there.Does this PR introduce any user-facing change?
This PR changes generated source formatting only. It is not intended to change public APIs, binary protocol behavior, or generated runtime behavior.
Benchmark
No benchmark was run. This PR changes compiler-generated source formatting and is not expected to affect runtime performance.
Testing
I tested this manually using a small reproduction schema:
Generated code with:
Then checked for generated lines longer than 80 characters with:
After these changes, the checker produced no long-line output for the reproduced generated files.