Closed smol-ninja closed 4 weeks ago
Here's an example of shared modifiers in Sablier:
Sounds reasonable 👍 Will work on it!
Alternatively, other than ignoring, it would be helpful if Bulloak could infer that the modifier is imported in the file, and don't throw any warning.
@alexfertel is there any ETA on this feature?
I would also like to commend you on writing this library. Bulloak has made life so much easier for me. I can just run the command and find missing or incorrectly named tests 🥳.
Let me know if I can support you with a small donation.
Thanks for the kind words! I'm happy it's been a helpful tool for you.
is there any ETA on this feature?
Unfortunately, I've been quite busy, so I'm not sure when I'll get some time to work on this. Sorry for the trouble.
Feel free to give this a shot in the meantime. Otherwise, I'll try to work on it soon.
@alexfertel Sablier donated 500 USDC to you:
https://arbiscan.io/tx/0xde2b3b782ca03b5898a9ed4c91134c5635ad81cc59bf596db99461e6bb562b51
Wow, thank you! I was not expecting that 🙇♂️
@smol-ninja would you mind installing bulloak
from git
and checking if your workflow works with the --skip-modifiers
flag?
I did a few tests, but I'm not sure if I covered your use cases. If I missed anything lmk, I'll wait for your feedback before cutting a release.
Hey @alexfertel I tested the latest code, and it works great. Both scaffold
and check
are able to skip modifiers with the flag. This is just perfect.
Thank you so much and have a great evening.
Great! I'm glad it works well 😌
I'll cut a release first thing tomorrow morn so that you can install as usual.
Background
Bulloak treats test contracts independently from one another. This design choice necessitates defining modifiers within the same file as the test contract. However, in large projects where modifiers are shared among tests, this contradicts the principle of DRY.
Feature Request
Introduce an option to disregard modifier definitions in the test contract. This can be achieved by including a flag, such as
--ignore-modifiers
.Bulloak should still include the modifier names in test functions, but it should not strictly require them to be defined in the same file.