Closed mds1 closed 7 months ago
Yes, this definitely improves DX. I need to give it some thought because I'm not that happy with the current bulloak -wf
flow, and this change would surely influence that part of the API.
Well, this is a bit harder than I anticipated because a few things I need from solang_parser
are missing. I'll see if there is a solidity parser I can use, otherwise, I'll write one.
Ok, ended up using solang_parser
but patched a few things on top, leveraging forge-fmt
. This commit is a good foundation for this feature.
You can try it out with bulloak check --fix --stdout
and let me know what you think!
This is a half-baked idea, but the thinking is:
.tree
file andbulloak -w <file>
.tree
file, now my test is out of dateI'm picturing a
bulloak check --fix
orbulloak update
command that, if I only added or moved lines in the tree, regenerates my test file with the code properly moved also. If lines were also changed, perhaps what it can do is something like this: