yatagan icon indicating copy to clipboard operation
yatagan copied to clipboard

Add an "extended validation" mode, where every framework annotation is queried and checked for valid usage

Open Jeffset opened this issue 2 years ago • 0 comments

Currently, one can use any framework annotation in any place where annotation target allows, but this "odd" usages are not validated by the framework. For example, if one uses @Conditional on a class without an inject constructor or on a builder input, or anywhere else, Yatagan won't complain, it will simply ignore such usages, because it never queries anything besides @Component annotation.

Querying all the framework annotations to validate their usage is a prudent thing to do, yet it can penalize code generation performance and build "incrementality".

The solution would be to introduce an annotation processing option, specific to the codegen backends, that enables such extensive validation. Such option can be enabled in environments less sensitive to build performance and incremental rebuilds, like CI checks.

Jeffset avatar Jan 23 '23 15:01 Jeffset