Sitelet https://github.com/alloy-rs/examples/pull/32
Skip to content

[Debt] Improve consistency of best practice application - #32

Merged
zerosnacks merged 24 commits into
mainfrom
zerosnacks/improve-consistency-of-best-practice-application
Mar 28, 2024
Merged

zerosnacks merged 24 commits into
mainfrom
zerosnacks/improve-consistency-of-best-practice-application

Conversation

@zerosnacks

@zerosnacks zerosnacks commented Mar 27, 2024 •

Copy link
Copy Markdown
Contributor

Closes #30

Apologies for the large file diff, it was unavoidable.

Largely cosmetic changes aimed at increasing consistency across examples.
This helps create a basic style guide to roughly follow for outside contributors.

  • Adds clippy lint rules in workspace root, use the same configuration as Reth. In addition warn on uninlined_format_args
  • Use consistent way of setting up example environment (anvil, provider) where applicable
  • Use ? instead of .unwrap() across all examples
  • url -> rpc_url
  • Refer to tx_request as tx, pending as pending_tx
  • Refer to transaction sending as sending, not broadcast
  • Consistently group code blocks with explaining comment - treat each example as if it is to be understood on its own. Each example should have more detailed comments at the code block it focuses on, less on the setup.
  • In most cases, refer to signer instead of wallet
  • Use Alice and Bob if referring to a from and to pair, if singular from prefer unnamed
  • End comments with a .

Should contain no breaking changes and fundamental changes in behaviour.

@DaniPopes DaniPopes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice

Comment thread examples/transactions/examples/trace_transaction.rs Outdated
Comment thread examples/transactions/examples/trace_transaction.rs Outdated
@zerosnacks
zerosnacks merged commit e716e94 into main Mar 28, 2024
@zerosnacks
zerosnacks deleted the zerosnacks/improve-consistency-of-best-practice-application branch March 28, 2024 08:38
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.

[Debt] Improve consistency and best practices across examples

2 participants