Skip to content
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

Remove try-from-macro crate #322

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

kpob
Copy link
Contributor

@kpob kpob commented Jan 17, 2024

  • remove local crate
  • add derive_try_from_ref crate from crates.io

Summary by CodeRabbit

  • Refactor
    • Updated attribute usage for improved consistency across the application.
    • Enhanced error handling for a smoother user experience.

* remove local crate
* add derive_try_from_ref crate from crates.io
Copy link
Contributor

coderabbitai bot commented Jan 17, 2024

Walkthrough

The codebase underwent a refactoring where the TryFromRef trait import was updated to a new path, and an error handling attribute was added to various structs. The attribute expressions within the structs were also updated for clarity, unifying the terminology used across different modules.

Changes

File Path Change Summary
.../src/ast/blueprint.rs, .../src/ast/deployer_item.rs, .../src/ast/exec_parts.rs Updated TryFromRef import, changed attribute expressions from item to input.
.../src/ast/... (multiple files) Replaced TryFromRef import, added #[err(syn::Error)] attribute to structs.

🐇✨
In the realm of code, a hop and a skip,
Updated paths and attributes, oh so slick.
Errors now caught with a magical flair,
Refactoring complete, with a rabbit's care. 🎩🌟

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit-tests for this file.
  • 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 tests 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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 08cf0a8 and ad1252c.
Files ignored due to path filters (3)
  • Cargo.toml is excluded by: !**/*.toml
  • odra-macros/Cargo.toml is excluded by: !**/*.toml
  • try-from-macro/Cargo.toml is excluded by: !**/*.toml
Files selected for processing (10)
  • odra-macros/src/ast/blueprint.rs (2 hunks)
  • odra-macros/src/ast/deployer_item.rs (3 hunks)
  • odra-macros/src/ast/exec_parts.rs (2 hunks)
  • odra-macros/src/ast/external_contract_item.rs (2 hunks)
  • odra-macros/src/ast/host_ref_item.rs (2 hunks)
  • odra-macros/src/ast/module_impl_item.rs (1 hunks)
  • odra-macros/src/ast/module_struct_item.rs (1 hunks)
  • odra-macros/src/ast/odra_type_item.rs (2 hunks)
  • odra-macros/src/ast/ref_item.rs (2 hunks)
  • odra-macros/src/ast/test_parts.rs (2 hunks)
Additional comments: 27
odra-macros/src/ast/module_struct_item.rs (2)
  • 6-6: The change from derive_try_from to derive_try_from_ref aligns with the PR objectives to replace the local crate with a standardized community-supported crate.
  • 10-10: The addition of #[err(syn::Error)] to ModuleStructItem is consistent with the PR's aim to enhance error handling by integrating with the syn crate's error reporting.
odra-macros/src/ast/module_impl_item.rs (3)
  • 8-8: The change from derive_try_from to derive_try_from_ref aligns with the PR objectives to replace the local crate with a standardized community-supported crate.
  • 12-12: The addition of #[err(syn::Error)] to ModuleImplItem is consistent with the PR's aim to enhance error handling by integrating with the syn crate's error reporting.
  • 14-14: The change from #[expr(item.self_code())] to #[expr(input.self_code())] likely aligns with the requirements or conventions of the newly adopted derive_try_from_ref crate.
odra-macros/src/ast/blueprint.rs (4)
  • 1-1: The change from derive_try_from to derive_try_from_ref aligns with the PR objectives to replace the local crate with a standardized community-supported crate.
  • 10-10: The addition of #[err(syn::Error)] to BlueprintItem is consistent with the PR's aim to enhance error handling by integrating with the syn crate's error reporting.
  • 12-12: The change from #[expr(utils::attr::odra_module(&item.module_str()?))] to #[expr(utils::attr::odra_module(&input.module_str()?))] likely aligns with the requirements or conventions of the newly adopted derive_try_from_ref crate.
  • 19-19: The addition of #[err(syn::Error)] to BlueprintModItem is consistent with the PR's aim to enhance error handling by integrating with the syn crate's error reporting.
odra-macros/src/ast/external_contract_item.rs (4)
  • 6-6: The change from derive_try_from to derive_try_from_ref aligns with the PR objectives to replace the local crate with a standardized community-supported crate.
  • 10-10: The addition of #[err(syn::Error)] to ExternalContractImpl is consistent with the PR's aim to enhance error handling by integrating with the syn crate's error reporting.
  • 12-12: The change from #[expr(item.self_code())] to #[expr(input.self_code())] likely aligns with the requirements or conventions of the newly adopted derive_try_from_ref crate.
  • 21-21: The addition of #[err(syn::Error)] to TestPartsItem is consistent with the PR's aim to enhance error handling by integrating with the syn crate's error reporting.
odra-macros/src/ast/deployer_item.rs (3)
  • 1-1: The change from derive_try_from to derive_try_from_ref aligns with the PR objectives to replace the local crate with a standardized community-supported crate.
  • 55-55: The addition of #[err(syn::Error)] to ContractInitFn is consistent with the PR's aim to enhance error handling by integrating with the syn crate's error reporting.
  • 73-73: The addition of #[err(syn::Error)] to DeployerItem is consistent with the PR's aim to enhance error handling by integrating with the syn crate's error reporting.
odra-macros/src/ast/ref_item.rs (2)
  • 4-4: The change from derive_try_from to derive_try_from_ref aligns with the PR objectives to replace the local crate with a standardized community-supported crate.
  • 120-120: The addition of #[err(syn::Error)] to RefItem is consistent with the PR's aim to enhance error handling by integrating with the syn crate's error reporting.
odra-macros/src/ast/exec_parts.rs (3)
  • 6-6: The change from derive_try_from to derive_try_from_ref aligns with the PR objectives to replace the local crate with a standardized community-supported crate.
  • 168-168: The addition of #[err(syn::Error)] to ExecPartsModuleItem is consistent with the PR's aim to enhance error handling by integrating with the syn crate's error reporting.
  • 172-172: The change from #[expr(item.exec_parts_mod_ident())] to #[expr(input.exec_parts_mod_ident())] likely aligns with the requirements or conventions of the newly adopted derive_try_from_ref crate.
odra-macros/src/ast/odra_type_item.rs (2)
  • 8-8: The change from derive_try_from to derive_try_from_ref aligns with the PR objectives to replace the local crate with a standardized community-supported crate.
  • 32-32: The addition of #[err(syn::Error)] to OdraTypeItem is consistent with the PR's aim to enhance error handling by integrating with the syn crate's error reporting.
odra-macros/src/ast/test_parts.rs (2)
  • 1-1: The import statement has been correctly updated to use derive_try_from_ref::TryFromRef instead of derive_try_from::TryFromRef.
  • 51-51: The addition of the #[err(syn::Error)] attribute to the TestPartsItem struct is consistent with the PR objectives to enhance error handling.
odra-macros/src/ast/host_ref_item.rs (2)
  • 2-2: The import statement in host_ref_item.rs has been updated to use derive_try_from_ref::TryFromRef, aligning with the changes in test_parts.rs.
  • 218-218: The #[err(syn::Error)] attribute has been added to the HostRefItem struct, which is in line with the PR's goal to improve error handling.

@kpob kpob merged commit 6d25380 into release/0.8.0 Jan 18, 2024
1 check passed
@kpob kpob deleted the feature/macro/remove-try-from-macro-crate branch January 18, 2024 16:26
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