You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This blog post describes how to add project-specific lints to clippy using the Dylint crate. We should evaluate if it's possible to use this crate for implementing custom ink! lints.
A scenario that comes to my mind is the usage of accidental nested lazy data structures. For example, our collections in ink_storage are lazy anyway. So e.g. Lazy<Vec<u32>> doesn't provide additional benefits, but instead only adds computation overhead. It should be possible to access this type information using LateLintPass("[…] the LateLintPass has access to type information while the EarlyLintPass doesn't", source).
ToDo
Make cargo contract run a custom lint before each build/check.
The lint should output a warning (error?) if X in Lazy<X> is from ink_storage::collections.
The text was updated successfully, but these errors were encountered:
A scenario that comes to my mind is the usage of accidental nested lazy data structures. For example, our collections in ink_storage are lazy anyway. So e.g. Lazy<Vec> doesn't provide additional benefits, but instead only adds computation overhead. It should be possible to access this type information using LateLintPass("[…] the LateLintPass has access to type information while the EarlyLintPass doesn't", source).
Sounds like a really good prototype in order to see if the approach works for our use case.
This blog post describes how to add project-specific lints to clippy using the Dylint crate. We should evaluate if it's possible to use this crate for implementing custom ink! lints.
A scenario that comes to my mind is the usage of accidental nested lazy data structures. For example, our collections in
ink_storage
are lazy anyway. So e.g.Lazy<Vec<u32>>
doesn't provide additional benefits, but instead only adds computation overhead. It should be possible to access this type information usingLateLintPass
("[…] the LateLintPass has access to type information while the EarlyLintPass doesn't", source).ToDo
cargo contract
run a custom lint before eachbuild
/check
.X
inLazy<X>
is fromink_storage::collections
.The text was updated successfully, but these errors were encountered: