Open colesnodgrass opened 11 months ago
Hi @colesnodgrass, thanks for raising the issue.
According to Diktat's code style, this behavior is expected and ANNOTATION_NEW_LINE
should not be applied to a primary constructor.
We will investigate it to try to make it configurable to support your format
Describe the bug
ANNOTATION_NEW_LINE
doesn't apply to primary constructor annotations and/orWRONG_INDENTATION
is incorrectly applied when a class only consists of a primary constructor.Given the following class
and the configuration
Expected behavior
I would expect the above code to pass analysis as is.
Observed behavior
Currently fails with the
WRONG_INDENTATION
due to the@Inject
and following lines being (correctly) indentedThis can be bypassed by moving the annotated constructor to the same line as the class declaration
However I would expect this to now fail the
ANNOTATION_NEW_LINE
rules as the@Inject
annotation isn't on a new line, but it doesn't.Steps to Reproduce
See above.
Environment information