Skip to content

<excludeAnnotations> added#57

Merged
mk868 merged 1 commit intomainfrom
excludeAnnotations
Jul 18, 2025
Merged

<excludeAnnotations> added#57
mk868 merged 1 commit intomainfrom
excludeAnnotations

Conversation

@mk868
Copy link
Copy Markdown
Owner

@mk868 mk868 commented Jul 18, 2025

Related #50

Adds so that rules can skip classes/members annotated with e.g. @Entity.

  • New config option excludeAnnotations (comma-separated).
  • Applies to requireSpecifiedNullness, verifyJSpecifyAnnotations, requireNullMarked.

For sample configuration

<configuration>
  <rules>
    <requireSpecifiedNullness>
      <excludeAnnotations>jakarta.persistence.Entity</excludeAnnotations>
    </requireSpecifiedNullness>
  </rules>
</configuration>

The following class will be ignored in analysis:

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;

@Entity
public class UserEntity { // will be skipped

  @Id
  private String id;
  @Column(nullable = false)
  private String name;
  @Column(nullable = false)
  private String surname;

}

@mk868 mk868 merged commit 0bf6c97 into main Jul 18, 2025
6 checks passed
@mk868 mk868 deleted the excludeAnnotations branch July 18, 2025 22:58
@mk868 mk868 mentioned this pull request Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant