Skip to content

Violate all inlined violations that are placed in between method singature and annoation or javadoc #19757

@romani

Description

@romani

Find a way to fail build on cases of //violation .... usage in between of method javadoc java annotations and method signatures
We should keep target code as natural as possible to not let violation comment to do side effect to violation and let users recognize problems as in real code and comment around just hint on what is wrong.

bad

/** 
 * This Javadoc contains unclosed tag.
 * <code>unclosed 'code' tag<code>
 */
 // violation 2 lines above 'Unclosed HTML tag found: <code>'
void foo() {}

good:

// violation 3 lines below 'Unclosed HTML tag found: <code>'
/** 
 * This Javadoc contains unclosed tag.
 * <code>unclosed 'code' tag<code>
 */
void foo() {}

bad

@Override
 // violation above 'xxx'
void foo() {}

good:

 // violation below 'xxx'
@Override
void foo() {}

Some Xpath Check should help us to do this.
All Inputs should comply with this rule.
In scope of this issue we should make some Check instance, fix few, if there is alot and make suppression list to let massive update later on (we can create new issue, mark it as good first issue).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions