-
Notifications
You must be signed in to change notification settings - Fork 300
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
Empty rule verification should not apply to noMethods/noClasses #806
Comments
I understand your issue, I guess this is similar to #808. We probably have to make this overridable per rule.
and it would work as expected even with For now to make your rule work as before you can simply put an Unfortunately this will always be a trade-off. Before there have been many issues about people requesting a way to verify that their rules really test something (e.g. if you refactor the package of your main code). On the other hand this can now bring some inconvenience for cases where it is justified to not have any |
This is a nice example of how a rule using noMethods can be rewritten to work well with the new feature. Maybe you can add it to the user manual? |
I'm closing this issue as suggestion of rewriting my rules from #806 (comment) worked for me. |
#774 should not be executed for rules written using noMethods/noClasses. Otherwise those methods make no sense: I want to guard against illegal code appearing in my codebase. If there is no code matching what I the rule defines, it's a success, not an error.
Imagine I have a rule checking I don't write broken JUnit 5 tests:
Now some bad code:
The architecture test detects this bad code. But now fix the bad test: remove
wrong
method together with its annotation. The architecture test will start to fail (withcom.tngtech.archunit:archunit-junit5:0.23.0
):This is a regression in 0.23.0. The architecture rule worked correctly in 0.22.0.
The text was updated successfully, but these errors were encountered: