-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Naming Check #80
Comments
Hey @startswithaj ! Thanks for using
Right, so this mainly refers to having different names in the spec vs the test. If I understand correctly, you only renamed it in the .sol, but not in the spec. If this is the case, just doing:
Should suffice. |
Do you think we should change the error message a bit? If so, how would you rephrase it to make it easier to understand? |
Heya @alexfertel thanks heaps for your reply. Nar nar your error message made complete sense. I understood what the issue is/was. It just didn't feel semantic to write:
or
It seemed better to write
Because that is what we are testing. And then have the file name as MyErc20.t.sol. Then inside the file have it I thought there might be some way are the start of the all the trees to give it the Test Contract name.
If we use
Where as I would prefer:
Hope that makes sense. Cheers |
Ah, I see what you mean. That makes sense. Note that the name of the The idea right now is that users follow Foundry's best practices which means that your test contract would be named I don't have a good solution here, other than automatically appending This is also a breaking change, so I'd rather get this right, and publish v0.8.0, so this may take a while to see production. |
Yeah I think what you are suggesting is ideal. We're on the same page. FWIW, I actually found bulloak via https://github.com/defi-wonderland/solidity-foundry-boilerplate (https://github.com/defi-wonderland/solidity-foundry-boilerplate/blob/main/test/unit/Greeter.t.sol) and just cloned that repo to see if they get an error because I based my layout on that example. They do too: I guess instead of it being a breaking change you could support both? I'd love to see how others are using bulloak if you know of any other good example repos or public repos using it. Cheers, |
One other question, just while were in the swing of things if I could... Take:
Will generate a test:
In the foundry best practices doc it says:
What would be the correct way to write the tree to get this test name? Thanks again |
Oh, interesting. Maybe they are open to tweaking the template after this is fixed.
Well, yeah, we could add a flag. Need to think what that would look like, but it shouldn't be a big lift. I thought of it as a breaking change at first, because we also want users to fall into the pit of success. I think this is small enough of a change (and fixable with bulloak check!) that a breaking change is fine.
The best example I can think of right now is CreateX.
Try
|
Hey @alexfertel thank you for taking the time to develop bulloak its very much apprecaited.
This is more of a question/issue.
Take the following tree
Bulloak wants the test to be Called
MyErc20
, but the Contract we are testing is calledMyErc20
If I call my test contract
UnitMyErc20
bulloak will report oncheck
What is the best course of action here?
The text was updated successfully, but these errors were encountered: