dojo
dojo copied to clipboard
Implement/derive `Debug` for public types
Is your feature request related to a problem? Please describe.
It is convenient to expose a Debug
method on all types that are public in order to make interaction with the outside easier. Some repository types like TestSequencer
https://github.com/dojoengine/dojo/blob/89a5b9eb31a32e58a0429b7d17151361cb09f746/crates/dojo-test-utils/src/sequencer.rs#L29-L35
for example do not have this implementation provided.
Describe the solution you'd like
I think we should enforce the Debug
implementation for all types made public. To facilitate this and be sure of the long-term continuation of this good practice, we could add the following lint https://doc.rust-lang.org/stable/nightly-rustc/rustc_lint/builtin/static.MISSING_DEBUG_IMPLEMENTATIONS.html to the Clippy script so that a rule violation is automatically detected by the CI.
hello @tcoratger, i would love to work on this
hello @tcoratger, i would love to work on this
Do you have any question @g4titanx before starting on this?
- [ ] add the clippy check.
- [ ] derive
Debug
on public type. You may try to add a commit for each crate to ensure easier revision.
yeah, can you elaborate the clip check issue
yeah, can you elaborate the clip check issue
clippy
check sorry, just reworded it. As mentioned by @tcoratger the idea is to ensure the linting step of the CI can detect a missing Debug
on a public type.
yeah, can you elaborate the clip check issue
clippy
check sorry, just reworded it. As mentioned by @tcoratger the idea is to ensure the linting step of the CI can detect a missingDebug
on a public type.
@g4titanx Yes, this check does this job for example: https://github.com/paradigmxyz/reth/blob/bd4757b3b53022f871872790c27aa571d2ec2fdb/Cargo.toml#L96
yeah, can you elaborate the clip check issue
clippy
check sorry, just reworded it. As mentioned by @tcoratger the idea is to ensure the linting step of the CI can detect a missingDebug
on a public type.
okay, great! i would reach out to you if I need more explanation
yeah, can you elaborate the clip check issue
clippy
check sorry, just reworded it. As mentioned by @tcoratger the idea is to ensure the linting step of the CI can detect a missingDebug
on a public type.@g4titanx Yes, this check does this job for example: https://github.com/paradigmxyz/reth/blob/bd4757b3b53022f871872790c27aa571d2ec2fdb/Cargo.toml#L96
yeah, I would use this as a reference
yeah, can you elaborate the clip check issue
clippy
check sorry, just reworded it. As mentioned by @tcoratger the idea is to ensure the linting step of the CI can detect a missingDebug
on a public type.@g4titanx Yes, this check does this job for example: https://github.com/paradigmxyz/reth/blob/bd4757b3b53022f871872790c27aa571d2ec2fdb/Cargo.toml#L96
yeah, I would use this as a reference
I would say, if possible, this is better to apply this rule for the entire project.
okay, great!
hey man! i have fixed this issue on my PC but I am having issue compiling as I am using a low ram computer. you can unassign me as I have tried every means to make this. i used a devcontainer too
hey man! i have fixed this issue on my PC but I am having issue compiling as I am using a low ram computer. you can unassign me as I have tried every means to make this. i used a devcontainer too
Arg.. sorry to hear. You can specify a package if you want to limit ram consumption using the -p
option while using cargo build
or cargo run
.
Also, do not hesitate to open the PR, this will help anyway. Appreciate your time and effort on this.