Open alexfertel opened 4 months ago
Adding a bit more of color on the work needed here:
Violations can be fixable, meaning there may be a sequence of steps to fix them by bulloak
itself. For example, if a tree root is MyContract
and the contract in the solidity file is named MyBeautifulContract
, it's very easy to fix it by just renaming the contract.
In that specific issue, two roots in the same .tree
have different contract names. However, they describe functions in the same generated contract, so the roots should be the same. This is fixable by, for example, replacing every root that is not correct with whatever the contract name is in the first root.
Two changes are needed to implement this: first, making the violations fixable because they aren't by default, and then implementing the actual fix so that when we run bulloak check —-fix
, it takes violations away.
Violations can be fixable, meaning there may be a sequence of steps to fix them by
bulloak
itself. For example, if a tree root isMyContract
and the contract in the solidity file is namedMyBeautifulContract
, it's very easy to fix it by just renaming the contract.
I'm currently in a campaign to implement systematic use of Bulloak within my org, and one thing we now do to have an "easy" CI/nice dev ex is to use the suffix _Unit
in our roots (and then run all the unit test with --mc Unit
).
"Enforcing" tree root == name of the tested contract would break this then (I know, we could then match the glob path instead, but it's less straightforward/dev friendly imo). Anecdotical report tho, I don't know if others are doing something similar.
I'm currently in a campaign to implement systematic use of Bulloak within my org
Let's goooo 🚀 Please share all the feedback you have, happy to help with this.
"Enforcing" tree root == name of the tested contract would break this then
Hehe, use case for a bulloak.toml with
[lints]
matching_contract_names = "allow"
Thanks for bringing this up.
For the above tree, we get the following message when running
bulloak check
:We should make the violation fixable and implement the auto fix.