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

CreateTextFile should override files of different type #3682

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

timtebeek
Copy link
Contributor

@timtebeek timtebeek commented Nov 12, 2023

What's changed?

Allow CreateTextFile to overwrite files in a different format than PlainText.

What's your motivation?

We recently started parsing Jenkinsfile as Groovy, which unfortunately broke the CreateTextFile used in ModernizeJenkinsfile
https://github.com/openrewrite/rewrite-jenkins/blob/8914ccd62655d65f2c54e2e40ed6289f13f69542/src/main/resources/META-INF/rewrite/rewrite.yml#L53-L70
Fixes openrewrite/rewrite-jenkins#52

Anything in particular you'd like reviewers to focus on?

Called out below.

Have you considered any alternatives or workarounds?

Not really; looked towards FindAndReplace as that also allows text replace regardless of file type.

Any additional context

@timtebeek timtebeek added the bug Something isn't working label Nov 12, 2023
@timtebeek timtebeek self-assigned this Nov 12, 2023
Copy link
Member

@sambsnyd sambsnyd left a comment

Choose a reason for hiding this comment

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

Looks good to me

rewrite-test/build.gradle.kts Show resolved Hide resolved
@timtebeek timtebeek merged commit 368b253 into main Nov 13, 2023
1 check passed
@timtebeek timtebeek deleted the create_text_file_should_override_different_file_type branch November 13, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Jenkinsfile is not overwritten
3 participants