-
Notifications
You must be signed in to change notification settings - Fork 26
Issue #17487: Add StreamRulesRecipes
#496
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
Conversation
having it running it spot and check, its save to say its already (transient) a part of this project. If you want to integrate this as well, im here to help. |
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.
I'm skeptical. It seems likely that some of the suggested changes will sometimes wrong. I'd need to understand exactly what is being changed and why. E.g. checks for misuse of equals are often incorrect when dealing with test code,
That's good!
Off topic. Please focus only on streams; everything else is obsolete to this issue. This is an example of "bad" merging, since it's not separated but bundled with broad Picnic fixes. Other issues, like removing unused code, are a good example of something everyone wants. |
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.
The issue is not no-brainers. It's whether the no-brainers can be incorporated in static analysis without using AI or solving the halting problem. I'm not convinced it can. Should unused code be removed? Yes. Can static analysis identify unused code without false positives. No.
I think you're convincing me that I do not want any semantic rewrite rules in the build.
Its just yet another SCA-tool. Currently there is none. ErrorProne is already capable of handling even the non-private aspects, which involves some real "magic", considering:
So actually, there is nothing new here—we’re having the same arguments as before. If we go to the quintessence of it, what I’m asking for is automation, which is precisely what this project is supposed to be about, right? Just like Gradle. They have already realized and admitted that manual effort does not scale. I’m not asking for a rewrite in particular, since the tool is only a vehicle. The core principle is: invest in automation once, reap the benefits continuously. We can, of course, achieve the same with Google ErrorProne and Picoc (or similar), but at a much higher cost in effort. The real question is whether we want to repeat manual fixes forever—or embrace automation where it clearly works. |
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.
I'm fine with warnings. I'm not OK with automated rewrites of code.
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.
as suggest/requested.
just like done in spot. we use it like PMD, giving warnings as suggested. |
<invoker.streamLogsOnFailures>true</invoker.streamLogsOnFailures> | ||
<version.sisu-maven-plugin>0.9.0.M4</version.sisu-maven-plugin> | ||
<version.plexus-utils>4.0.2</version.plexus-utils> | ||
<version.spotless-maven-plugin>3.0.0</version.spotless-maven-plugin> |
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.
imho, it seems we are using spotless @elharo
Thank you for proposal - not yet this time |
Apprechiate the feedback, of course — I’m here to help. If you’re open to it, we could also consider another tool to prevent repetitive manual tasks. Why Automation?Instead of fixing the same problems repeatedly, we can use tools like PMD or Error Prone. Examples where automation already helped: Benefits
Next StepsIf there’s interest, I’d be glad to help explore this further. 💡 Summary:
|
The question is not whether to automate. The question is whether specific proposed automations are accurate and useful. And the burden of proof is on the proposer to demonstrate that they are. A change may be good, but not be self-evidently good. If so, it's not going in until a compelling case is made. |
Inspired by:
What’s good for Checkstyle performance could also be beneficial for Maven.
StreamRulesRecipes
checkstyle/checkstyle#17782tech.picnic.errorprone.refasterrules
diffplug/spotless#2641UpgradeToJava17
diffplug/spotless#2636StreamRulesRecipes
maven#11159Yes, it’s Rewrite that was rejected — but actually it’s just the vehicle. Think of it as an obsolete implementation detail, not the real point. The end product is the abstraction. So everyone — lovers and haters (sometimes the same people!) — can be satisfied. We’re not using Rewrite itself, only using it as a means to an end, right?
In reality, we’re following Google’s approach, interpreted and refined with the help of the Picnic team, while also aligning with the benefits delivered through Gradle’s integration of Error Prone:
PatchLocation:IN_PLACE
for KillLeakingJavaProcesses gradle/gradle#35019