Repository navigation
Simplify formatting, tests, and CI - #50
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR streamlines hex formatting code generation in derive-hex, refactors tests to use clearer golden vectors/fixtures, and consolidates CI into a single Makefile target to reduce repeated runner setup in this foundational serialization workspace.
Changes:
- Simplify generated
LowerHex/UpperHexformatting loops and drop an unnecessary direct dependency inderive-hex. - Replace repetitive primitive test matrices with explicit bidirectional golden vectors; add parsing and const-vs-runtime fixtures.
- Collapse multiple CI jobs into a single reusable-workflow invocation that runs a unified
make citarget.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Makefile | Adds a ci target that runs quality, tests, no-std build, and docs in one go. |
| dusk-bytes/tests/serialize_test.rs | Refactors primitive serialization tests into golden vectors and reduces repetition. |
| dusk-bytes/tests/parse_test.rs | Adds coverage for length/invalid-char errors, uppercase hex parsing, and const-vs-runtime fixtures. |
| derive-hex/tests/hex_test.rs | Consolidates formatting assertions into a single test. |
| derive-hex/src/lib.rs | Simplifies generated formatting loops and adjusts HexDebug internals. |
| derive-hex/Cargo.toml | Removes the direct proc-macro2 dependency. |
| .github/workflows/dusk_ci.yml | Replaces multiple jobs with a single job invoking make ci. |
Suppressed comments (2)
derive-hex/src/lib.rs:38
- Same hygiene concern as the
LowerHeximpl: prefer absolute::core::paths and qualify::core::write!so the generated code cannot be broken by name shadowing in downstream crates.
impl core::fmt::UpperHex for #ident {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
if f.alternate() {
write!(f, "0x")?
}
for byte in self.to_bytes() {
write!(f, "{byte:02X}")?
}
derive-hex/src/lib.rs:66
- The generated
Debugimpl also uses non-absolutecore::paths. Using::core::avoids downstream name shadowing and keeps the proc-macro output more robust.
impl core::fmt::Debug for #ident {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
// `Formatter` does not publicly expose the debug-hex case. Bit 5 is
// `FlagV1::DebugUpperHex` in `core`:
// <https://github.com/rust-lang/rust/blob/90442458ac46b1d5eed752c316da25450f67285b/library/core/src/fmt/mod.rs#L1817-L1825>
const DEBUG_UPPER_HEX: u32 = 1 << 5;
#[allow(deprecated)]
if f.flags() & DEBUG_UPPER_HEX != 0 {
core::fmt::UpperHex::fmt(self, f)
} else { // LowerHex is always the default for debug
core::fmt::LowerHex::fmt(self, f)
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
HDauven
force-pushed
the
cleanup/simplify-tests-ci
branch
from
August 25, 2026 10:49
44e7231 to
b6e8eb2
Compare
HDauven
marked this pull request as ready for review
August 25, 2026 10:49
Neotamandua
approved these changes
Aug 25, 2026
HDauven
force-pushed
the
cleanup/simplify-tests-ci
branch
from
August 25, 2026 11:00
b6e8eb2 to
54becce
Compare
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.
Summary
The resulting diff removes 166 net lines. Line coverage rises from 86.4% to 92.8%, region coverage from 88.9% to 95.0%, and function coverage reaches 100%.