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
We currently have two crates that are generally shared between forc tools and crates we have, those are:
forc-util
forc-tracing
Use of the word util is hinting an anti-pattern has emerged in our code base and close examination of the contents after years of active development on these repos confirmed this suggestion. Currently forc-util contains:
Common error handling (ForcError)
cli_examples macro for easily writing cli tests
bytecode identifier logic
restricted checks that prevents some keywords to be used in project creation etc
Exports of common paths forc uses like user_forc_dir, git_checkouts_dir etc
Print helpers
Compiler diagnostic formatting
As it can be seen we have a wide array of things that is hosted in that repo. We should aim to distribute this and ideally eliminate calling something util to prevent this ever happening again in the future as well, as calling something util crates the unwanted piling of everything in single place.
Solution
We discussed the following:
6 and 7 can be moved to forc-tracing and that can be renamed to forc-dignostic to be a little bit more generic.
1 and 2 can go to a new crate, which will potentially call forc-types
3 should be moved to the crate it is actually called from
4 can be moved to forc-pkg as all package name etc verification stuff happens in forc-pkg
5 is undecided, either leave it as forc-util, potentially change the name of the crate
The text was updated successfully, but these errors were encountered:
We currently have two crates that are generally shared between forc tools and crates we have, those are:
forc-util
forc-tracing
Use of the word
util
is hinting an anti-pattern has emerged in our code base and close examination of the contents after years of active development on these repos confirmed this suggestion. Currentlyforc-util
contains:ForcError
)cli_examples
macro for easily writing cli testsuser_forc_dir
,git_checkouts_dir
etcAs it can be seen we have a wide array of things that is hosted in that repo. We should aim to distribute this and ideally eliminate calling something util to prevent this ever happening again in the future as well, as calling something util crates the unwanted piling of everything in single place.
Solution
We discussed the following:
forc-tracing
and that can be renamed toforc-dignostic
to be a little bit more generic.forc-types
The text was updated successfully, but these errors were encountered: