Skip to content

Conversation

@ccamel
Copy link
Member

@ccamel ccamel commented Apr 27, 2025

Order must be preserved. The derives are now sorted.

  • format-rust now runs cargo fmt + cargo sort-derives
  • lint-rust-format now checks both Rust formatting and derive ordering
  • reformatted codebase accordingly
  • Rust upgraded to 1.81.

Summary by CodeRabbit

  • Chores
    • Standardized the order of trait derivations (e.g., Clone, Debug, Eq, PartialEq, Serialize, Deserialize, etc.) across multiple structs and enums for improved consistency.
    • Added a configuration file for derive sorting.
    • Updated formatting and linting tasks to check and enforce derive order in addition to code formatting.
    • No changes to public interfaces or functionality.

@ccamel ccamel self-assigned this Apr 27, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 27, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update introduces a new .sort-derives.toml configuration file and integrates the cargo-sort-derives tool into the Rust formatting and linting workflow via the Makefile.toml. Across multiple Rust source files in various contracts and packages, the derive attribute macros on structs and enums are reordered for consistency. The changes do not alter logic, signatures, or public APIs but standardize the sequence of trait derivations. No new entities are introduced, and no functional or behavioral modifications are made to the codebase.

Changes

File(s) Change Summary
.sort-derives.toml Added configuration file for derive sorting with exclude and preserve settings.
Makefile.toml Integrated cargo-sort-derives into Rust formatting/linting tasks and added installation task for the tool.
contracts/axone-cognitarium/src/error.rs
contracts/axone-dataverse/src/error.rs
contracts/axone-dataverse/src/credential/error.rs
contracts/axone-law-stone/src/error.rs
contracts/axone-objectarium/src/error.rs
packages/axone-logic-bindings/src/error.rs
packages/axone-rdf/src/serde.rs
packages/axone-wasm/src/error.rs
templates/axone-smart-contract/{{ contract_name }}/src/error.rs
Reordered derive attribute macros on error enums, typically moving Debug before Error or adjusting sequence for consistency.
contracts/axone-cognitarium/src/msg.rs
contracts/axone-objectarium/src/msg.rs
Changed derive order on builder structs, swapping positions of Default and Builder.
contracts/axone-cognitarium/src/querier/expression.rs
contracts/axone-cognitarium/src/querier/plan.rs
contracts/axone-cognitarium/src/querier/variable.rs
Reordered derive macros on enums and structs to a consistent sequence, e.g., Clone, Debug, Eq, PartialEq.
contracts/axone-cognitarium/src/rdf/atom.rs
contracts/axone-cognitarium/src/state/namespaces.rs
contracts/axone-cognitarium/src/state/store.rs
contracts/axone-cognitarium/src/state/triples.rs
contracts/axone-dataverse/src/state.rs
contracts/axone-law-stone/src/state.rs
contracts/axone-objectarium/src/state.rs
packages/axone-logic-bindings/src/query.rs
packages/axone-logic-bindings/src/term_parser.rs
packages/axone-objectarium-client/src/object.rs
packages/axone-rdf/src/dataset.rs
packages/axone-rdf/src/normalize.rs
packages/axone-wasm/src/uri.rs
Reordered derive macros on multiple structs and enums for uniformity; no changes to fields, logic, or public API.
contracts/axone-dataverse/src/credential/proof.rs Reordered derive macros on enums to place Clone and Copy before Debug and PartialEq.
contracts/axone-objectarium/src/compress.rs Reordered derive macros on CompressionAlgorithm and CompressionError enums for consistent trait sequence.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Makefile
    participant CargoFmt
    participant CargoSortDerives

    Developer->>Makefile: Run format-rust or lint-rust-format
    Makefile->>CargoSortDerives: Ensure cargo-sort-derives is installed
    Makefile->>CargoFmt: Run cargo fmt (or cargo fmt --check)
    Makefile->>CargoSortDerives: Run cargo sort-derives (or cargo sort-derives --check)
Loading

This diagram illustrates the updated formatting and linting workflow, where both standard Rust formatting and derive attribute sorting are enforced.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link

codecov bot commented Apr 27, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
contracts/axone-cognitarium/src/msg.rs 0.00% 1 Missing ⚠️
contracts/axone-objectarium/src/compress.rs 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
contracts/axone-cognitarium/src/error.rs 0.00% <ø> (-13.34%) ⬇️
...tracts/axone-cognitarium/src/querier/expression.rs 100.00% <ø> (ø)
contracts/axone-cognitarium/src/querier/plan.rs 92.37% <ø> (-0.37%) ⬇️
...ontracts/axone-cognitarium/src/querier/variable.rs 99.75% <ø> (-0.01%) ⬇️
contracts/axone-cognitarium/src/rdf/atom.rs 100.00% <ø> (+2.02%) ⬆️
...ontracts/axone-cognitarium/src/state/namespaces.rs 94.08% <ø> (-0.03%) ⬇️
contracts/axone-cognitarium/src/state/store.rs 100.00% <ø> (ø)
contracts/axone-cognitarium/src/state/triples.rs 100.00% <100.00%> (ø)
contracts/axone-dataverse/src/credential/proof.rs 87.61% <ø> (+1.23%) ⬆️
contracts/axone-law-stone/src/state.rs 100.00% <ø> (ø)
... and 12 more

... and 20 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bot-anik
Copy link
Member

bot-anik commented Apr 27, 2025

size-limit report 📦

Path Size
target/wasm32-unknown-unknown/release/axone_objectarium.wasm 452.47 KB (0%)
target/wasm32-unknown-unknown/release/axone_law_stone.wasm 585.47 KB (0%)
target/wasm32-unknown-unknown/release/axone_cognitarium.wasm 878.12 KB (0%)
target/wasm32-unknown-unknown/release/axone_dataverse.wasm 672.24 KB (0%)

@ccamel ccamel merged commit 371bd2f into main Apr 27, 2025
18 of 19 checks passed
@ccamel ccamel deleted the build/derives-sorted branch April 27, 2025 18:25
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