Codegen improvements - #1111
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the codegen crate to centralize/standardize how generated Rust files are written and formatted, and refreshes the checked-in generated keycode/input-event-code tables accordingly.
Changes:
- Introduces a small write-helper macro (
define_w!) and refactors generators to use it consistently. - Updates
update()to format generated output viarustfmtbefore writing, and switches generators to pass relative output paths. - Rewrites generated keycode/input-event-code mapping files to match the new formatting output.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| toml-config/src/config/keycodes/generated.rs | Regenerated keycode mapping with updated formatting/import style. |
| toml-config/src/config/input_event_codes/generated.rs | Regenerated input-event-code mapping with updated formatting/import style. |
| codegen/src/main.rs | Adds write-helper macro and updates update() to run rustfmt on output before writing. |
| codegen/src/keysyms.rs | Uses new write-helper and switches to relative output path. |
| codegen/src/input_event_codes.rs | Uses new write-helper and switches to relative output paths for all generated outputs. |
| codegen/codegen.sh | Removes separate cargo +nightly fmt step since formatting is now handled inside update(). |
| codegen/Cargo.toml | Adds tempfile dependency for formatting via a temp file. |
| Cargo.lock | Locks new dependency additions (tempfile and transitive deps). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.