Skip to content

Support return Refaster.anyOf(...) #21

@timtebeek

Description

@timtebeek

What problem are you trying to solve?

Right now we skip all refaster rules using any form of Refaster.anyOf(...), whereas we could potentially cover return Refaster.anyOf(...) with less effort as compared to supporting Refaster.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 cover return Refaster.anyOf as seen here.

@BeforeTemplate
boolean before(Map<K, V> map) {
  return Refaster.anyOf(map.keySet(), map.values(), map.entrySet()).isEmpty();
}

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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions