Skip to content

Inconsistent use of glob imports #2076

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

Open
solonovamax opened this issue Mar 28, 2025 · 0 comments
Open

Inconsistent use of glob imports #2076

solonovamax opened this issue Mar 28, 2025 · 0 comments
Labels

Comments

@solonovamax
Copy link
Contributor

Some classes use glob imports, while others don't. The use of glob imports across files seems to be rather inconsistent.

Currently, with spotless, there doesn't seem to be a way to enforce using/disallowing glob imports, however there is an open issue for it: diffplug/spotless#649.
Some comments on the issue suggest using

<replaceRegex>
    <name>Remove wildcard imports</name>
    <searchRegex>import\s+(?:static\s+)?[^\*\s]+\*;(\r\n|\r|\n)</searchRegex>
    <replacement>$1</replacement>
</replaceRegex>

to remove all the glob imports, however this solution will simply remove them and won't replace them with the appropriate imports, causing the compile to fail.

Opened due to discussion in #2074

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants