-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support return Refaster.anyOf(...)
#21
Comments
Had a brief look at adding this one over the weekend; the easiest case to tackle is likely something like this: public class RefasterAnyOf {
@BeforeTemplate
boolean before(String s) {
return Refaster.anyOf(s.length() < 1, s.length() == 0);
}
@AfterTemplate
boolean after(String s) {
return s.isEmpty();
}
} And then ideally turn that into something similar to the multiple before statements we already know:
Implementation wise there's the slight challenge of the |
The arguments to |
Fixed in #76 |
It also works when the |
What problem are you trying to solve?
Right now we skip all refaster rules using any form of
Refaster.anyOf(...)
, whereas we could potentially coverreturn Refaster.anyOf(...)
with less effort as compared to supportingRefaster.anyOf(...)
anywhere in template for matches.This will allow us to cover additional rules defined in PicnicSupermarket/error-prone-support, as discovered in #5 (comment).
Describe the solution you'd like
We already support multiple
@BeforeTemplate
annotated methods. We should expand support for multiple before statements to coverreturn Refaster.anyOf
as seen here.Refaster.anyOf(...)
used anywhere else but in the return, repeatedly, or with preceding statements is left out of scope for now.Have you considered any alternatives or workarounds?
Not yet.
Additional context
The text was updated successfully, but these errors were encountered: