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

Flag unused Refaster template parameters #4060

Conversation

Stephan202
Copy link
Contributor

No description provided.

@@ -149,6 +149,8 @@ public final class UnusedVariable extends BugChecker implements CompilationUnitT
// TODO(ghm): Find a sensible place to dedupe this with UnnecessarilyVisible.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If acceptable I don't mind also updating this list. Alternatively we can upstream our RefasterRuleModifiers check, which normalizes modifier usage by Refaster rule definitions more generally.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If acceptable I don't mind also updating this list.

Thanks, updating the list until we get around to deduping them SGTM

Alternatively we can upstream our RefasterRuleModifiers check, which normalizes modifier usage by Refaster rule definitions more generally.

That also sounds good if you have time/interest, but it also doesn't need to block this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updating the list until we get around to deduping them SGTM

Top; will do.

That also sounds good if you have time/interest, but it also doesn't need to block this PR

I'll make a note to consider this later then ✔️. (When we contributed #3813 and #2232 that caused some issues for downstream users due to a name collision (PicnicSupermarket/error-prone-support#622 and PicnicSupermarket/error-prone-support#686), so maybe this time I'll try to find an alternative name; hehe.)

Comment on lines +152 to +153
"com.google.errorprone.refaster.annotation.AfterTemplate",
"com.google.errorprone.refaster.annotation.BeforeTemplate",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of this list, currently there's only a test for javax.inject.Inject, so I didn't add any test cases for these new annotations, either. Let me know if I should. (I did test these changes against a collection of real Refaster templates.)

Copy link
Collaborator

@cushon cushon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG pending the update to UnnecessarilyVisible

@@ -149,6 +149,8 @@ public final class UnusedVariable extends BugChecker implements CompilationUnitT
// TODO(ghm): Find a sensible place to dedupe this with UnnecessarilyVisible.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If acceptable I don't mind also updating this list.

Thanks, updating the list until we get around to deduping them SGTM

Alternatively we can upstream our RefasterRuleModifiers check, which normalizes modifier usage by Refaster rule definitions more generally.

That also sounds good if you have time/interest, but it also doesn't need to block this PR

@Stephan202 Stephan202 force-pushed the sschroevers/flag-unused-refaster-template-parameters branch from 499e659 to 3fe5040 Compare September 7, 2023 19:11
Copy link
Contributor Author

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased and added a commit to also update UnnecessarilyVisible.

@@ -149,6 +149,8 @@ public final class UnusedVariable extends BugChecker implements CompilationUnitT
// TODO(ghm): Find a sensible place to dedupe this with UnnecessarilyVisible.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updating the list until we get around to deduping them SGTM

Top; will do.

That also sounds good if you have time/interest, but it also doesn't need to block this PR

I'll make a note to consider this later then ✔️. (When we contributed #3813 and #2232 that caused some issues for downstream users due to a name collision (PicnicSupermarket/error-prone-support#622 and PicnicSupermarket/error-prone-support#686), so maybe this time I'll try to find an alternative name; hehe.)

copybara-service bot pushed a commit that referenced this pull request Sep 12, 2023
Fixes #4060

FUTURE_COPYBARA_INTEGRATE_REVIEW=#4060 from PicnicSupermarket:sschroevers/flag-unused-refaster-template-parameters 3fe5040
PiperOrigin-RevId: 563768655
copybara-service bot pushed a commit that referenced this pull request Sep 12, 2023
Fixes #4060

FUTURE_COPYBARA_INTEGRATE_REVIEW=#4060 from PicnicSupermarket:sschroevers/flag-unused-refaster-template-parameters 3fe5040
PiperOrigin-RevId: 563768655
copybara-service bot pushed a commit that referenced this pull request Sep 12, 2023
Fixes #4060

FUTURE_COPYBARA_INTEGRATE_REVIEW=#4060 from PicnicSupermarket:sschroevers/flag-unused-refaster-template-parameters 3fe5040
PiperOrigin-RevId: 563768655
copybara-service bot pushed a commit that referenced this pull request Sep 12, 2023
Fixes #4060

FUTURE_COPYBARA_INTEGRATE_REVIEW=#4060 from PicnicSupermarket:sschroevers/flag-unused-refaster-template-parameters 3fe5040
PiperOrigin-RevId: 563768655
copybara-service bot pushed a commit that referenced this pull request Sep 14, 2023
Fixes #4060

FUTURE_COPYBARA_INTEGRATE_REVIEW=#4060 from PicnicSupermarket:sschroevers/flag-unused-refaster-template-parameters 3fe5040
PiperOrigin-RevId: 565426854
@Stephan202 Stephan202 deleted the sschroevers/flag-unused-refaster-template-parameters branch September 14, 2023 19:02
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

Successfully merging this pull request may close these issues.

2 participants