Skip to content

Introduce DuplicateAnnotationListing bug checker #1044

Open
@mohamedsamehsalah

Description

@mohamedsamehsalah

Problem

Duplicate entries inside annotation listing are a common mistake that should be flagged.

Description of the proposed new feature

  • Support a stylistic preference.
  • Avoid a common gotcha, or potential problem.
  • Improve performance.

Introduce a new BugChecker to flag duplicate entries as this is a common mistake. Similar to LexicographicalAnnotationListing, the new BugChecker should identify and handle duplicate entries to improve code quality and reduce potential errors.

I would like to rewrite the following code:

            @A("foo", "bar", "foo")
            A duplicateAnnotations();

to:

            @A("foo", "bar")
            A duplicateAnnotations();

Considerations

👉 To consider: A duplicate entry is a duplicate pointer reference and not just the same name.
👉 Open question: Are there situations where we do not want to flag this ?

Participation

  • I am willing to submit a pull request to implement this improvement.

Additional context

See this comment.


Edit 1: Update requirements based on this.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions