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

Introduce Check{Argument,State}WithMessageAndArguments Refaster rules #1135

Conversation

Stephan202
Copy link
Member

Suggested commit message:

Introduce `Check{Argument,State}WithMessageAndArguments` Refaster rules

The tests pass, but when I run this against an internal code base relevant violations aren't replaced. Requires a deeper look.

@Stephan202 Stephan202 added this to the 0.17.0 milestone Apr 13, 2024
@Stephan202 Stephan202 requested review from werli and rickie April 13, 2024 19:14
* Prefer {@link Preconditions#checkArgument(boolean, String, Object...)} over more verbose
* alternatives.
*/
// XXX: This check assumes that the format string only uses `%s` placeholders.
Copy link
Member Author

Choose a reason for hiding this comment

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

So this isn't fully correct. One option is to create an BugChecker instead, but that's more work 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I went down the rabbit hole: #1139.

Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Member 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.

Closing this PR in favour of #1139.

* Prefer {@link Preconditions#checkArgument(boolean, String, Object...)} over more verbose
* alternatives.
*/
// XXX: This check assumes that the format string only uses `%s` placeholders.
Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I went down the rabbit hole: #1139.

@Stephan202 Stephan202 closed this Apr 14, 2024
@Stephan202 Stephan202 deleted the sschroevers/prevent-unnecessary-precondition-formatting branch April 14, 2024 17:52
@Stephan202 Stephan202 removed this from the 0.17.0 milestone Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant