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

improvement: Disable inner import on classes that cause errorprone to fail #1617

Merged
merged 2 commits into from
Feb 12, 2021

Conversation

ferozco
Copy link
Contributor

@ferozco ferozco commented Jan 18, 2021

Before this PR

Errorprone produces BadImport which fails if you import nested classes with commonly used names. We however configured intellij to blindly auto-import nested classes where possible.

After this PR

==COMMIT_MSG==
Disable inner import on classes that cause ErrorProne to fail
==COMMIT_MSG==

List of classes to disable sourced from here

Possible downsides?

@policy-bot policy-bot bot requested a review from CRogers January 18, 2021 23:26
@carterkozak
Copy link
Contributor

Why don't we disable inner class imports entirely? The outer class provides important context, otherwise the imported class shouldn't be nested.

@ferozco
Copy link
Contributor Author

ferozco commented Jan 18, 2021

I agree with the motivation behind the original change and have found other cases (ex. Timber, Jackson, etc.) where importing the nested classes improves legibility and succinctness without a loss in clarity

@carterkozak
Copy link
Contributor

I don't agree with the original change, it's unfortunate that we penalize everyone for suboptimal generated code layout. I'd noticed inner classes getting auto-imported by my IDE lately and assumed it was an idea EA bug. This change shifts the needle the other direction which is an improvement, it's unfortunate that I missed the original discussion.

@robert3005 robert3005 closed this Jan 19, 2021
@robert3005 robert3005 reopened this Jan 19, 2021
@stale
Copy link

stale bot commented Feb 12, 2021

This PR has been automatically marked as stale because it has not been touched in the last 14 days. If you'd like to keep it open, please leave a comment or add the 'long-lived' label, otherwise it'll be closed in 7 days.

@stale stale bot added the stale label Feb 12, 2021
@stale stale bot removed the stale label Feb 12, 2021
@bulldozer-bot bulldozer-bot bot merged commit 4c89510 into develop Feb 12, 2021
@bulldozer-bot bulldozer-bot bot deleted the fo/disable-inner branch February 12, 2021 19:23
@svc-autorelease
Copy link
Collaborator

Released 3.67.0

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

Successfully merging this pull request may close these issues.

4 participants