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

Validation error messages can be ambigious #4455

Open
Bananeweizen opened this issue Aug 29, 2024 · 2 comments
Open

Validation error messages can be ambigious #4455

Bananeweizen opened this issue Aug 29, 2024 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Bananeweizen
Copy link
Contributor

What is the smallest, simplest way to reproduce the problem?

Enable these rules, all without parameters

org.openrewrite.java.logging.log4j.ParameterizedLogging
org.openrewrite.java.logging.ParameterizedLogging
org.openrewrite.java.logging.slf4j.ParameterizedLogging

What did you see?

[ERROR] Recipe validation error in ParameterizedLogging.methodPattern: is required

This can be very confusing, when looking up the recipe by (short) name. Only 1 of 3 has parameters. Therefore the user may end up adding the parameters to the wrong recipe, reading the wrong documentation etc.

Even though avoiding the full qualified names is generally a nice idea, it can lead to additional trouble.

Are you interested in contributing a fix to OpenRewrite?

Maybe. Depends on which direction a fix would go.

@Bananeweizen Bananeweizen added the bug Something isn't working label Aug 29, 2024
@timtebeek
Copy link
Contributor

Hmm; that's a bit unfortunate indeed, but hopefully rare; In this case it's the shortest one that's missing its options; glad at least that we correctly reject that in the validation.

Indeed not sure what to do specifically here, but fully qualifying the recipe name would only help if there are more such identical class names, which I think is reasonably rare, especially not expecting those to be used together (folks use one or the other).

@timtebeek
Copy link
Contributor

I could see a case though to always fully qualify; especially with a Spring Boot 3.x best practices containing 2556 recipes, it might make sense to always fully qualify the recipe name.

@timtebeek timtebeek added the good first issue Good for newcomers label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Status: Backlog
Development

No branches or pull requests

2 participants