Skip to content

@rpglint-skip not working for multi-location errors (e.g. StringLiteralDupe, NoUnreferenced) #484

@kluhan

Description

@kluhan

Description

When using the @rpglint-skip or @rpglint-skip-rules annotation, some error types are not skipped as expected.

This seems to affect rules that report multiple locations for a single logical issue, such as:

  • StringLiteralDupe
  • NoUnreferenced
  • IncorrectVariableCase

Even when the annotation is placed correctly, errors are still reported for lines that should be skipped.

Example

**free
dcl-s myVar char(10);

// @rpglint-skip
myvar = 'first';

myvar = 'second';

return;

Expected Behavior

Only one IncorrectVariableCase error should be reported (for the second assignment).

The first assignment (myvar = 'first';) should be skipped due to the @rpglint-skip annotation.

Actual Behavior

Two IncorrectVariableCase errors are reported:

  • One for myvar = 'first'; (should be skipped)
  • One for myvar = 'second';

Additional Context

This behavior appears to occur with rules that perform some lookup logic. If all errors for a Literal are skiped it gain works like intended.


I'm already working on a solution. The PR should be ready by tomorrow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions