-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Update spotless to 7.1.0
#18770
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
base: main
Are you sure you want to change the base?
Update spotless to 7.1.0
#18770
Conversation
246ec7e
to
3c3d1c9
Compare
removeWildcardImports
removeWildcardImports
removeWildcardImports
removeWildcardImports
removeWildcardImports
3c3d1c9
to
2ea7836
Compare
❌ Gradle check result for 2ea7836: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
2ea7836
to
965ef23
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Looks like the support was added recently diffplug/spotless#2517, we relied on the custom logic until now |
removeWildcardImports
7.1.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Pankraz76 for the change!
965ef23
to
ad24bc0
Compare
could not do it without @iddeepak, thanks for the decent impl. |
kindly FYI: its been around, so might be any good, despite the academical risk. @sbrannen |
ad24bc0
to
bd777ca
Compare
@Pankraz76 I tested this on local, with this plugin it removes the wildcard imports directly and doesn't add associated imports. After running spotlessApply imports are removed, it causes compile issues.
|
yes its just able to remove not replace unfortunately. Assuming its just a simple regex as before its not the workaround solution provided by issue discussion, moved into dedicated rule. |
its assuming that removal of the code is not compiling anymore therefore unable to ship. The local changes can then be resolved by some IDE just opening the changed files. As spot has no type awareness its not able to really replace the wildcard like desired and expected as spot normally delivers the fixes. Rewrite can deliver this. But we can and should adapt to fail the build and not break the code. This is kind of awkward. Just throwing the error as before on wildcard detected would be more complain, with very good reasoning given by @sbrannen |
❌ Gradle check result for bd777ca: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for bd777ca: ABORTED Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
I agree with the proposal that failing the build with a clear lint error is safer and more predictable than silently removing critical imports. Thank you @Pankraz76, Learning as always from your contributions! |
@Pankraz76 should we wait for diffplug/spotless#2557 to released with the new version and then we can make the changes to use |
sure thing no need to rush. Actually should just dedicate the feature in PR. Is does not change anything, as it seems here are not wildcards. |
Signed-off-by: Vincent Potucek <[email protected]>
bd777ca
to
f95f1d9
Compare
❌ Gradle check result for f95f1d9: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Update spotless to
7.1.0
[Describe what this change achieves]
while experimenting with rewrite i came across this custom solution for what recently has been integrated into spot.
removeWildcardImports()
diffplug/spotless#2526could not do it without @iddeepak, thanks for the decent impl.
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.