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

Allow to restrict usage of wildcard imports #33

Closed
skuzzle opened this issue Apr 9, 2019 · 2 comments
Closed

Allow to restrict usage of wildcard imports #33

skuzzle opened this issue Apr 9, 2019 · 2 comments

Comments

@skuzzle
Copy link
Owner

skuzzle commented Apr 9, 2019

As wildcard imports may lead to inaccurate results, we could implement a flag that will cause the analysis to fail if one is encountered.

Wildcard imports can be considered a bad practice, so this might be a helpful feature anyway

@skuzzle
Copy link
Owner Author

skuzzle commented Apr 9, 2019

The special literal package part '*' can be used to match only wildcard imports:

Preventing a certain wildcarad import:

<bannedImport>java.util.'*'</bannedImport>

This pattern will prevent the usage of wildcard imports from java.util while still allowing explicit imports like java.util.ArrayList

Preventing any wildcard import:

<bannedImport>**.'*'</bannedImport>

@skuzzle
Copy link
Owner Author

skuzzle commented Apr 10, 2019

Will be released as 0.18.0

@skuzzle skuzzle closed this as completed Apr 17, 2019
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

No branches or pull requests

1 participant