Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An interface should not have attributes. #33

Closed
4 tasks done
Luro02 opened this issue Jan 13, 2023 · 0 comments · Fixed by #46
Closed
4 tasks done

An interface should not have attributes. #33

Luro02 opened this issue Jan 13, 2023 · 0 comments · Fixed by #46
Assignees
Labels
D-easy Easy to implement. good first issue Good for newcomers new-lint A new lint.

Comments

@Luro02
Copy link
Collaborator

Luro02 commented Jan 13, 2023

An interface

  • should not have attributes/constants
  • if it has attributes, those should be final and static (they are implicitly). If this is the case, one should suggest using a method with a default impl on the interface or use an enum/class
  • should have methods (some use interfaces as a constant class), this should trigger the constant class lint:
interface MyConstants {
    final static String MY_CONSTANT = "Hello World";
    final static String MY_ERROR = "Input is wrong";
}
  • Interfaces should be implemented by at least one class (easy indicator to detect that something is wrong with an interface)
@Luro02 Luro02 added good first issue Good for newcomers D-easy Easy to implement. labels Jan 13, 2023
This was referenced Jan 15, 2023
@Luro02 Luro02 added the new-lint A new lint. label Jan 15, 2023
@Luro02 Luro02 self-assigned this Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-easy Easy to implement. good first issue Good for newcomers new-lint A new lint.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant