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

Avoid using regexps always #80

Open
gsmet opened this issue Mar 21, 2024 · 2 comments
Open

Avoid using regexps always #80

gsmet opened this issue Mar 21, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@gsmet
Copy link
Collaborator

gsmet commented Mar 21, 2024

@ammachado in the configuration properties recipes, we say that the elements can be regexp but in fact they always are, right?

So if you want to replace quarkus.something key, you actually need to define quarkus\.something or you will also replace quarkuswsomethingor quarkus-something.

This makes things a bit more complex than they need to be and also not in line with https://docs.openrewrite.org/recipes/properties/changepropertykey where you have this regex boolean to actually enable regexp transformation.

I wonder if we should change the current behavior to avoid regexps in the default case and only enable regexps when regex is set to true.

That would be a breaking change but I think these recipes are new enough that it's worth breaking them to be consistent with the rest of OpenRewrite.

I thought about that because I was migrating old Quarkus Update recipes to this new stuff.

WDYT?

/cc @timtebeek for advice.

@gsmet
Copy link
Collaborator Author

gsmet commented Mar 26, 2024

Hey @ammachado ,

Did you have time to think about it? I can implement it, I just wanted to make sure you were in line with the idea and I didn't want to step on your toes.

@ammachado
Copy link
Contributor

I used regex on the property recipes due to the changes required on properties that have map keys. If there's a flag to enable regexes for the property keys, how the recipe will capture the parts of the config that are independent of the map key? I can make changes to accommodate substitutions in separate parts, but to me it seems that the regex is a simpler approach.

@timtebeek timtebeek moved this to Backlog in OpenRewrite May 5, 2024
@timtebeek timtebeek added the enhancement New feature or request label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

3 participants