Skip to content

Codegen improvements - #1111

Merged
mahkoh merged 3 commits into
masterfrom
jorth/codegen-improvements
Jul 19, 2026
Merged

Codegen improvements#1111
mahkoh merged 3 commits into
masterfrom
jorth/codegen-improvements

Conversation

@mahkoh

@mahkoh mahkoh commented Jul 19, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 19, 2026 12:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 via rustfmt before 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.

Comment thread codegen/Cargo.toml
@mahkoh
mahkoh merged commit 486e0dd into master Jul 19, 2026
14 checks passed
@mahkoh
mahkoh deleted the jorth/codegen-improvements branch July 19, 2026 13:04
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.

2 participants