Repository navigation
Keep code reordering within region boundaries - #368
niangaoxiao wants to merge 2 commits into
Conversation
|
Did you work on the code or was it entirely automated? From the description, it seems that it was fully automated. |
|
Yes, it was automated using OpenAI Codex. |
|
Thanks for letting me know. Then I'm gonna close the PR; I was working on a refactor of this reorder module, and if this is generated then I'd prefer to continue with a cleanup and simplification of the module and add the feature afterward or alongside that. While the code works technically, it has some odd things but it makes sense why if it was vibe coded. As I'm sure you'll understand, when it comes to contributions, the human involvement is really important. At least to me. Because anyone could run an automation on an existing ticket, especially a project's maintainer. I don't know yet how to document that for contributors; I'd like to foster a culture of strong human involvement, even if people use LLMs a lot. Anyway, thanks at least for trying to contribute a wanted feature to the project. I'll take care of this one ASAP as it seems a bunch of people would appreciate this one in particular. |
|
Thanks for your reply. Either way, I'm glad to see the project improve. I'm a beginner, and I felt that AI could do a better job than I could, so I used it to help implement this feature. |
--reorder-codecan move declarations across#region/#endregion, including moving_input()outside the Godot Hooks region in #149. This change keeps markers fixed and reorders each section independently, following the per-section default discussed in the issue.Please check if the PR fulfills these requirements:
Related issue: Fixes #149.
What kind of change does this PR introduce?
A code-reordering fix with regression coverage and user documentation.
Does this PR introduce a breaking change?
Reorder output intentionally changes for files containing top-level regions: declarations stay in their original sections instead of moving across markers. CLI and library signatures are unchanged.
New feature or change
What is the current behavior?
Region markers are attached to nearby declarations and move independently when declarations are sorted. This can move code out of a region, move code from elsewhere into it, or lose markers in empty/comment-only sections.
What is the new behavior?
# fmt: off.godot_error!as statements in match-arm blocks and give the private base field a distinct name so godot-rust's generated initializer avoids redundant field names. Automatic initialization, singleton registration, and error-handling behavior are preserved.Other information
Validated on Windows with Rust 1.99.1:
cargo fmt --all --check: passed.cargo clippy --locked --workspace --all-targets -- -D warnings: passed, zero warnings/errors.cargo build --locked --workspace --all-targets: passed, zero warnings/errors.cargo test --locked --workspace --all-targets: 281 passed, 0 failed, including 27 reorder cases.git diff --check: passed.AI assistance: The implementation and tests were prepared with OpenAI Codex and independently reviewed by a second coding agent. All validation described above was executed locally.