-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Adhering to Quarkus Guidelines: Avoid Wildcard Imports
To adhere to the Quarkus performance approach and avoid wildcard imports under any circumstances (to enable pre-optimization), the guidelines suggest setting the import count to 999. This ensures that wildcard imports are not introduced, thereby improving maintainability and adhering to best practices.
Steps to Disable Wildcard Imports
Referencing the official Quarkus Contributing Guide, follow these steps to disable wildcard imports:
- Navigate to Editor → Code Style → Java → Imports.
- Set Class count to use import with '*' to
999. - Set Names count to use static import with '*' to
999.
Automating Best Practices
Considering the suggestion by @rhusar, we can leverage .editorconfig to eliminate the need for manual configuration. This aligns with the "convention over configuration" principle commonly adopted by frameworks. Automating this ensures developers follow best practices right from the start.
Blocking Wildcard Imports via PR
The proposed Pull Request #45372 aims to introduce a blockage of any wildcard imports. This further enforces the standard and helps maintain consistent, optimized coding practices across the Quarkus codebase.