-
Notifications
You must be signed in to change notification settings - Fork 45
chore: refactor write functions, improve CI, MSRV #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
There was a problem hiding this comment.
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 refactors code generation functions to consistently use mutable references for writers, modernizes the CI workflow with improved modularity and MSRV checking, and adds release automation.
Changes:
- Refactored all code generation functions in
src/lib.rsto accept&mut impl Writeinstead of taking ownership, improving consistency and efficiency - Completely restructured GitHub Actions CI workflow with separate jobs for testing, MSRV validation, code coverage, and automated release management via release-plz
- Enhanced justfile with new embedded target build recipes and improved MSRV testing workflow
- Simplified pattern matching in
src/pad.rsfrommatchtoif letfor better readability
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/lib.rs | Refactored ~20 functions to use &mut impl Write parameters instead of owned writers; extracted variables in writeln! calls for readability; added trailing commas for consistency |
| src/pad.rs | Simplified match expression to if-let pattern for newline position detection |
| .github/workflows/ci.yml | Complete restructure: modularized into separate jobs (test, test-msrv, coverage, release-plz) with improved caching and automated publishing |
| justfile | Added build-thumbv7em-none-eabihf and rustup-add-target recipes; updated ci-test and ci-test-msrv to include embedded builds; improved bless-generate to clear old snapshots |
| release-plz.toml | New configuration file for automated release management with workspace dependency updates |
| deny.toml | Removed Unicode-DFS-2016 from license allow-list |
| Cargo.lock.msrv | New MSRV lockfile added for testing minimum supported Rust version |
| Cargo.lock | Minor dependency update (clap_lex 0.7.6 → 0.7.7) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tegimeki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lib.rs cleanups look good, as do the CI improvements.
NOTES:
typed-builder0.23.2 requiring newer Rust, and had to be bumped to 1.88AI:
This pull request introduces several improvements and refactorings across CI configuration, the build system, and the code generation logic. The most significant changes are a major overhaul of the GitHub Actions CI workflow for better modularity and coverage, enhancements to the
justfilebuild automation, and a consistent refactoring of code generation functions to use mutable references for writers. Additionally, a new configuration file for release automation is added, and a minor license list update is made.CI/CD and Build System Improvements:
.github/workflows/ci.ymlworkflow is completely restructured: jobs are modularized intotest,test-msrv,coverage, andrelease-plz, with improved caching, MSRV (Minimum Supported Rust Version) checks, and automated publishing/PR creation for releases. The workflow now usesjustfor build orchestration and adds a job to ensure embedded target builds.justfileis enhanced: a newbuild-thumbv7em-none-eabihfrecipe is added for embedded builds, and the mainci-testandci-test-msrvrecipes now invoke this target. A helper for conditional Rust target installation is introduced, and the code generation snapshot recipe is improved to clear old snapshots before regenerating. [1] [2] [3] [4]Code Generation Refactoring:
src/lib.rsare refactored to accept&mut impl Writeinstead of taking ownership of the writer, ensuring consistency and efficiency. Associated call sites and adapter usages are updated accordingly. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]Release Automation:
release-plz.tomlfile is added to configure release automation, enabling workspace dependency updates and standardized git tag naming.Other Minor Changes:
deny.tomlis updated to removeUnicode-DFS-2016.These changes collectively improve the project's maintainability, CI reliability, and code generation consistency.