Skip to content

Bug: Fix suffix handling in RemoveViolationComments #69

@Anmol202005

Description

@Anmol202005

When RemoveViolationComments removes a violation comment, it incorrectly adds the removed comment's suffix to the last remaining comment instead of the comment that immediately precedes the removed comment.

Current behavior:
The suffix is added to the last comment in the filtered list, which may not be the actual previous comment.

Expected behavior:
The suffix should be added to the previous comment (the one that appears right before the violation comment in the original list).

InputCode

public class Test {
    // comment1
    // violation some text

    // comment2
    int x = 1;
}

Current Implementation

public class Test {
    // comment1
    // comment2

    int x = 1;
}

Expected Implementation

public class Test {
    // comment1

    // comment2
    int x = 1;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions